Make DarkMode title bar to apply on all dialog on dark mode
Also remove border from clipboard history panel. Close #10023
This commit is contained in:
parent
bef4da61be
commit
ffbf3af029
|
@ -7512,11 +7512,18 @@ void Notepad_plus::refreshDarkMode()
|
|||
if (NppDarkMode::isExperimentalEnabled())
|
||||
{
|
||||
NppDarkMode::allowDarkModeForApp(NppDarkMode::isEnabled());
|
||||
NppDarkMode::allowDarkModeForWindow(_pPublicInterface->getHSelf(), NppDarkMode::isEnabled());
|
||||
NppDarkMode::allowDarkModeForWindow(_findReplaceDlg.getHSelf(), NppDarkMode::isEnabled());
|
||||
NppDarkMode::setTitleBarThemeColor(_pPublicInterface->getHSelf(), NppDarkMode::isEnabled());
|
||||
NppDarkMode::setTitleBarThemeColor(_findReplaceDlg.getHSelf(), NppDarkMode::isEnabled());
|
||||
}
|
||||
NppDarkMode::setDarkTitleBar(_pPublicInterface->getHSelf());
|
||||
|
||||
for (auto &hwndDlg : _hModelessDlgs)
|
||||
{
|
||||
NppDarkMode::setDarkTitleBar(hwndDlg);
|
||||
}
|
||||
for (auto &docCont : _dockingManager.getContainerInfo())
|
||||
{
|
||||
NppDarkMode::setDarkTitleBar(docCont->getCaptionWnd());
|
||||
}
|
||||
|
||||
SendMessage(_findReplaceDlg.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);
|
||||
|
|
|
@ -94,11 +94,7 @@ LRESULT Notepad_plus_Window::runProc(HWND hwnd, UINT message, WPARAM wParam, LPA
|
|||
{
|
||||
try
|
||||
{
|
||||
if (NppDarkMode::isExperimentalEnabled())
|
||||
{
|
||||
NppDarkMode::allowDarkModeForWindow(hwnd, NppDarkMode::isEnabled());
|
||||
NppDarkMode::setTitleBarThemeColor(hwnd, NppDarkMode::isEnabled());
|
||||
}
|
||||
NppDarkMode::setDarkTitleBar(hwnd);
|
||||
|
||||
_notepad_plus_plus_core._pPublicInterface = this;
|
||||
LRESULT lRet = _notepad_plus_plus_core.init(hwnd);
|
||||
|
|
|
@ -1039,6 +1039,23 @@ namespace NppDarkMode
|
|||
autoSubclassAndThemeChildControls(hwndParent, false, true);
|
||||
}
|
||||
|
||||
void setDarkTitleBar(HWND hwnd)
|
||||
{
|
||||
bool useDark = NppDarkMode::isExperimentalEnabled() && NppDarkMode::isEnabled();
|
||||
|
||||
NppDarkMode::allowDarkModeForWindow(hwnd, useDark);
|
||||
NppDarkMode::setTitleBarThemeColor(hwnd, useDark);
|
||||
|
||||
if (useDark)
|
||||
{
|
||||
SetWindowTheme(hwnd, L"Explorer", nullptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetWindowTheme(hwnd, nullptr, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
void setDarkTooltips(HWND hwnd, ToolTipsType type)
|
||||
{
|
||||
if (NppDarkMode::isEnabled())
|
||||
|
|
|
@ -82,5 +82,6 @@ namespace NppDarkMode
|
|||
void autoSubclassAndThemeChildControls(HWND hwndParent, bool subclass = true, bool theme = true);
|
||||
void autoThemeChildControls(HWND hwndParent);
|
||||
|
||||
void setDarkTitleBar(HWND hwnd);
|
||||
void setDarkTooltips(HWND hwnd, ToolTipsType type);
|
||||
}
|
||||
|
|
|
@ -884,12 +884,6 @@ INT_PTR CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM
|
|||
|
||||
case WM_INITDIALOG :
|
||||
{
|
||||
if (NppDarkMode::isExperimentalEnabled())
|
||||
{
|
||||
NppDarkMode::allowDarkModeForWindow(_hSelf, NppDarkMode::isEnabled());
|
||||
NppDarkMode::setTitleBarThemeColor(_hSelf, NppDarkMode::isEnabled());
|
||||
}
|
||||
|
||||
NppDarkMode::autoSubclassAndThemeChildControls(_hSelf);
|
||||
|
||||
HWND hFindCombo = ::GetDlgItem(_hSelf, IDFINDWHAT);
|
||||
|
|
|
@ -24,5 +24,5 @@ EXSTYLE WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE
|
|||
CAPTION "Clipboard History"
|
||||
FONT 8, "MS Sans Serif", 0, 0, 0x0
|
||||
BEGIN
|
||||
LISTBOX IDC_LIST_CLIPBOARD,50,44,78,120,LBS_OWNERDRAWFIXED | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
|
||||
LISTBOX IDC_LIST_CLIPBOARD,50,44,78,120,LBS_OWNERDRAWFIXED | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP | NOT WS_BORDER
|
||||
END
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include <windows.h>
|
||||
#include "StaticDialog.h"
|
||||
#include "Common.h"
|
||||
#include "NppDarkMode.h"
|
||||
|
||||
StaticDialog::~StaticDialog()
|
||||
{
|
||||
|
@ -222,6 +223,8 @@ void StaticDialog::create(int dialogID, bool isRTL, bool msgDestParent)
|
|||
return;
|
||||
}
|
||||
|
||||
NppDarkMode::setDarkTitleBar(_hSelf);
|
||||
|
||||
// if the destination of message NPPM_MODELESSDIALOG is not its parent, then it's the grand-parent
|
||||
::SendMessage(msgDestParent ? _hParent : (::GetParent(_hParent)), NPPM_MODELESSDIALOG, MODELESSDIALOGADD, reinterpret_cast<WPARAM>(_hSelf));
|
||||
}
|
||||
|
@ -232,6 +235,8 @@ INT_PTR CALLBACK StaticDialog::dlgProc(HWND hwnd, UINT message, WPARAM wParam, L
|
|||
{
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
NppDarkMode::setDarkTitleBar(hwnd);
|
||||
|
||||
StaticDialog *pStaticDlg = reinterpret_cast<StaticDialog *>(lParam);
|
||||
pStaticDlg->_hSelf = hwnd;
|
||||
::SetWindowLongPtr(hwnd, GWLP_USERDATA, static_cast<LONG_PTR>(lParam));
|
||||
|
|
Loading…
Reference in New Issue