diff --git a/Plugin/PluginDefinition.cpp b/Plugin/PluginDefinition.cpp index c9fd7c4..d4aec7a 100644 --- a/Plugin/PluginDefinition.cpp +++ b/Plugin/PluginDefinition.cpp @@ -24,6 +24,8 @@ const wchar_t sectionName[] = L"DarkNpp"; bool enableDark = false; +bool enableTabBkgnd = true; + const int menuItemEnableDark = 0; constexpr COLORREF darkColor = 0x333333; @@ -51,6 +53,8 @@ void LoadSettings() ::PathAppend(iniFilePath, TEXT("\\DarkNpp.ini")); enableDark = ::GetPrivateProfileInt(sectionName, L"useDark", 1, iniFilePath) != 0; + + enableTabBkgnd = ::GetPrivateProfileInt(sectionName, L"enableTabBG", 1, iniFilePath) != 0; } void SavePluginParams() @@ -71,14 +75,14 @@ void About() { ::MessageBox( NULL, - L"This is Dark Theme Notepad++ test.\n" + L"This is Dark Mode Notepad++ test.\n" L"Plugin is using undocumented WINAPI.\n" L"@2020 by oZone", L"About", MB_OK); } -inline bool IsAtLeastWin10Build(DWORD buildNumber) +bool IsAtLeastWin10Build(DWORD buildNumber) { if (!IsWindows10OrGreater()) { @@ -228,7 +232,7 @@ BOOL CALLBACK ScrollBarChildProc(HWND hWnd, LPARAM /*lparam*/) return TRUE; } -BOOL CALLBACK TabBKChildProc(HWND hWnd, LPARAM /*lparam*/) // Tab background +BOOL CALLBACK TabBkgndChildProc(HWND hWnd, LPARAM /*lparam*/) // Tab background { WCHAR className[64] = { 0 }; if (GetClassName(hWnd, className, _countof(className)) > 0) @@ -250,5 +254,9 @@ void SetDarkNpp() SetTooltips(nppData._nppHandle, enableDark); EnumChildWindows(nppData._nppHandle, &ScrollBarChildProc, NULL); - EnumChildWindows(nppData._nppHandle, &TabBKChildProc, NULL); + + if (enableTabBkgnd) + { + EnumChildWindows(nppData._nppHandle, &TabBkgndChildProc, NULL); + } } diff --git a/Plugin/PluginDefinition.h b/Plugin/PluginDefinition.h index 2caa3de..5c50282 100644 --- a/Plugin/PluginDefinition.h +++ b/Plugin/PluginDefinition.h @@ -79,13 +79,13 @@ void SavePluginParams(); void DarkCheckTag(); void About(); -inline bool IsAtLeastWin10Build(DWORD buildNumber); +bool IsAtLeastWin10Build(DWORD buildNumber); void SetMode(HMODULE hUxtheme, bool useDark); void SetTheme(HWND hWnd, bool useDark); void SetTitleBar(HWND hWnd, bool useDark); void SetTooltips(HWND hWnd, bool useDark); BOOL CALLBACK ScrollBarChildProc(HWND hWnd, LPARAM lparam); -BOOL CALLBACK TabBKChildProc(HWND hWnd, LPARAM lparam); +BOOL CALLBACK TabBkgndChildProc(HWND hWnd, LPARAM lparam); void SetDarkNpp(); diff --git a/Plugin/version.h b/Plugin/version.h index a3f9bfa..1cfa10c 100644 --- a/Plugin/version.h +++ b/Plugin/version.h @@ -19,7 +19,7 @@ #define VER_PLUGIN_NAME_STR "DarkNpp" #define VER_PLUGIN_MAJOR 0 #define VER_PLUGIN_MINOR 3 -#define VER_PLUGIN_REVISION 0 +#define VER_PLUGIN_REVISION 1 #define VER_PLUGIN_BUILD 0 #define VER_PLUGIN_AUTHOR_STR "oZone" #define VER_PLUGIN_YEAR 2020 diff --git a/README.md b/README.md index 824d874..8ec9b49 100644 --- a/README.md +++ b/README.md @@ -6,13 +6,40 @@ [![Total downloads](https://img.shields.io/github/downloads/ozone10/Npp-DarkNpp/total.svg)](https://github.com/ozone10/Npp-DarkNpp/releases) [![Licence](https://img.shields.io/github/license/ozone10/Npp-DarkNpp?color=9cf)](https://www.gnu.org/licenses/gpl-3.0.en.html) -[Notepad++](https://github.com/notepad-plus-plus/notepad-plus-plus) plugin that allows to use partially dark theme on Notepad++. -Currently support: main title bar, some tooltips, some scroll bars and context menus. +[Notepad++](https://github.com/notepad-plus-plus/notepad-plus-plus) plugin that allows to use partially dark mode (theme) on Notepad++. +Currently support: main title bar, some tooltips, some scroll bars, main tab background and context menus. -This is for testing purposes only. +This is mainly for testing purposes. * * *
+ +* * * + +## Options + +- **useDark** - Option to choose mode. + + - Value **0** - use light mode. + - Value **1** - use dark mode, default value. + +- **enableTabBG** - This is 'secret' setting, you can change it only via editing config file. +This setting affect main tab background. + + - Value **0** - disable tab background. + - Value **1** - enable tab background, default value. + +* * * + +## Configs + +- **Default:** Dark mode + +```ini +[DarkNpp] +useDark=1 +enableTabBG=1 +```