diff --git a/Changelog.md b/Changelog.md index be9f0cc6e81b4684fad226627d85d97306db0dc5..83ed12195daf66379cf4dd36dff683ae1e57deac 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 10aa98683332c21f8166b63a6db4e1a0459e8190..984fe5fbbceca0e3339d9b246e048b1b3effa630 100644 Binary files a/Docs/Configuration.pdf and b/Docs/Configuration.pdf differ diff --git a/Docs/Configuration.tex b/Docs/Configuration.tex index 867be1170b1326dfbac2fc357c5444888bc0c2fc..0254583a0df5a58f645303e0f5a1e27c1482c0a1 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 55e2d3f90f7860d6bdc6fe4e48abeafd0d0025e5..c7bbf6610f46102915e21575c06169707c043d5d 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 aede2608eb76f2084eed6e19f85b9cdc7773f643..0fa387ce9952cbe5cf04c1530a1190255093de1b 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 93029772eb14c041e029993fc152c5a6a75c68e0..a3bbfa501e3801a990ba91593381dac08af13422 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 d657cf1e0bc6b07d9672bda801263cefce5aeba2..60a9edf639b763787e257121f5e924816175c230 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 aa8f1953af34a5d74275bdc87e0252b9adb121a2..c8101861357d1873f3a67a3e5965e3dab4c42c45 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 dda71af947e19c885e1041973913c81893cbde7e..de6fad5cbf7cbf5e1a17b9b69fc35047a073fe53 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 07fb221099aab3b35054a6e3698aabc261e8999f..1cbdc6853c2f441ba7ed61b0fee553fa483d49da 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 7536fe34829ce73e6b3bcab8621345ce35684042..35046368c056c187e79f46b59c65ad66b9e9aea3 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 0a1a77f29643fb079e2ad3b62422cdb85cb1a695..ddf529bb27760a7a2bfb84af173765ebc9a57b7a 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 9dd236758e1f090bac072eabeb14ead673cc6cbf..f736113265245acb8eb0234d6740c4185864b9ed 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 789282d74c0ae9ff5fe3ee1b31073478f8388c8f..47983648833ee40ba9ea1950153d1449d31bee9b 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 042944a0e3028b668cdc91c7e402d8ad3af6dc2c..85b8251413d797d84b208d3c90f421f34e97772b 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? //