diff --git a/Changelog.md b/Changelog.md index be9f0cc6..83ed1219 100644 --- a/Changelog.md +++ b/Changelog.md @@ -17,6 +17,8 @@ OpenCore Changelog - Reworked LogoutHook.command to support older macOS - Improved Duet USB legacy management for supported controllers - Implemented MP3 audio decoding for audio assistant support +- Added support for `PickerVariant` for more theme variants +- Added `OC_ATTR_HIDE_THEMED_ICONS` `PickerAttribute` for Time Machine #### v0.6.4 - Added `BlacklistAppleUpdate` to fix macOS 11 broken update optout diff --git a/Docs/Configuration.pdf b/Docs/Configuration.pdf index 10aa9868..984fe5fb 100644 Binary files a/Docs/Configuration.pdf and b/Docs/Configuration.pdf differ diff --git a/Docs/Configuration.tex b/Docs/Configuration.tex index 867be117..0254583a 100755 --- a/Docs/Configuration.tex +++ b/Docs/Configuration.tex @@ -3040,9 +3040,9 @@ entry choice will update till next manual reconfiguration. \item \texttt{0x0004} --- \texttt{OC\_ATTR\_USE\_GENERIC\_LABEL\_IMAGE}, provides predefined label images for boot entries without custom entries. May give less detail for the actual boot entry. - \item \texttt{0x0008} --- \texttt{OC\_ATTR\_USE\_ALTERNATE\_ICONS}, changes used icon set to - an alternate one if it is supported. For example, this could make a use of old-style icons - with a custom background colour. + \item \texttt{0x0008} --- \texttt{OC\_ATTR\_HIDE\_THEMED\_ICONS}, prefers builtin icons + for certain icon categories to match the theme style. For example, this could force + displaying the builtin Time Machine icon. Requires \texttt{OC\_ATTR\_USE\_VOLUME\_ICON}. \item \texttt{0x0010} --- \texttt{OC\_ATTR\_USE\_POINTER\_CONTROL}, enable pointer control in the picker when available. For example, this could make use of mouse or trackpad to control UI elements. @@ -3179,6 +3179,23 @@ entry choice will update till next manual reconfiguration. The \texttt{BootKicker} utility can be blessed to workaround this problem even without loading OpenCore. On some Macs however, the \texttt{BootKicker} utility cannot be run from OpenCore. +\item + \texttt{PickerVariant}\\ + \textbf{Type}: \texttt{plist\ string}\\ + \textbf{Failsafe}: \texttt{Auto}\\ + \textbf{Description}: Choose specific icon set used for boot management. + + The following values are supported: + \begin{itemize} + \tightlist + \item \texttt{Auto} --- Automatically select one set of icons based on \texttt{DefaultBackground} + colour. + \item \texttt{Default} --- Normal icon set (without prefix). + \item \texttt{Old} --- Vintage icon set (\texttt{Old} filename prefix). + \item \texttt{Modern} --- Nouveau icon set (\texttt{Modern} filename prefix). + \item Other value --- Custom icon set if supported by the resources. + \end{itemize} + \end{enumerate} \subsection{Debug Properties}\label{miscdebugprops} diff --git a/Docs/Differences/Differences.pdf b/Docs/Differences/Differences.pdf index 55e2d3f9..c7bbf661 100644 Binary files a/Docs/Differences/Differences.pdf and b/Docs/Differences/Differences.pdf differ diff --git a/Docs/Differences/Differences.tex b/Docs/Differences/Differences.tex index aede2608..0fa387ce 100644 --- a/Docs/Differences/Differences.tex +++ b/Docs/Differences/Differences.tex @@ -1,7 +1,7 @@ \documentclass[]{article} %DIF LATEXDIFF DIFFERENCE FILE %DIF DEL PreviousConfiguration.tex Wed Dec 16 19:38:04 2020 -%DIF ADD ../Configuration.tex Sat Jan 2 07:28:05 2021 +%DIF ADD ../Configuration.tex Sat Jan 2 15:39:49 2021 \usepackage{lmodern} \usepackage{amssymb,amsmath} @@ -3100,10 +3100,11 @@ entry choice will update till next manual reconfiguration. \item \texttt{0x0004} --- \texttt{OC\_ATTR\_USE\_GENERIC\_LABEL\_IMAGE}, provides predefined label images for boot entries without custom entries. May give less detail for the actual boot entry. - \item \texttt{0x0008} --- \texttt{OC\_ATTR\_USE\_ALTERNATE\_ICONS}, changes used icon set to - an alternate one if it is supported. For example, this could make a use of old-style icons - with a custom background colour. - \item \texttt{0x0010} --- \texttt{OC\_ATTR\_USE\_POINTER\_CONTROL}, enable pointer control + \item \texttt{0x0008} --- \texttt{OC\_ATTR\_\DIFdelbegin \DIFdel{USE}\DIFdelend \DIFaddbegin \DIFadd{HIDE}\DIFaddend \_\DIFdelbegin \DIFdel{ALTERNATE}\DIFdelend \DIFaddbegin \DIFadd{THEMED}\DIFaddend \_ICONS}, \DIFdelbegin \DIFdel{changes used icon set to an alternate one if it is supported}\DIFdelend \DIFaddbegin \DIFadd{prefers builtin icons + for certain icon categories to match the theme style}\DIFaddend . For example, this could \DIFdelbegin \DIFdel{make a use of old-style icons + with a custom background colour. }\DIFdelend \DIFaddbegin \DIFadd{force + displaying the builtin Time Machine icon. Requires }\texttt{\DIFadd{OC\_ATTR\_USE\_VOLUME\_ICON}}\DIFadd{. + }\DIFaddend \item \texttt{0x0010} --- \texttt{OC\_ATTR\_USE\_POINTER\_CONTROL}, enable pointer control in the picker when available. For example, this could make use of mouse or trackpad to control UI elements. \end{itemize} @@ -3239,7 +3240,25 @@ entry choice will update till next manual reconfiguration. The \texttt{BootKicker} utility can be blessed to workaround this problem even without loading OpenCore. On some Macs however, the \texttt{BootKicker} utility cannot be run from OpenCore. -\end{enumerate} +\DIFaddbegin \item + \texttt{\DIFadd{PickerVariant}}\\ + \textbf{\DIFadd{Type}}\DIFadd{: }\texttt{\DIFadd{plist\ string}}\\ + \textbf{\DIFadd{Failsafe}}\DIFadd{: }\texttt{\DIFadd{Auto}}\\ + \textbf{\DIFadd{Description}}\DIFadd{: Choose specific icon set used for boot management. + } + + \DIFadd{The following values are supported: + }\begin{itemize} + \tightlist + \item \texttt{\DIFadd{Auto}} \DIFadd{--- Automatically select one set of icons based on }\texttt{\DIFadd{DefaultBackground}} + \DIFadd{colour. + }\item \texttt{\DIFadd{Default}} \DIFadd{--- Normal icon set (without prefix). + }\item \texttt{\DIFadd{Old}} \DIFadd{--- Vintage icon set (}\texttt{\DIFadd{Old}} \DIFadd{filename prefix). + }\item \texttt{\DIFadd{Modern}} \DIFadd{--- Nouveau icon set (}\texttt{\DIFadd{Modern}} \DIFadd{filename prefix). + }\item \DIFadd{Other value --- Custom icon set if supported by the resources. + }\end{itemize} + +\DIFaddend \end{enumerate} \subsection{Debug Properties}\label{miscdebugprops} diff --git a/Docs/Errata/Errata.pdf b/Docs/Errata/Errata.pdf index 93029772..a3bbfa50 100644 Binary files a/Docs/Errata/Errata.pdf and b/Docs/Errata/Errata.pdf differ diff --git a/Docs/Sample.plist b/Docs/Sample.plist index d657cf1e..60a9edf6 100644 --- a/Docs/Sample.plist +++ b/Docs/Sample.plist @@ -733,6 +733,8 @@ PickerMode Builtin + PickerVariant + Auto PollAppleHotKeys ShowPicker diff --git a/Docs/SampleCustom.plist b/Docs/SampleCustom.plist index aa8f1953..c8101861 100644 --- a/Docs/SampleCustom.plist +++ b/Docs/SampleCustom.plist @@ -733,6 +733,8 @@ PickerMode Builtin + PickerVariant + Auto PollAppleHotKeys ShowPicker diff --git a/Include/Acidanthera/Library/OcBootManagementLib.h b/Include/Acidanthera/Library/OcBootManagementLib.h index dda71af9..de6fad5c 100755 --- a/Include/Acidanthera/Library/OcBootManagementLib.h +++ b/Include/Acidanthera/Library/OcBootManagementLib.h @@ -60,11 +60,11 @@ typedef struct OC_PICKER_CONTEXT_ OC_PICKER_CONTEXT; #define OC_ATTR_USE_VOLUME_ICON BIT0 #define OC_ATTR_USE_DISK_LABEL_FILE BIT1 #define OC_ATTR_USE_GENERIC_LABEL_IMAGE BIT2 -#define OC_ATTR_USE_ALTERNATE_ICONS BIT3 +#define OC_ATTR_HIDE_THEMED_ICONS BIT3 #define OC_ATTR_USE_POINTER_CONTROL BIT4 #define OC_ATTR_ALL_BITS (\ OC_ATTR_USE_VOLUME_ICON | OC_ATTR_USE_DISK_LABEL_FILE | \ - OC_ATTR_USE_GENERIC_LABEL_IMAGE | OC_ATTR_USE_ALTERNATE_ICONS | \ + OC_ATTR_USE_GENERIC_LABEL_IMAGE | OC_ATTR_HIDE_THEMED_ICONS | \ OC_ATTR_USE_POINTER_CONTROL) /** @@ -692,6 +692,10 @@ struct OC_PICKER_CONTEXT_ { // UINT32 PickerAttributes; // + // Picker icon set variant (refer to docs for requested behaviour). + // + CONST CHAR8 *PickerVariant; + // // Enable polling boot arguments. // BOOLEAN PollAppleHotKeys; diff --git a/Include/Acidanthera/Library/OcConfigurationLib.h b/Include/Acidanthera/Library/OcConfigurationLib.h index 07fb2210..1cbdc685 100644 --- a/Include/Acidanthera/Library/OcConfigurationLib.h +++ b/Include/Acidanthera/Library/OcConfigurationLib.h @@ -325,6 +325,7 @@ _(OC_STRING , HibernateMode , , OC_STRING_CONSTR ("None", _, __) , OC_DESTR (OC_STRING)) \ _(UINT32 , ConsoleAttributes , , 0 , ()) \ _(UINT32 , PickerAttributes , , 0 , ()) \ + _(OC_STRING , PickerVariant , , OC_STRING_CONSTR ("Auto", _, __) , OC_DESTR (OC_STRING)) \ _(UINT32 , TakeoffDelay , , 0 , ()) \ _(UINT32 , Timeout , , 0 , ()) \ _(BOOLEAN , PickerAudioAssist , , FALSE , ()) \ diff --git a/Library/OcConfigurationLib/OcConfigurationLib.c b/Library/OcConfigurationLib/OcConfigurationLib.c index 7536fe34..35046368 100644 --- a/Library/OcConfigurationLib/OcConfigurationLib.c +++ b/Library/OcConfigurationLib/OcConfigurationLib.c @@ -398,6 +398,7 @@ mMiscConfigurationBootSchema[] = { OC_SCHEMA_INTEGER_IN ("PickerAttributes", OC_GLOBAL_CONFIG, Misc.Boot.PickerAttributes), OC_SCHEMA_BOOLEAN_IN ("PickerAudioAssist", OC_GLOBAL_CONFIG, Misc.Boot.PickerAudioAssist), OC_SCHEMA_STRING_IN ("PickerMode", OC_GLOBAL_CONFIG, Misc.Boot.PickerMode), + OC_SCHEMA_STRING_IN ("PickerVariant", OC_GLOBAL_CONFIG, Misc.Boot.PickerVariant), OC_SCHEMA_BOOLEAN_IN ("PollAppleHotKeys", OC_GLOBAL_CONFIG, Misc.Boot.PollAppleHotKeys), OC_SCHEMA_BOOLEAN_IN ("ShowPicker", OC_GLOBAL_CONFIG, Misc.Boot.ShowPicker), OC_SCHEMA_INTEGER_IN ("TakeoffDelay", OC_GLOBAL_CONFIG, Misc.Boot.TakeoffDelay), diff --git a/Platform/OpenCanopy/GuiApp.c b/Platform/OpenCanopy/GuiApp.c index 0a1a77f2..ddf529bb 100644 --- a/Platform/OpenCanopy/GuiApp.c +++ b/Platform/OpenCanopy/GuiApp.c @@ -116,7 +116,7 @@ LoadImageFileFromStorage ( IN UINT32 MatchWidth, IN UINT32 MatchHeight, IN BOOLEAN Icon, - IN BOOLEAN Old, + IN CONST CHAR8 *Prefix, IN BOOLEAN AllowLessSize ) { @@ -137,7 +137,7 @@ LoadImageFileFromStorage ( Path, sizeof (Path), OPEN_CORE_IMAGE_PATH L"%a%a%a.icns", - Old ? "Old" : "", + Prefix, Index > 0 ? "Ext" : "", ImageFilePath ); @@ -169,11 +169,11 @@ LoadImageFileFromStorage ( if (EFI_ERROR (Status)) { DEBUG (( DEBUG_INFO, - "OCUI: Failed to load image (%u/%u) %s old:%d icon:%d - %r\n", + "OCUI: Failed to load image (%u/%u) %s prefix:%a icon:%d - %r\n", Index+1, ImageCount, Path, - Old, + Prefix, Icon, Status )); @@ -274,7 +274,7 @@ InternalContextConstruct ( UINTN UiScaleSize; UINT32 Index; UINT32 ImageDimension; - BOOLEAN Old; + CONST CHAR8 *Prefix; BOOLEAN Result; ASSERT (Context != NULL); @@ -315,9 +315,16 @@ InternalContextConstruct ( mBackgroundPixel.Blue = Context->BackgroundColor.Pixel.Blue; mBackgroundPixel.Reserved = 0xFF; - Old = Context->BackgroundColor.Raw == APPLE_COLOR_LIGHT_GRAY; - if ((Picker->PickerAttributes & OC_ATTR_USE_ALTERNATE_ICONS) != 0) { - Old = !Old; + if (AsciiStrCmp (Picker->PickerVariant, "Auto") == 0) { + if (Context->BackgroundColor.Raw == APPLE_COLOR_LIGHT_GRAY) { + Prefix = "Old"; + } else { + Prefix = ""; + } + } else if (AsciiStrCmp (Picker->PickerVariant, "Default") == 0) { + Prefix = ""; + } else { + Prefix = Picker->PickerVariant; } if (Context->BackgroundColor.Raw == APPLE_COLOR_SYRAH_BLACK) { @@ -354,7 +361,7 @@ InternalContextConstruct ( ImageDimension, ImageDimension, Index >= ICON_NUM_SYS, - Old, + Prefix, Index == ICON_CURSOR ); diff --git a/Platform/OpenCanopy/Views/BootPicker.c b/Platform/OpenCanopy/Views/BootPicker.c index 9dd23675..f7361132 100644 --- a/Platform/OpenCanopy/Views/BootPicker.c +++ b/Platform/OpenCanopy/Views/BootPicker.c @@ -849,7 +849,14 @@ BootPickerEntriesAdd ( VolumeEntry->Context = Entry; - if (UseVolumeIcon) { + // + // Load volume icons when allowed. + // Do not load volume icons for Time Machine entries unless explicitly enabled. + // This works around Time Machine icon style incompatibilities. + // + if (UseVolumeIcon + && (Entry->Type != OC_BOOT_APPLE_TIME_MACHINE + || (Context->PickerAttributes & OC_ATTR_HIDE_THEMED_ICONS) == 0)) { Status = Context->GetEntryIcon (Context, Entry, &IconFileData, &IconFileSize); if (!EFI_ERROR (Status)) { diff --git a/Platform/OpenCore/OpenCoreMisc.c b/Platform/OpenCore/OpenCoreMisc.c index 789282d7..47983648 100644 --- a/Platform/OpenCore/OpenCoreMisc.c +++ b/Platform/OpenCore/OpenCoreMisc.c @@ -739,6 +739,7 @@ OcMiscBoot ( UINTN BlessOverrideSize; CHAR16 **BlessOverride; CONST CHAR8 *AsciiPicker; + CONST CHAR8 *AsciiPickerVariant; CONST CHAR8 *AsciiDmg; AsciiPicker = OC_BLOB_GET (&Config->Misc.Boot.PickerMode); @@ -754,6 +755,8 @@ OcMiscBoot ( PickerMode = OcPickerModeBuiltin; } + AsciiPickerVariant = OC_BLOB_GET (&Config->Misc.Boot.PickerVariant); + AsciiDmg = OC_BLOB_GET (&Config->Misc.Security.DmgLoading); if (AsciiStrCmp (AsciiDmg, "Disabled") == 0) { @@ -877,6 +880,7 @@ OcMiscBoot ( Context->PickerMode = PickerMode; Context->ConsoleAttributes = Config->Misc.Boot.ConsoleAttributes; Context->PickerAttributes = Config->Misc.Boot.PickerAttributes; + Context->PickerVariant = AsciiPickerVariant; Context->BlacklistAppleUpdate = Config->Misc.Security.BlacklistAppleUpdate; if ((Config->Misc.Security.ExposeSensitiveData & OCS_EXPOSE_VERSION_UI) != 0) { diff --git a/Utilities/ocvalidate/ValidateMisc.c b/Utilities/ocvalidate/ValidateMisc.c index 042944a0..85b82514 100644 --- a/Utilities/ocvalidate/ValidateMisc.c +++ b/Utilities/ocvalidate/ValidateMisc.c @@ -152,6 +152,7 @@ CheckMisc ( CONST CHAR8 *HibernateMode; UINT32 PickerAttributes; CONST CHAR8 *PickerMode; + CONST CHAR8 *PickerVariant; UINT64 DisplayLevel; UINT64 AllowedDisplayLevel; UINT64 HaltLevel; @@ -180,6 +181,7 @@ CheckMisc ( HibernateMode = OC_BLOB_GET (&UserMisc->Boot.HibernateMode); PickerAttributes = UserMisc->Boot.PickerAttributes; PickerMode = OC_BLOB_GET (&UserMisc->Boot.PickerMode); + PickerVariant = OC_BLOB_GET (&UserMisc->Boot.PickerVariant); DisplayLevel = UserMisc->Debug.DisplayLevel; AllowedDisplayLevel = DEBUG_WARN | DEBUG_INFO | DEBUG_VERBOSE | DEBUG_ERROR; HaltLevel = DisplayLevel; @@ -222,6 +224,11 @@ CheckMisc ( ++ErrorCount; } + if (PickerVariant[0] == '\0') { + DEBUG ((DEBUG_WARN, "Misc->Boot->PickerVariant cannot be empty!\n")); + ++ErrorCount; + } + // // FIXME: Check whether DisplayLevel only supports values within AllowedDisplayLevel, or all possible levels in DebugLib.h? //