diff --git a/Contrib/Modern UI 2/Interface.nsh b/Contrib/Modern UI 2/Interface.nsh index 4333e783..74e1a382 100644 --- a/Contrib/Modern UI 2/Interface.nsh +++ b/Contrib/Modern UI 2/Interface.nsh @@ -49,6 +49,7 @@ Var mui.Button.Back !insertmacro MUI_DEFAULT MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico" !insertmacro MUI_DEFAULT MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico" !insertmacro MUI_DEFAULT MUI_BGCOLOR "FFFFFF" + !insertmacro MUI_DEFAULT MUI_TEXTCOLOR "000000" ;Map *_NOSTRETCH legacy define to the correct *_STRETCH value !verbose push 2 @@ -241,11 +242,11 @@ Var mui.Button.Back GetDlgItem $mui.Header.SubText $HWNDPARENT 1038 !ifndef MUI_HEADER_TRANSPARENT_TEXT - SetCtlColors $mui.Header.Text "" "${MUI_BGCOLOR}" - SetCtlColors $mui.Header.SubText "" "${MUI_BGCOLOR}" + SetCtlColors $mui.Header.Text "${MUI_TEXTCOLOR}" "${MUI_BGCOLOR}" + SetCtlColors $mui.Header.SubText "${MUI_TEXTCOLOR}" "${MUI_BGCOLOR}" !else - SetCtlColors $mui.Header.Text "" "transparent" - SetCtlColors $mui.Header.SubText "" "transparent" + SetCtlColors $mui.Header.Text "${MUI_TEXTCOLOR}" "transparent" + SetCtlColors $mui.Header.SubText "${MUI_TEXTCOLOR}" "transparent" !endif ;Header image diff --git a/Contrib/Modern UI 2/Pages/Directory.nsh b/Contrib/Modern UI 2/Pages/Directory.nsh index 1d5ebf7d..62093571 100644 --- a/Contrib/Modern UI 2/Pages/Directory.nsh +++ b/Contrib/Modern UI 2/Pages/Directory.nsh @@ -112,7 +112,8 @@ Directory page GetDlgItem $mui.DirectoryPage.SpaceAvailable $mui.DirectoryPage 1024 !ifdef MUI_DIRECTORYPAGE_BGCOLOR - SetCtlColors $mui.DirectoryPage.Directory "" "${MUI_DIRECTORYPAGE_BGCOLOR}" + !insertmacro MUI_DEFAULT MUI_DIRECTORYPAGE_TEXTCOLOR "" + SetCtlColors $mui.DirectoryPage.Directory "${MUI_DIRECTORYPAGE_TEXTCOLOR}" "${MUI_DIRECTORYPAGE_BGCOLOR}" !endif !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW diff --git a/Contrib/Modern UI 2/Pages/Finish.nsh b/Contrib/Modern UI 2/Pages/Finish.nsh index 74431c4e..be986a48 100644 --- a/Contrib/Modern UI 2/Pages/Finish.nsh +++ b/Contrib/Modern UI 2/Pages/Finish.nsh @@ -327,22 +327,22 @@ Finish page (implemented using nsDialogs) ;Title text ${NSD_CreateLabel} 120u 10u 195u ${MUI_FINISHPAGE_TITLE_HEIGHT}u "${MUI_FINISHPAGE_TITLE}" Pop $mui.FinishPage.Title - SetCtlColors $mui.FinishPage.Title "" "${MUI_BGCOLOR}" + SetCtlColors $mui.FinishPage.Title "${MUI_TEXTCOLOR}" "${MUI_BGCOLOR}" CreateFont $mui.FinishPage.Title.Font "$(^Font)" "12" "700" SendMessage $mui.FinishPage.Title ${WM_SETFONT} $mui.FinishPage.Title.Font 0 ;Finish text ${NSD_CreateLabel} 120u ${MUI_FINISHPAGE_TEXT_TOP}u 195u ${MUI_FINISHPAGE_TEXT_HEIGHT_BUTTONS}u "${MUI_FINISHPAGE_TEXT_REBOOT}" Pop $mui.FinishPage.Text - SetCtlColors $mui.FinishPage.Text "" "${MUI_BGCOLOR}" + SetCtlColors $mui.FinishPage.Text "${MUI_TEXTCOLOR}" "${MUI_BGCOLOR}" ;Radio buttons for reboot page ${NSD_CreateRadioButton} 120u ${MUI_FINISHPAGE_REBOOTNOW_TOP}u 195u 10u "${MUI_FINISHPAGE_TEXT_REBOOTNOW}" Pop $mui.FinishPage.RebootNow - SetCtlColors $mui.FinishPage.RebootNow "" "${MUI_BGCOLOR}" + SetCtlColors $mui.FinishPage.RebootNow "${MUI_TEXTCOLOR}" "${MUI_BGCOLOR}" ${NSD_CreateRadioButton} 120u ${MUI_FINISHPAGE_REBOOTLATER_TOP}u 195u 10u "${MUI_FINISHPAGE_TEXT_REBOOTLATER}" Pop $mui.FinishPage.RebootLater - SetCtlColors $mui.FinishPage.RebootLater "" "${MUI_BGCOLOR}" + SetCtlColors $mui.FinishPage.RebootLater "${MUI_TEXTCOLOR}" "${MUI_BGCOLOR}" !ifndef MUI_FINISHPAGE_REBOOTLATER_DEFAULT SendMessage $mui.FinishPage.RebootNow ${BM_SETCHECK} ${BST_CHECKED} 0 !else @@ -357,7 +357,7 @@ Finish page (implemented using nsDialogs) ;Title text ${NSD_CreateLabel} 120u 10u 195u ${MUI_FINISHPAGE_TITLE_HEIGHT}u "${MUI_FINISHPAGE_TITLE}" Pop $mui.FinishPage.Title - SetCtlColors $mui.FinishPage.Title "" "${MUI_BGCOLOR}" + SetCtlColors $mui.FinishPage.Title "${MUI_TEXTCOLOR}" "${MUI_BGCOLOR}" CreateFont $mui.FinishPage.Title.Font "$(^Font)" "12" "700" SendMessage $mui.FinishPage.Title ${WM_SETFONT} $mui.FinishPage.Title.Font 0 @@ -368,13 +368,13 @@ Finish page (implemented using nsDialogs) ${NSD_CreateLabel} 120u ${MUI_FINISHPAGE_TEXT_TOP}u 195u ${MUI_FINISHPAGE_TEXT_HEIGHT_BUTTONS}u "${MUI_FINISHPAGE_TEXT}" !endif Pop $mui.FinishPage.Text - SetCtlColors $mui.FinishPage.Text "" "${MUI_BGCOLOR}" + SetCtlColors $mui.FinishPage.Text "${MUI_TEXTCOLOR}" "${MUI_BGCOLOR}" ;Checkboxes !ifdef MUI_FINISHPAGE_RUN ${NSD_CreateCheckbox} 120u ${MUI_FINISHPAGE_RUN_TOP}u 195u 10u "${MUI_FINISHPAGE_RUN_TEXT}" Pop $mui.FinishPage.Run - SetCtlColors $mui.FinishPage.Run "" "${MUI_BGCOLOR}" + SetCtlColors $mui.FinishPage.Run "${MUI_TEXTCOLOR}" "${MUI_BGCOLOR}" !ifndef MUI_FINISHPAGE_RUN_NOTCHECKED SendMessage $mui.FinishPage.Run ${BM_SETCHECK} ${BST_CHECKED} 0 !endif @@ -383,7 +383,7 @@ Finish page (implemented using nsDialogs) !ifdef MUI_FINISHPAGE_SHOWREADME ${NSD_CreateCheckbox} 120u ${MUI_FINISHPAGE_SHOWREADME_TOP}u 195u 10u "${MUI_FINISHPAGE_SHOWREADME_TEXT}" Pop $mui.FinishPage.ShowReadme - SetCtlColors $mui.FinishPage.ShowReadme "" "${MUI_BGCOLOR}" + SetCtlColors $mui.FinishPage.ShowReadme "${MUI_TEXTCOLOR}" "${MUI_BGCOLOR}" !ifndef MUI_FINISHPAGE_SHOWREADME_NOTCHECKED SendMessage $mui.FinishPage.ShowReadme ${BM_SETCHECK} ${BST_CHECKED} 0 !endif @@ -408,6 +408,24 @@ Finish page (implemented using nsDialogs) StrCpy $mui.FinishPage.DisableAbortWarning "1" !endif + !ifndef MUI_FORCECLASSICCONTROLS + ${If} ${IsHighContrastModeActive} + !endif + ; SetCtlColors does not change the check/radio text color (bug #443) + !ifndef MUI_FINISHPAGE_NOREBOOTSUPPORT + System::Call 'UXTHEME::SetWindowTheme(p$mui.FinishPage.RebootNow,w" ",w" ")' + System::Call 'UXTHEME::SetWindowTheme(p$mui.FinishPage.RebootLater,w" ",w" ")' + !endif + !ifdef MUI_FINISHPAGE_RUN + System::Call 'UXTHEME::SetWindowTheme(p$mui.FinishPage.Run,w" ",w" ")' + !endif + !ifdef MUI_FINISHPAGE_SHOWREADME + System::Call 'UXTHEME::SetWindowTheme(p$mui.FinishPage.ShowReadme,w" ",w" ")' + !endif + !ifndef MUI_FORCECLASSICCONTROLS + ${EndIf} + !endif + ;Show page Call ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}muiPageLoadFullWindow !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW diff --git a/Contrib/Modern UI 2/Pages/License.nsh b/Contrib/Modern UI 2/Pages/License.nsh index 05a3fe64..a74214a0 100644 --- a/Contrib/Modern UI 2/Pages/License.nsh +++ b/Contrib/Modern UI 2/Pages/License.nsh @@ -121,7 +121,7 @@ License page Function "${SHOW}" - ;Get conrol handles + ;Get control handles FindWindow $mui.LicensePage "#32770" "" $HWNDPARENT GetDlgItem $mui.LicensePage.TopText $mui.LicensePage 1040 GetDlgItem $mui.LicensePage.Text $mui.LicensePage 1006 diff --git a/Contrib/Modern UI 2/Pages/StartMenu.nsh b/Contrib/Modern UI 2/Pages/StartMenu.nsh index 831d5911..71c41bb6 100644 --- a/Contrib/Modern UI 2/Pages/StartMenu.nsh +++ b/Contrib/Modern UI 2/Pages/StartMenu.nsh @@ -136,8 +136,9 @@ Start Menu folder page GetDlgItem $mui.StartMenuPage.FolderList $mui.StartMenuPage 1004 !ifdef MUI_STARTMENUPAGE_BGCOLOR - SetCtlColors $mui.StartMenuPage.Location "" "${MUI_STARTMENUPAGE_BGCOLOR}" - SetCtlColors $mui.StartMenuMenu.FolderList "" "${MUI_STARTMENUPAGE_BGCOLOR}" + !insertmacro MUI_DEFAULT MUI_STARTMENUPAGE_TEXTCOLOR "" + SetCtlColors $mui.StartMenuPage.Location "${MUI_STARTMENUPAGE_TEXTCOLOR}" "${MUI_STARTMENUPAGE_BGCOLOR}" + SetCtlColors $mui.StartMenuMenu.FolderList "${MUI_STARTMENUPAGE_TEXTCOLOR}" "${MUI_STARTMENUPAGE_BGCOLOR}" !endif !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW diff --git a/Contrib/Modern UI 2/Pages/Welcome.nsh b/Contrib/Modern UI 2/Pages/Welcome.nsh index f4720446..9d0c43f3 100644 --- a/Contrib/Modern UI 2/Pages/Welcome.nsh +++ b/Contrib/Modern UI 2/Pages/Welcome.nsh @@ -147,14 +147,14 @@ Welcome page (implemented using nsDialogs) ;Title ${NSD_CreateLabel} 120u 10u 195u ${MUI_WELCOMEPAGE_TITLE_HEIGHT}u "${MUI_WELCOMEPAGE_TITLE}" Pop $mui.WelcomePage.Title - SetCtlColors $mui.WelcomePage.Title "" "${MUI_BGCOLOR}" + SetCtlColors $mui.WelcomePage.Title "${MUI_TEXTCOLOR}" "${MUI_BGCOLOR}" CreateFont $mui.WelcomePage.Title.Font "$(^Font)" "12" "700" SendMessage $mui.WelcomePage.Title ${WM_SETFONT} $mui.WelcomePage.Title.Font 0 ;Welcome text ${NSD_CreateLabel} 120u ${MUI_WELCOMEPAGE_TEXT_TOP}u 195u 130u "${MUI_WELCOMEPAGE_TEXT}" Pop $mui.WelcomePage.Text - SetCtlColors $mui.WelcomePage.Text "" "${MUI_BGCOLOR}" + SetCtlColors $mui.WelcomePage.Text "${MUI_TEXTCOLOR}" "${MUI_BGCOLOR}" ;Show page Call ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}muiPageLoadFullWindow diff --git a/Contrib/Modern UI 2/Readme.html b/Contrib/Modern UI 2/Readme.html index 66203bef..5de03f4a 100644 --- a/Contrib/Modern UI 2/Readme.html +++ b/Contrib/Modern UI 2/Readme.html @@ -339,6 +339,10 @@ MUI_HEADER_TRANSPARENT_TEXT
Set a transparent background for the header's label controls. Useful for custom user interfaces that set a bigger header image.

+

+ MUI_TEXTCOLOR (color: RRGGBBR hexadecimal)
+ Text color for the header, the Welcome page and the Finish page.
+ Default: 000000

Open/Close sectionMUI_HEADER_TRANSPARENT_TEXT
Set a transparent background for the header's label controls. Useful for custom user interfaces that set a bigger header image.

+

+ MUI_TEXTCOLOR (color: RRGGBBR hexadecimal)
+ Text color for the header, the Welcome page and the Finish page.
+ Default: 000000

Open/Close sectionWarning:\\ Setting the background color of check boxes to \c{transparent} may not function properly when using \c{\R{axpstyle}{XPStyle} on}. The background may be completely black instead of transparent when using certain Windows themes. +\\Warning:\\ Setting the background color of check boxes to \c{transparent} may not function properly when using \c{\R{axpstyle}{XPStyle} on}. The background may be completely black instead of transparent when using certain Windows themes. The text color might also be ignored when Visual Styles are enabled. \NsisWarnBlockContainerEnd \S2{setsilent} SetSilent diff --git a/Include/Util.nsh b/Include/Util.nsh index 7181a695..30d03a50 100644 --- a/Include/Util.nsh +++ b/Include/Util.nsh @@ -160,5 +160,25 @@ Pop ${_outvar} !macroend +!define /IfNDef SPI_GETHIGHCONTRAST 0x42 +!define /IfNDef HCF_HIGHCONTRASTON 0x01 +!define /IfNDef /math SYSSIZEOF_HIGHCONTRAST 8 + ${NSIS_PTR_SIZE} +!define IsHighContrastModeActive '"" IsHighContrastModeActive ""' +!macro _IsHighContrastModeActive _lhs _rhs _t _f +!ifmacrondef _LOGICLIB_TEMP +!include LogicLib.nsh +!endif +!insertmacro _LOGICLIB_TEMP +Push $1 +System::Call '*(i${SYSSIZEOF_HIGHCONTRAST},i0,p)p.r1' +System::Call 'USER32::SystemParametersInfo(i${SPI_GETHIGHCONTRAST},i${SYSSIZEOF_HIGHCONTRAST},pr1,i0)' +System::Call '*$1(i,i.s)' +Pop $_LOGICLIB_TEMP +System::Free $1 +Pop $1 +!insertmacro _& $_LOGICLIB_TEMP ${HCF_HIGHCONTRASTON} `${_t}` `${_f}` +!macroend + + !endif # !___UTIL__NSH___ !verbose pop