mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-27 07:44:24 +02:00
Make dark mode menu bar color in inactive state similar to light mode
Fix #16445, close #16446
This commit is contained in:
parent
a449c5e804
commit
4ddad4683b
@ -971,30 +971,31 @@ namespace NppDarkMode
|
||||
int iTextStateID = MBI_NORMAL;
|
||||
int iBackgroundStateID = MBI_NORMAL;
|
||||
{
|
||||
if ((pUDMI->dis.itemState & ODS_INACTIVE) | (pUDMI->dis.itemState & ODS_DEFAULT))
|
||||
{
|
||||
// normal display
|
||||
iTextStateID = MBI_NORMAL;
|
||||
iBackgroundStateID = MBI_NORMAL;
|
||||
}
|
||||
if (pUDMI->dis.itemState & ODS_HOTLIGHT)
|
||||
{
|
||||
// hot tracking
|
||||
iTextStateID = MBI_HOT;
|
||||
iBackgroundStateID = MBI_HOT;
|
||||
}
|
||||
if (pUDMI->dis.itemState & ODS_SELECTED)
|
||||
{
|
||||
// clicked
|
||||
iTextStateID = MBI_PUSHED;
|
||||
iBackgroundStateID = MBI_PUSHED;
|
||||
}
|
||||
if ((pUDMI->dis.itemState & ODS_GRAYED) || (pUDMI->dis.itemState & ODS_DISABLED))
|
||||
else if (pUDMI->dis.itemState & ODS_HOTLIGHT)
|
||||
{
|
||||
// disabled / grey text
|
||||
// hot tracking
|
||||
iTextStateID = (pUDMI->dis.itemState & ODS_INACTIVE) ? MBI_DISABLEDHOT : MBI_HOT;
|
||||
iBackgroundStateID = MBI_HOT;
|
||||
}
|
||||
else if ((pUDMI->dis.itemState & ODS_GRAYED) || (pUDMI->dis.itemState & ODS_DISABLED) || (pUDMI->dis.itemState & ODS_INACTIVE))
|
||||
{
|
||||
// disabled / grey text / inactive
|
||||
iTextStateID = MBI_DISABLED;
|
||||
iBackgroundStateID = MBI_DISABLED;
|
||||
}
|
||||
else if (pUDMI->dis.itemState & ODS_DEFAULT)
|
||||
{
|
||||
// normal display
|
||||
iTextStateID = MBI_NORMAL;
|
||||
iBackgroundStateID = MBI_NORMAL;
|
||||
}
|
||||
|
||||
if (pUDMI->dis.itemState & ODS_NOACCEL)
|
||||
{
|
||||
dwFlags |= DT_HIDEPREFIX;
|
||||
@ -1038,15 +1039,24 @@ namespace NppDarkMode
|
||||
|
||||
DTTOPTS dttopts{};
|
||||
dttopts.dwSize = sizeof(DTTOPTS);
|
||||
if (iTextStateID == MBI_NORMAL || iTextStateID == MBI_HOT || iTextStateID == MBI_PUSHED)
|
||||
dttopts.dwFlags = DTT_TEXTCOLOR;
|
||||
switch (iTextStateID)
|
||||
{
|
||||
dttopts.dwFlags |= DTT_TEXTCOLOR;
|
||||
dttopts.crText = NppDarkMode::getTextColor();
|
||||
}
|
||||
else if (iTextStateID == MBI_DISABLED || iTextStateID == MBI_DISABLEDHOT || iTextStateID == MBI_DISABLEDPUSHED)
|
||||
{
|
||||
dttopts.dwFlags |= DTT_TEXTCOLOR;
|
||||
dttopts.crText = NppDarkMode::getDisabledTextColor();
|
||||
case MBI_NORMAL:
|
||||
case MBI_HOT:
|
||||
case MBI_PUSHED:
|
||||
{
|
||||
dttopts.crText = NppDarkMode::getTextColor();
|
||||
break;
|
||||
}
|
||||
|
||||
case MBI_DISABLED:
|
||||
case MBI_DISABLEDHOT:
|
||||
case MBI_DISABLEDPUSHED:
|
||||
{
|
||||
dttopts.crText = NppDarkMode::getDisabledTextColor();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
::DrawThemeTextEx(g_menuTheme, pUDMI->um.hdc, MENU_BARITEM, iTextStateID, menuString, mii.cch, dwFlags, &pUDMI->dis.rcItem, &dttopts);
|
||||
|
Loading…
x
Reference in New Issue
Block a user