+chg: enable factory themes menu only for corresponding color mode

This commit is contained in:
Rainer Kottenhoff 2021-04-29 01:39:17 +02:00
parent d96a62f776
commit 168a42d774
2 changed files with 4 additions and 10 deletions

View File

@ -3483,6 +3483,7 @@ LRESULT MsgInitMenu(HWND hwnd, WPARAM wParam, LPARAM lParam)
return FALSE;
}
bool const dm = UseDarkMode();
bool const si = Flags.bSingleFileInstance;
bool const cf = StrIsNotEmpty(Paths.CurrentFile);
bool const sav = Globals.bCanSaveIniFile;
@ -3828,6 +3829,9 @@ LRESULT MsgInitMenu(HWND hwnd, WPARAM wParam, LPARAM lParam)
CheckCmd(hmenu, IDM_VIEW_MINTOTRAY, Settings.MinimizeToTray);
CheckCmd(hmenu, IDM_VIEW_TRANSPARENT, Settings.TransparentMode);
EnableCmd(hmenu, IDM_THEMES_DEFAULT, !dm);
EnableCmd(hmenu, IDM_THEMES_RESOURCES, dm);
bool const dwr = (Settings.RenderingTechnology > SC_TECHNOLOGY_DEFAULT);
//bool const gdi = ((Settings.RenderingTechnology % SC_TECHNOLOGY_DIRECTWRITEDC) == 0);

View File

@ -412,12 +412,6 @@ static inline void AppendStyle(LPWSTR lpszStyleDest, size_t cchSizeDest, LPCWSTR
//
static HMENU s_hmenuThemes = NULL;
static void _EnableFactoryModes(HMENU hMenuBar) {
EnableCmd(hMenuBar, Theme_Files[Theme_FactoryLightMode].rid, !UseDarkMode());
EnableCmd(hMenuBar, Theme_Files[Theme_FactoryDarkMode].rid, UseDarkMode());
}
bool Style_InsertThemesMenu(HMENU hMenuBar)
{
if (s_hmenuThemes) {
@ -451,8 +445,6 @@ bool Style_InsertThemesMenu(HMENU hMenuBar)
unsigned const iTheme = GetModeThemeIndex();
CheckCmd(hMenuBar, Theme_Files[iTheme].rid, true);
_EnableFactoryModes(hMenuBar);
if ((iTheme >= Theme_CustomizedMode) && StrIsEmpty(Theme_Files[iTheme].szFilePath)) {
EnableCmd(hMenuBar, Theme_Files[iTheme].rid, false);
}
@ -512,8 +504,6 @@ void Style_DynamicThemesMenuCmd(int cmd, unsigned iCurThemeIdx)
Globals.idxLightModeTheme = iThemeIdx;
}
_EnableFactoryModes(Globals.hMainMenu);
_EnableSchemeConfig(iThemeIdx >= Theme_CustomizedMode);
CheckCmd(Globals.hMainMenu, Theme_Files[iThemeIdx].rid, true);