Skip to content

Commit 0f88c13

Browse files
committed
NSIS: Change progress bar bg color for dark mode
1 parent 20e1cd2 commit 0f88c13

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

misc/nsis/callbacks.nsh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -811,6 +811,25 @@ FunctionEnd
811811
; Dark mode for InstFiles page.
812812
Function ${F}PageInstFilesShow
813813
StrCmpS $DarkMode 0 _end
814+
815+
; Dark color for progress bar background
816+
${Reserve} $R0 HResult ''
817+
${Reserve} $R1 ThemeData ''
818+
${Reserve} $0 FillColor '' ; NSIS sytem plugin bug: Direct register memory access works correctly only with $0-$1
819+
System::Call 'uxtheme::OpenThemeData(p$mui.InstFilesPage.ProgressBar, w"PROGRESS") p.${r.ThemeData}'
820+
StrCmpS ${ThemeData} 0 _@
821+
System::Call 'uxtheme::GetThemeColor(p${r.ThemeData}, i${PP_FILL}, i${PBFS_NORMAL}, i${TMT_FILLCOLOR}, @${r.FillColor}) i.${r.HResult}'
822+
StrCmpS ${HResult} 0 0 _@@
823+
System::Call 'uxtheme::SetWindowTheme(p$mui.InstFilesPage.ProgressBar, w" ", w" ")'
824+
SendMessage $mui.InstFilesPage.ProgressBar ${PBM_SETBKCOLOR} 0 ${DARK_BGCOLOR_2}
825+
SendMessage $mui.InstFilesPage.ProgressBar ${PBM_SETBARCOLOR} 0 ${FillColor}
826+
_@@:
827+
System::Call 'uxtheme::CloseThemeData(p${r.ThemeData})'
828+
_@:
829+
${Release} FillColor ''
830+
${Release} ThemeData ''
831+
${Release} Hresult ''
832+
814833
SetCtlColors $mui.InstFilesPage ${DARK_FGCOLOR} ${DARK_BGCOLOR_0}
815834
SetCtlColors $mui.InstFilesPage.Text ${DARK_FGCOLOR} ${DARK_BGCOLOR_0}
816835
System::Call 'uxtheme::SetWindowTheme(p$mui.InstFilesPage.ShowLogButton, w"DarkMode_Explorer", n)'

misc/nsis/qutebrowser.nsi

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@
4242
!define /ifndef SCF_DEFAULT 0x0000
4343
!define /ifndef SCF_ALL 0x0004
4444

45+
!define /ifndef PP_FILL 5
46+
!define /ifndef PBFS_NORMAL 1
47+
48+
!define /ifndef TMT_FILLCOLOR 3802
49+
4550
; MUI2
4651
!include 'MUI2.nsh'
4752
!define MUI_BGCOLOR 'SYSCLR:Window'

0 commit comments

Comments
 (0)