parent
2f51902e9c
commit
467870d66e
|
@ -997,6 +997,8 @@ HWND CreateToolTip(int toolID, HWND hDlg, HINSTANCE hInst, const PTSTR pszText)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NppDarkMode::setDarkTooltips(hwndTip, NppDarkMode::ToolTipsType::tooltip);
|
||||||
|
|
||||||
// Associate the tooltip with the tool.
|
// Associate the tooltip with the tool.
|
||||||
TOOLINFO toolInfo = { 0 };
|
TOOLINFO toolInfo = { 0 };
|
||||||
toolInfo.cbSize = sizeof(toolInfo);
|
toolInfo.cbSize = sizeof(toolInfo);
|
||||||
|
|
|
@ -1038,5 +1038,40 @@ namespace NppDarkMode
|
||||||
{
|
{
|
||||||
autoSubclassAndThemeChildControls(hwndParent, false, true);
|
autoSubclassAndThemeChildControls(hwndParent, false, true);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
void setDarkTooltips(HWND hwnd, ToolTipsType type)
|
||||||
|
{
|
||||||
|
if (NppDarkMode::isEnabled())
|
||||||
|
{
|
||||||
|
int msg = NULL;
|
||||||
|
switch (type)
|
||||||
|
{
|
||||||
|
case NppDarkMode::ToolTipsType::toolbar:
|
||||||
|
msg = TB_GETTOOLTIPS;
|
||||||
|
break;
|
||||||
|
case NppDarkMode::ToolTipsType::listview:
|
||||||
|
msg = LVM_GETTOOLTIPS;
|
||||||
|
break;
|
||||||
|
case NppDarkMode::ToolTipsType::treeview:
|
||||||
|
msg = TVM_GETTOOLTIPS;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
msg = NULL;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!msg)
|
||||||
|
{
|
||||||
|
SetWindowTheme(hwnd, L"DarkMode_Explorer", NULL);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
auto hTips = reinterpret_cast<HWND>(SendMessage(hwnd, msg, NULL, NULL));
|
||||||
|
if (hTips != nullptr)
|
||||||
|
{
|
||||||
|
SetWindowTheme(hTips, L"DarkMode_Explorer", NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -21,6 +21,14 @@ namespace NppDarkMode
|
||||||
bool enableScrollbarHack = false;
|
bool enableScrollbarHack = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum class ToolTipsType
|
||||||
|
{
|
||||||
|
tooltip,
|
||||||
|
toolbar,
|
||||||
|
listview,
|
||||||
|
treeview
|
||||||
|
};
|
||||||
|
|
||||||
void initDarkMode(); // pulls options from NppParameters
|
void initDarkMode(); // pulls options from NppParameters
|
||||||
void refreshDarkMode(HWND hwnd, bool forceRefresh = false); // attempts to apply new options from NppParameters, sends NPPM_INTERNAL_REFRESHDARKMODE to hwnd's top level parent
|
void refreshDarkMode(HWND hwnd, bool forceRefresh = false); // attempts to apply new options from NppParameters, sends NPPM_INTERNAL_REFRESHDARKMODE to hwnd's top level parent
|
||||||
|
|
||||||
|
@ -73,5 +81,6 @@ namespace NppDarkMode
|
||||||
|
|
||||||
void autoSubclassAndThemeChildControls(HWND hwndParent, bool subclass = true, bool theme = true);
|
void autoSubclassAndThemeChildControls(HWND hwndParent, bool subclass = true, bool theme = true);
|
||||||
void autoThemeChildControls(HWND hwndParent);
|
void autoThemeChildControls(HWND hwndParent);
|
||||||
}
|
|
||||||
|
|
||||||
|
void setDarkTooltips(HWND hwnd, ToolTipsType type);
|
||||||
|
}
|
||||||
|
|
|
@ -105,6 +105,9 @@ INT_PTR CALLBACK FileBrowser::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP
|
||||||
NppParameters& nppParam = NppParameters::getInstance();
|
NppParameters& nppParam = NppParameters::getInstance();
|
||||||
int style = WS_CHILD | WS_VISIBLE | CCS_ADJUSTABLE | TBSTYLE_AUTOSIZE | TBSTYLE_FLAT | TBSTYLE_LIST | TBSTYLE_TRANSPARENT | BTNS_AUTOSIZE | BTNS_SEP | TBSTYLE_TOOLTIPS | TBSTYLE_CUSTOMERASE;
|
int style = WS_CHILD | WS_VISIBLE | CCS_ADJUSTABLE | TBSTYLE_AUTOSIZE | TBSTYLE_FLAT | TBSTYLE_LIST | TBSTYLE_TRANSPARENT | BTNS_AUTOSIZE | BTNS_SEP | TBSTYLE_TOOLTIPS | TBSTYLE_CUSTOMERASE;
|
||||||
_hToolbarMenu = CreateWindowEx(WS_EX_LAYOUTRTL, TOOLBARCLASSNAME, NULL, style, 0, 0, 0, 0, _hSelf, nullptr, _hInst, NULL);
|
_hToolbarMenu = CreateWindowEx(WS_EX_LAYOUTRTL, TOOLBARCLASSNAME, NULL, style, 0, 0, 0, 0, _hSelf, nullptr, _hInst, NULL);
|
||||||
|
|
||||||
|
NppDarkMode::setDarkTooltips(_hToolbarMenu, NppDarkMode::ToolTipsType::toolbar);
|
||||||
|
|
||||||
TBBUTTON tbButtons[3];
|
TBBUTTON tbButtons[3];
|
||||||
// Add the bmap image into toolbar's imagelist
|
// Add the bmap image into toolbar's imagelist
|
||||||
TBADDBITMAP addbmp = { _hInst, 0 };
|
TBADDBITMAP addbmp = { _hInst, 0 };
|
||||||
|
|
|
@ -771,6 +771,8 @@ INT_PTR CALLBACK FunctionListPanel::run_dlgProc(UINT message, WPARAM wParam, LPA
|
||||||
_hToolbarMenu = CreateWindowEx(0,TOOLBARCLASSNAME,NULL, style,
|
_hToolbarMenu = CreateWindowEx(0,TOOLBARCLASSNAME,NULL, style,
|
||||||
0,0,0,0,_hSelf,nullptr, _hInst, NULL);
|
0,0,0,0,_hSelf,nullptr, _hInst, NULL);
|
||||||
|
|
||||||
|
NppDarkMode::setDarkTooltips(_hToolbarMenu, NppDarkMode::ToolTipsType::toolbar);
|
||||||
|
|
||||||
oldFunclstToolbarProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtr(_hToolbarMenu, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(funclstToolbarProc)));
|
oldFunclstToolbarProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtr(_hToolbarMenu, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(funclstToolbarProc)));
|
||||||
TBBUTTON tbButtons[3];
|
TBBUTTON tbButtons[3];
|
||||||
|
|
||||||
|
|
|
@ -303,6 +303,9 @@ void TabBarPlus::init(HINSTANCE hInst, HWND parent, bool isVertical, bool isMult
|
||||||
{
|
{
|
||||||
throw std::runtime_error("TabBarPlus::init : tooltip CreateWindowEx() function return null");
|
throw std::runtime_error("TabBarPlus::init : tooltip CreateWindowEx() function return null");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NppDarkMode::setDarkTooltips(_tooltips, NppDarkMode::ToolTipsType::tooltip);
|
||||||
|
|
||||||
::SendMessage(_hSelf, TCM_SETTOOLTIPS, reinterpret_cast<WPARAM>(_tooltips), 0);
|
::SendMessage(_hSelf, TCM_SETTOOLTIPS, reinterpret_cast<WPARAM>(_tooltips), 0);
|
||||||
|
|
||||||
if (!_hwndArray[_nbCtrl])
|
if (!_hwndArray[_nbCtrl])
|
||||||
|
|
|
@ -284,6 +284,9 @@ void ToolBar::reset(bool create)
|
||||||
NULL,
|
NULL,
|
||||||
_hInst,
|
_hInst,
|
||||||
0);
|
0);
|
||||||
|
|
||||||
|
NppDarkMode::setDarkTooltips(_hSelf, NppDarkMode::ToolTipsType::toolbar);
|
||||||
|
|
||||||
// Send the TB_BUTTONSTRUCTSIZE message, which is required for
|
// Send the TB_BUTTONSTRUCTSIZE message, which is required for
|
||||||
// backward compatibility.
|
// backward compatibility.
|
||||||
::SendMessage(_hSelf, TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0);
|
::SendMessage(_hSelf, TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0);
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include "ToolTip.h"
|
#include "ToolTip.h"
|
||||||
|
#include "NppDarkMode.h"
|
||||||
|
|
||||||
void ToolTip::init(HINSTANCE hInst, HWND hParent)
|
void ToolTip::init(HINSTANCE hInst, HWND hParent)
|
||||||
{
|
{
|
||||||
|
@ -32,6 +33,8 @@ void ToolTip::init(HINSTANCE hInst, HWND hParent)
|
||||||
throw std::runtime_error("ToolTip::init : CreateWindowEx() function return null");
|
throw std::runtime_error("ToolTip::init : CreateWindowEx() function return null");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NppDarkMode::setDarkTooltips(_hSelf, NppDarkMode::ToolTipsType::tooltip);
|
||||||
|
|
||||||
::SetWindowLongPtr(_hSelf, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(this));
|
::SetWindowLongPtr(_hSelf, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(this));
|
||||||
_defaultProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtr(_hSelf, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(staticWinProc)));
|
_defaultProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtr(_hSelf, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(staticWinProc)));
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,6 +37,8 @@ void TreeView::init(HINSTANCE hInst, HWND parent, int treeViewID)
|
||||||
_hInst,
|
_hInst,
|
||||||
(LPVOID)0);
|
(LPVOID)0);
|
||||||
|
|
||||||
|
NppDarkMode::setDarkTooltips(_hSelf, NppDarkMode::ToolTipsType::treeview);
|
||||||
|
|
||||||
int itemHeight = NppParameters::getInstance()._dpiManager.scaleY(CY_ITEMHEIGHT);
|
int itemHeight = NppParameters::getInstance()._dpiManager.scaleY(CY_ITEMHEIGHT);
|
||||||
TreeView_SetItemHeight(_hSelf, itemHeight);
|
TreeView_SetItemHeight(_hSelf, itemHeight);
|
||||||
|
|
||||||
|
|
|
@ -55,6 +55,8 @@ void VerticalFileSwitcherListView::init(HINSTANCE hInst, HWND parent, HIMAGELIST
|
||||||
throw std::runtime_error("VerticalFileSwitcherListView::init : CreateWindowEx() function return null");
|
throw std::runtime_error("VerticalFileSwitcherListView::init : CreateWindowEx() function return null");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NppDarkMode::setDarkTooltips(_hSelf, NppDarkMode::ToolTipsType::listview);
|
||||||
|
|
||||||
::SetWindowLongPtr(_hSelf, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(this));
|
::SetWindowLongPtr(_hSelf, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(this));
|
||||||
_defaultProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtr(_hSelf, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(staticProc)));
|
_defaultProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtr(_hSelf, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(staticProc)));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue