Make dark mode support for plugin by default

And remove the GUI option to disable this feature.
(based on d3b026bfeb)
This commit is contained in:
Don Ho 2022-06-05 03:51:34 +02:00
parent d3b026bfeb
commit 33ab652395
6 changed files with 3 additions and 14 deletions

View File

@ -915,7 +915,6 @@ The comments are here for explanation, it's not necessary to translate them.
<Item id="7126" name="Edge highlight"/> <Item id="7126" name="Edge highlight"/>
<Item id="7130" name="Reset"/> <Item id="7130" name="Reset"/>
<Item id="7135" name="Tones"/> <Item id="7135" name="Tones"/>
<Item id="7136" name="Apply dark mode on plugins with docking window (requires Notepad++ restart)"/>
</DarkMode> </DarkMode>
<MarginsBorderEdge title="Margins/Border/Edge"> <MarginsBorderEdge title="Margins/Border/Edge">

View File

@ -5547,7 +5547,7 @@ void NppParameters::feedGUIParameters(TiXmlNode *node)
_nppGUI._darkmode._isEnabled = parseYesNoBoolAttribute(TEXT("enable")); _nppGUI._darkmode._isEnabled = parseYesNoBoolAttribute(TEXT("enable"));
_nppGUI._darkmode._isEnabledPlugin = parseYesNoBoolAttribute(TEXT("enablePlugin")); //_nppGUI._darkmode._isEnabledPlugin = parseYesNoBoolAttribute(TEXT("enablePlugin"));
int i; int i;
const TCHAR* val; const TCHAR* val;
@ -6684,7 +6684,7 @@ void NppParameters::createXmlTreeFromGUIParams()
}; };
setYesNoBoolAttribute(TEXT("enable"), _nppGUI._darkmode._isEnabled); setYesNoBoolAttribute(TEXT("enable"), _nppGUI._darkmode._isEnabled);
setYesNoBoolAttribute(TEXT("enablePlugin"), _nppGUI._darkmode._isEnabledPlugin); //setYesNoBoolAttribute(TEXT("enablePlugin"), _nppGUI._darkmode._isEnabledPlugin);
GUIConfigElement->SetAttribute(TEXT("colorTone"), _nppGUI._darkmode._colorTone); GUIConfigElement->SetAttribute(TEXT("colorTone"), _nppGUI._darkmode._colorTone);
GUIConfigElement->SetAttribute(TEXT("customColorTop"), _nppGUI._darkmode._customColors.pureBackground); GUIConfigElement->SetAttribute(TEXT("customColorTop"), _nppGUI._darkmode._customColors.pureBackground);

View File

@ -715,7 +715,7 @@ public:
struct DarkModeConf final struct DarkModeConf final
{ {
bool _isEnabled = false; bool _isEnabled = false;
bool _isEnabledPlugin = false; bool _isEnabledPlugin = true;
NppDarkMode::ColorTone _colorTone = NppDarkMode::blackTone; NppDarkMode::ColorTone _colorTone = NppDarkMode::blackTone;
NppDarkMode::Colors _customColors = NppDarkMode::getDarkModeDefaultColors(); NppDarkMode::Colors _customColors = NppDarkMode::getDarkModeDefaultColors();
}; };

View File

@ -108,7 +108,6 @@ STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x1 FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN BEGIN
CONTROL "Enable &dark mode",IDC_CHECK_DARKMODE_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,12,150,10 CONTROL "Enable &dark mode",IDC_CHECK_DARKMODE_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,12,150,10
CONTROL "Apply dark mode on plugins with docking window (requires Notepad++ restart)",IDC_CHECK_DARKMODE_PLUGIN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,165,12,270,10
GROUPBOX "Tones",IDC_DARKMODE_TONES_GB_STATIC,10,25,440,154,BS_CENTER GROUPBOX "Tones",IDC_DARKMODE_TONES_GB_STATIC,10,25,440,154,BS_CENTER
CONTROL "Black",IDC_RADIO_DARKMODE_BLACK,"Button",BS_AUTORADIOBUTTON | WS_GROUP,15,35,80,10 CONTROL "Black",IDC_RADIO_DARKMODE_BLACK,"Button",BS_AUTORADIOBUTTON | WS_GROUP,15,35,80,10
CONTROL "Red",IDC_RADIO_DARKMODE_RED,"Button",BS_AUTORADIOBUTTON ,15,50,80,10 CONTROL "Red",IDC_RADIO_DARKMODE_RED,"Button",BS_AUTORADIOBUTTON ,15,50,80,10

View File

@ -1008,7 +1008,6 @@ intptr_t CALLBACK DarkModeSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
case WM_INITDIALOG: case WM_INITDIALOG:
{ {
::SendDlgItemMessage(_hSelf, IDC_CHECK_DARKMODE_ENABLE, BM_SETCHECK, nppGUI._darkmode._isEnabled, 0); ::SendDlgItemMessage(_hSelf, IDC_CHECK_DARKMODE_ENABLE, BM_SETCHECK, nppGUI._darkmode._isEnabled, 0);
::SendDlgItemMessage(_hSelf, IDC_CHECK_DARKMODE_PLUGIN, BM_SETCHECK, nppGUI._darkmode._isEnabledPlugin, 0);
int id = IDC_RADIO_DARKMODE_BLACK; int id = IDC_RADIO_DARKMODE_BLACK;
switch (nppGUI._darkmode._colorTone) switch (nppGUI._darkmode._colorTone)
@ -1211,13 +1210,6 @@ intptr_t CALLBACK DarkModeSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
} }
break; break;
case IDC_CHECK_DARKMODE_PLUGIN:
{
bool enableDarkModePlugin = isCheckedOrNot(static_cast<int>(wParam));
nppGUI._darkmode._isEnabledPlugin = enableDarkModePlugin;
}
break;
case IDC_RADIO_DARKMODE_BLACK: case IDC_RADIO_DARKMODE_BLACK:
case IDC_RADIO_DARKMODE_RED: case IDC_RADIO_DARKMODE_RED:
case IDC_RADIO_DARKMODE_GREEN: case IDC_RADIO_DARKMODE_GREEN:

View File

@ -421,5 +421,4 @@
#define IDD_CUSTOMIZED_COLOR11_STATIC (IDD_PREFERENCE_SUB_DARKMODE + 26) #define IDD_CUSTOMIZED_COLOR11_STATIC (IDD_PREFERENCE_SUB_DARKMODE + 26)
#define IDD_CUSTOMIZED_RESET_BUTTON (IDD_PREFERENCE_SUB_DARKMODE + 30) #define IDD_CUSTOMIZED_RESET_BUTTON (IDD_PREFERENCE_SUB_DARKMODE + 30)
#define IDC_DARKMODE_TONES_GB_STATIC (IDD_PREFERENCE_SUB_DARKMODE + 35) #define IDC_DARKMODE_TONES_GB_STATIC (IDD_PREFERENCE_SUB_DARKMODE + 35)
#define IDC_CHECK_DARKMODE_PLUGIN (IDD_PREFERENCE_SUB_DARKMODE + 36)
#endif //PREFERENCE_RC_H #endif //PREFERENCE_RC_H