Mercurial > dwindows
changeset 1981:ccd34ec31971
Win: Temporary fix for toolbar display issues with partial dark mode.
All controls are currently supported, except menubars and notebooks.
The toolbar buttons have occasional display issues which still need
improvement and this fix is a bit hacky and I'd prefer a better one.
With menubars and notebooks unsupported, partial dark mode is prefered.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Tue, 13 Aug 2019 09:12:05 +0000 |
parents | 38a455d2096c |
children | c35b68443905 |
files | win/dw.c |
diffstat | 1 files changed, 12 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/win/dw.c Tue Aug 13 06:35:13 2019 +0000 +++ b/win/dw.c Tue Aug 13 09:12:05 2019 +0000 @@ -762,7 +762,16 @@ return FALSE; #ifdef TOOLBAR else if(_tcsnicmp(tmpbuf, TOOLBARCLASSNAME, _tcslen(TOOLBARCLASSNAME)+1) == 0) + { + /* If we aren't in full dark mode */ + if(_DW_DARK_MODE_ALLOWED != 2) + { + /* Enable or disable visual themes */ + if(_SetWindowTheme) + _SetWindowTheme(window, (style & TBSTYLE_FLAT) ? L"" : NULL, (style & TBSTYLE_FLAT) ? L"" : NULL); + } return FALSE; + } #endif return TRUE; } @@ -771,9 +780,9 @@ { if(_DW_DARK_MODE_SUPPORTED) { - if(_DW_DARK_MODE_ALLOWED == 2) - { - if(_CanThemeWindow(window)) + if(_CanThemeWindow(window)) + { + if(_DW_DARK_MODE_ALLOWED == 2) { if(_DW_DARK_MODE_ENABLED) _SetWindowTheme(window, L"DarkMode_Explorer", NULL);