parent
f27e561379
commit
219cec8000
|
@ -7554,6 +7554,9 @@ void Notepad_plus::refreshDarkMode()
|
||||||
::SendMessage(_pFileSwitcherPanel->getHSelf(), NPPM_INTERNAL_REFRESHDARKMODE, 0, 0);
|
::SendMessage(_pFileSwitcherPanel->getHSelf(), NPPM_INTERNAL_REFRESHDARKMODE, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
::SendMessage(_mainDocTab.getHSelf(), NPPM_INTERNAL_REFRESHDARKMODE, 0, 0);
|
||||||
|
::SendMessage(_subDocTab.getHSelf(), NPPM_INTERNAL_REFRESHDARKMODE, 0, 0);
|
||||||
|
|
||||||
SendMessage(_findReplaceDlg.getHSelf(), NPPM_INTERNAL_REFRESHDARKMODE, 0, 0);
|
SendMessage(_findReplaceDlg.getHSelf(), NPPM_INTERNAL_REFRESHDARKMODE, 0, 0);
|
||||||
SendMessage(_incrementFindDlg.getHSelf(), NPPM_INTERNAL_REFRESHDARKMODE, 0, 0);
|
SendMessage(_incrementFindDlg.getHSelf(), NPPM_INTERNAL_REFRESHDARKMODE, 0, 0);
|
||||||
RedrawWindow(_pPublicInterface->getHSelf(), nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_ALLCHILDREN);
|
RedrawWindow(_pPublicInterface->getHSelf(), nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_ALLCHILDREN);
|
||||||
|
|
|
@ -1044,25 +1044,16 @@ namespace NppDarkMode
|
||||||
bool useDark = NppDarkMode::isExperimentalEnabled() && NppDarkMode::isEnabled();
|
bool useDark = NppDarkMode::isExperimentalEnabled() && NppDarkMode::isEnabled();
|
||||||
|
|
||||||
NppDarkMode::allowDarkModeForWindow(hwnd, useDark);
|
NppDarkMode::allowDarkModeForWindow(hwnd, useDark);
|
||||||
NppDarkMode::setTitleBarThemeColor(hwnd, useDark);
|
SetWindowTheme(hwnd, useDark ? L"Explorer" : nullptr, nullptr);
|
||||||
|
|
||||||
if (useDark)
|
NppDarkMode::setTitleBarThemeColor(hwnd, useDark);
|
||||||
{
|
|
||||||
SetWindowTheme(hwnd, L"Explorer", nullptr);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
SetWindowTheme(hwnd, nullptr, nullptr);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void setDarkTooltips(HWND hwnd, ToolTipsType type)
|
void setDarkTooltips(HWND hwnd, ToolTipsType type)
|
||||||
{
|
{
|
||||||
if (NppDarkMode::isEnabled())
|
UINT msg = 0;
|
||||||
|
switch (type)
|
||||||
{
|
{
|
||||||
UINT msg = 0;
|
|
||||||
switch (type)
|
|
||||||
{
|
|
||||||
case NppDarkMode::ToolTipsType::toolbar:
|
case NppDarkMode::ToolTipsType::toolbar:
|
||||||
msg = TB_GETTOOLTIPS;
|
msg = TB_GETTOOLTIPS;
|
||||||
break;
|
break;
|
||||||
|
@ -1072,22 +1063,24 @@ namespace NppDarkMode
|
||||||
case NppDarkMode::ToolTipsType::treeview:
|
case NppDarkMode::ToolTipsType::treeview:
|
||||||
msg = TVM_GETTOOLTIPS;
|
msg = TVM_GETTOOLTIPS;
|
||||||
break;
|
break;
|
||||||
|
case NppDarkMode::ToolTipsType::tabbar:
|
||||||
|
msg = TCM_GETTOOLTIPS;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
msg = 0;
|
msg = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!msg)
|
if (msg == 0)
|
||||||
|
{
|
||||||
|
SetWindowTheme(hwnd, NppDarkMode::isEnabled() ? L"DarkMode_Explorer" : nullptr, nullptr);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
auto hTips = reinterpret_cast<HWND>(::SendMessage(hwnd, msg, 0, 0));
|
||||||
|
if (hTips != nullptr)
|
||||||
{
|
{
|
||||||
SetWindowTheme(hwnd, L"DarkMode_Explorer", NULL);
|
SetWindowTheme(hTips, NppDarkMode::isEnabled() ? L"DarkMode_Explorer" : nullptr, nullptr);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
auto hTips = reinterpret_cast<HWND>(SendMessage(hwnd, msg, 0, 0));
|
|
||||||
if (hTips != nullptr)
|
|
||||||
{
|
|
||||||
SetWindowTheme(hTips, L"DarkMode_Explorer", NULL);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,8 @@ namespace NppDarkMode
|
||||||
tooltip,
|
tooltip,
|
||||||
toolbar,
|
toolbar,
|
||||||
listview,
|
listview,
|
||||||
treeview
|
treeview,
|
||||||
|
tabbar
|
||||||
};
|
};
|
||||||
|
|
||||||
void initDarkMode(); // pulls options from NppParameters
|
void initDarkMode(); // pulls options from NppParameters
|
||||||
|
|
|
@ -878,6 +878,9 @@ INT_PTR CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM
|
||||||
|
|
||||||
case NPPM_INTERNAL_REFRESHDARKMODE:
|
case NPPM_INTERNAL_REFRESHDARKMODE:
|
||||||
{
|
{
|
||||||
|
NppDarkMode::setDarkTooltips(_shiftTrickUpTip, NppDarkMode::ToolTipsType::tooltip);
|
||||||
|
NppDarkMode::setDarkTooltips(_2ButtonsTip, NppDarkMode::ToolTipsType::tooltip);
|
||||||
|
NppDarkMode::setDarkTooltips(_filterTip, NppDarkMode::ToolTipsType::tooltip);
|
||||||
NppDarkMode::autoThemeChildControls(_hSelf);
|
NppDarkMode::autoThemeChildControls(_hSelf);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
#include "RunDlg.h"
|
#include "RunDlg.h"
|
||||||
#include "ReadDirectoryChanges.h"
|
#include "ReadDirectoryChanges.h"
|
||||||
#include "menuCmdID.h"
|
#include "menuCmdID.h"
|
||||||
#include "Parameters.h"
|
|
||||||
|
|
||||||
#define CX_BITMAP 16
|
#define CX_BITMAP 16
|
||||||
#define CY_BITMAP 16
|
#define CY_BITMAP 16
|
||||||
|
@ -172,8 +171,11 @@ INT_PTR CALLBACK FileBrowser::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP
|
||||||
|
|
||||||
case NPPM_INTERNAL_REFRESHDARKMODE:
|
case NPPM_INTERNAL_REFRESHDARKMODE:
|
||||||
{
|
{
|
||||||
|
NppDarkMode::setDarkTooltips(_hToolbarMenu, NppDarkMode::ToolTipsType::toolbar);
|
||||||
NppDarkMode::setDarkLineAbovePanelToolbar(_hToolbarMenu);
|
NppDarkMode::setDarkLineAbovePanelToolbar(_hToolbarMenu);
|
||||||
|
|
||||||
NppDarkMode::setExplorerTheme(_treeView.getHSelf(), true);
|
NppDarkMode::setExplorerTheme(_treeView.getHSelf(), true);
|
||||||
|
NppDarkMode::setDarkTooltips(_treeView.getHSelf(), NppDarkMode::ToolTipsType::treeview);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -893,8 +893,11 @@ INT_PTR CALLBACK FunctionListPanel::run_dlgProc(UINT message, WPARAM wParam, LPA
|
||||||
|
|
||||||
case NPPM_INTERNAL_REFRESHDARKMODE:
|
case NPPM_INTERNAL_REFRESHDARKMODE:
|
||||||
{
|
{
|
||||||
|
NppDarkMode::setDarkTooltips(_hToolbarMenu, NppDarkMode::ToolTipsType::toolbar);
|
||||||
NppDarkMode::setDarkLineAbovePanelToolbar(_hToolbarMenu);
|
NppDarkMode::setDarkLineAbovePanelToolbar(_hToolbarMenu);
|
||||||
|
|
||||||
NppDarkMode::setExplorerTheme(_treeView.getHSelf(), true);
|
NppDarkMode::setExplorerTheme(_treeView.getHSelf(), true);
|
||||||
|
NppDarkMode::setDarkTooltips(_treeView.getHSelf(), NppDarkMode::ToolTipsType::treeview);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -927,7 +930,7 @@ INT_PTR CALLBACK FunctionListPanel::run_dlgProc(UINT message, WPARAM wParam, LPA
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (LOWORD(wParam))
|
switch (LOWORD(wParam))
|
||||||
{
|
{
|
||||||
case IDC_SORTBUTTON_FUNCLIST:
|
case IDC_SORTBUTTON_FUNCLIST:
|
||||||
{
|
{
|
||||||
sortOrUnsort();
|
sortOrUnsort();
|
||||||
|
|
|
@ -100,7 +100,9 @@ INT_PTR CALLBACK ProjectPanel::run_dlgProc(UINT message, WPARAM wParam, LPARAM l
|
||||||
case NPPM_INTERNAL_REFRESHDARKMODE:
|
case NPPM_INTERNAL_REFRESHDARKMODE:
|
||||||
{
|
{
|
||||||
NppDarkMode::setDarkLineAbovePanelToolbar(_hToolbarMenu);
|
NppDarkMode::setDarkLineAbovePanelToolbar(_hToolbarMenu);
|
||||||
|
|
||||||
NppDarkMode::setExplorerTheme(_treeView.getHSelf(), true);
|
NppDarkMode::setExplorerTheme(_treeView.getHSelf(), true);
|
||||||
|
NppDarkMode::setDarkTooltips(_treeView.getHSelf(), NppDarkMode::ToolTipsType::treeview);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include "TabBar.h"
|
#include "TabBar.h"
|
||||||
#include "Parameters.h"
|
#include "Parameters.h"
|
||||||
#include "NppDarkMode.h"
|
|
||||||
|
|
||||||
#define IDC_DRAG_TAB 1404
|
#define IDC_DRAG_TAB 1404
|
||||||
#define IDC_DRAG_INTERDIT_TAB 1405
|
#define IDC_DRAG_INTERDIT_TAB 1405
|
||||||
|
@ -467,6 +466,12 @@ LRESULT TabBarPlus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPara
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case NPPM_INTERNAL_REFRESHDARKMODE:
|
||||||
|
{
|
||||||
|
NppDarkMode::setDarkTooltips(hwnd, NppDarkMode::ToolTipsType::tabbar);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
case WM_MOUSEWHEEL:
|
case WM_MOUSEWHEEL:
|
||||||
{
|
{
|
||||||
// ..............................................................................
|
// ..............................................................................
|
||||||
|
|
|
@ -74,6 +74,7 @@ INT_PTR CALLBACK VerticalFileSwitcher::run_dlgProc(UINT message, WPARAM wParam,
|
||||||
case NPPM_INTERNAL_REFRESHDARKMODE:
|
case NPPM_INTERNAL_REFRESHDARKMODE:
|
||||||
{
|
{
|
||||||
NppDarkMode::setExplorerTheme(_fileListView.getHSelf(), true);
|
NppDarkMode::setExplorerTheme(_fileListView.getHSelf(), true);
|
||||||
|
NppDarkMode::setDarkTooltips(_fileListView.getHSelf(), NppDarkMode::ToolTipsType::listview);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue