mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-29 16:54:43 +02:00
Improve dynamic switching for scrollbars.
For main and sub edits, finder (search result docking window) and clipboard history panel. Fix #10083, close #10084
This commit is contained in:
parent
60105d68f7
commit
75643560a3
@ -7554,6 +7554,14 @@ void Notepad_plus::refreshDarkMode()
|
||||
::SendMessage(_pFileSwitcherPanel->getHSelf(), NPPM_INTERNAL_REFRESHDARKMODE, 0, 0);
|
||||
}
|
||||
|
||||
if (_pClipboardHistoryPanel)
|
||||
{
|
||||
::SendMessage(_pClipboardHistoryPanel->getHSelf(), NPPM_INTERNAL_REFRESHDARKMODE, 0, 0);
|
||||
}
|
||||
|
||||
::SendMessage(_subEditView.getHSelf(), NPPM_INTERNAL_REFRESHDARKMODE, 0, 0);
|
||||
::SendMessage(_mainEditView.getHSelf(), NPPM_INTERNAL_REFRESHDARKMODE, 0, 0);
|
||||
|
||||
::SendMessage(_mainDocTab.getHSelf(), NPPM_INTERNAL_REFRESHDARKMODE, 0, 0);
|
||||
::SendMessage(_subDocTab.getHSelf(), NPPM_INTERNAL_REFRESHDARKMODE, 0, 0);
|
||||
|
||||
|
@ -1052,6 +1052,16 @@ namespace NppDarkMode
|
||||
NppDarkMode::setTitleBarThemeColor(hwnd, useDark);
|
||||
}
|
||||
|
||||
void setDarkExplorerTheme(HWND hwnd)
|
||||
{
|
||||
SetWindowTheme(hwnd, NppDarkMode::isEnabled() ? L"DarkMode_Explorer" : nullptr, nullptr);
|
||||
}
|
||||
|
||||
void setDarkScrollBar(HWND hwnd)
|
||||
{
|
||||
NppDarkMode::setDarkExplorerTheme(hwnd);
|
||||
}
|
||||
|
||||
void setDarkTooltips(HWND hwnd, ToolTipsType type)
|
||||
{
|
||||
UINT msg = 0;
|
||||
@ -1076,14 +1086,14 @@ namespace NppDarkMode
|
||||
|
||||
if (msg == 0)
|
||||
{
|
||||
SetWindowTheme(hwnd, NppDarkMode::isEnabled() ? L"DarkMode_Explorer" : nullptr, nullptr);
|
||||
NppDarkMode::setDarkExplorerTheme(hwnd);
|
||||
}
|
||||
else
|
||||
{
|
||||
auto hTips = reinterpret_cast<HWND>(::SendMessage(hwnd, msg, 0, 0));
|
||||
if (hTips != nullptr)
|
||||
{
|
||||
SetWindowTheme(hTips, NppDarkMode::isEnabled() ? L"DarkMode_Explorer" : nullptr, nullptr);
|
||||
NppDarkMode::setDarkExplorerTheme(hTips);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -85,6 +85,8 @@ namespace NppDarkMode
|
||||
void autoThemeChildControls(HWND hwndParent);
|
||||
|
||||
void setDarkTitleBar(HWND hwnd);
|
||||
void setDarkExplorerTheme(HWND hwnd);
|
||||
void setDarkScrollBar(HWND hwnd);
|
||||
void setDarkTooltips(HWND hwnd, ToolTipsType type);
|
||||
void setDarkLineAbovePanelToolbar(HWND hwnd);
|
||||
|
||||
|
@ -881,6 +881,13 @@ INT_PTR CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM
|
||||
NppDarkMode::setDarkTooltips(_shiftTrickUpTip, NppDarkMode::ToolTipsType::tooltip);
|
||||
NppDarkMode::setDarkTooltips(_2ButtonsTip, NppDarkMode::ToolTipsType::tooltip);
|
||||
NppDarkMode::setDarkTooltips(_filterTip, NppDarkMode::ToolTipsType::tooltip);
|
||||
|
||||
HWND finder = getHFindResults();
|
||||
if (finder)
|
||||
{
|
||||
NppDarkMode::setDarkScrollBar(finder);
|
||||
}
|
||||
|
||||
NppDarkMode::autoThemeChildControls(_hSelf);
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -203,6 +203,8 @@ void ScintillaEditView::init(HINSTANCE hInst, HWND hPere)
|
||||
throw std::runtime_error("ScintillaEditView::init : CreateWindowEx() function return null");
|
||||
}
|
||||
|
||||
NppDarkMode::setDarkScrollBar(_hSelf);
|
||||
|
||||
_pScintillaFunc = (SCINTILLA_FUNC)::SendMessage(_hSelf, SCI_GETDIRECTFUNCTION, 0, 0);
|
||||
_pScintillaPtr = (SCINTILLA_PTR)::SendMessage(_hSelf, SCI_GETDIRECTPOINTER, 0, 0);
|
||||
|
||||
@ -344,6 +346,12 @@ LRESULT ScintillaEditView::scintillaNew_Proc(HWND hwnd, UINT Message, WPARAM wPa
|
||||
{
|
||||
switch (Message)
|
||||
{
|
||||
case NPPM_INTERNAL_REFRESHDARKMODE:
|
||||
{
|
||||
NppDarkMode::setDarkScrollBar(_hSelf);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
case WM_MOUSEHWHEEL :
|
||||
{
|
||||
::CallWindowProc(_scintillaDefaultProc, hwnd, WM_HSCROLL, ((short)HIWORD(wParam) > 0)?SB_LINERIGHT:SB_LINELEFT, 0);
|
||||
|
@ -193,6 +193,13 @@ INT_PTR CALLBACK ClipboardHistoryPanel::run_dlgProc(UINT message, WPARAM wParam,
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
_hwndNextCbViewer = ::SetClipboardViewer(_hSelf);
|
||||
NppDarkMode::setDarkScrollBar(::GetDlgItem(_hSelf, IDC_LIST_CLIPBOARD));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
case NPPM_INTERNAL_REFRESHDARKMODE:
|
||||
{
|
||||
NppDarkMode::setDarkScrollBar(GetDlgItem(_hSelf, IDC_LIST_CLIPBOARD));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user