Skip to content

Commit db57f59

Browse files
committed
Update darkmodelib and scripts
1 parent 09582ad commit db57f59

13 files changed

Lines changed: 65 additions & 63 deletions

File tree

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[submodule "DarkMode/lib"]
22
path = DarkMode/lib
3-
url = https://github.com/ozone10/darkmodelib.git
3+
url = https://github.com/ozone10/win32-darkmodelib.git

CPP/7zip/UI/FileManager/App.cpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
#include "PropertyNameRes.h"
3131

32-
#include "../../../../DarkMode/lib/include/DarkModeSubclass.h"
32+
#include "../../../../DarkMode/lib/include/Darkmodelib.h"
3333

3434
using namespace NWindows;
3535
using namespace NFile;
@@ -111,19 +111,19 @@ void CApp::SetListSettings()
111111
panel.SetExtendedStyle();
112112
}
113113

114-
if (!DarkMode::doesConfigFileExist())
114+
if (!dmlib::doesConfigFileExist())
115115
{
116116
switch (Read_ClrMode())
117117
{
118118
case 0:
119119
{
120-
DarkMode::setDarkModeConfigEx(static_cast<UINT>(DarkMode::DarkModeType::classic));
120+
dmlib::setDarkModeConfigEx(static_cast<UINT>(dmlib::DarkModeType::classic));
121121
break;
122122
}
123123

124124
case 2:
125125
{
126-
DarkMode::setDarkModeConfig();
126+
dmlib::setDarkModeConfig();
127127
break;
128128
}
129129

@@ -133,7 +133,7 @@ void CApp::SetListSettings()
133133
return;
134134
}
135135
}
136-
DarkMode::setDefaultColors(false);
136+
dmlib::setDefaultColors(false);
137137
}
138138
}
139139

@@ -168,16 +168,16 @@ HRESULT CApp::CreateOnePanel(unsigned panelIndex, const UString &mainPath, const
168168

169169
if (Panels[panelIndex].PanelCreated)
170170
{
171-
DarkMode::setChildCtrlsSubclassAndTheme(Panels[panelIndex]);
172-
DarkMode::setWindowEraseBgSubclass(Panels[panelIndex]);
173-
DarkMode::setWindowCtlColorSubclass(Panels[panelIndex]);
174-
DarkMode::setWindowNotifyCustomDrawSubclass(Panels[panelIndex]);
175-
DarkMode::setWindowEraseBgSubclass(Panels[panelIndex]._headerReBar);
176-
DarkMode::setWindowCtlColorSubclass(Panels[panelIndex]._headerReBar);
171+
dmlib::setChildCtrlsSubclassAndTheme(Panels[panelIndex]);
172+
dmlib::setWindowEraseBgSubclass(Panels[panelIndex]);
173+
dmlib::setWindowCtlColorSubclass(Panels[panelIndex]);
174+
dmlib::setWindowNotifyCustomDrawSubclass(Panels[panelIndex]);
175+
dmlib::setWindowEraseBgSubclass(Panels[panelIndex]._headerReBar);
176+
dmlib::setWindowCtlColorSubclass(Panels[panelIndex]._headerReBar);
177177

178178
Panels[panelIndex].setSubclassListNotify();
179179

180-
DarkMode::redrawWindowFrame(Panels[panelIndex]._headerComboBox);
180+
dmlib::redrawWindowFrame(Panels[panelIndex]._headerComboBox);
181181
}
182182

183183
return resVal;
@@ -312,8 +312,8 @@ void CApp::ReloadToolbars()
312312
for (i = 0; i < Z7_ARRAY_SIZE(g_StandardButtons); i++)
313313
AddButton(_buttonsImageList, _toolBar, g_StandardButtons[i], ShowButtonsLables, LargeButtons);
314314

315-
DarkMode::setDarkLineAbovePanelToolbar(_toolBar);
316-
DarkMode::setDarkTooltips(_toolBar, static_cast<int>(DarkMode::ToolTipsType::toolbar));
315+
dmlib::setDarkLineAbovePanelToolbar(_toolBar);
316+
dmlib::setDarkTooltips(_toolBar, static_cast<int>(dmlib::ToolTipsType::toolbar));
317317

318318
_toolBar.AutoSize();
319319
}
@@ -331,7 +331,7 @@ HRESULT CApp::Create(HWND hwnd, const UString &mainPath, const UString &arcForma
331331
{
332332
_window.Attach(hwnd);
333333

334-
DarkMode::initDarkModeEx(L"7zDark");
334+
dmlib::initDarkModeEx(L"7zDark");
335335

336336
#ifdef UNDER_CE
337337
_commandBar.Create(g_hInstance, hwnd, 1);
@@ -399,9 +399,9 @@ HRESULT CApp::Create(HWND hwnd, const UString &mainPath, const UString &arcForma
399399
}
400400
}
401401

402-
DarkMode::setWindowEraseBgSubclass(hwnd);
403-
DarkMode::setDarkWndNotifySafeEx(hwnd, true, true);
404-
DarkMode::setWindowMenuBarSubclass(hwnd);
402+
dmlib::setWindowEraseBgSubclass(hwnd);
403+
dmlib::setDarkWndNotifySafeEx(hwnd, true, true);
404+
dmlib::setWindowMenuBarSubclass(hwnd);
405405

406406
SetFocusedPanel(LastFocusedPanel);
407407
Panels[LastFocusedPanel].SetFocusToList();

CPP/7zip/UI/FileManager/MenuPage.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include "MenuPage.h"
2323
#include "MenuPageRes.h"
2424

25-
#include "../../../../DarkMode/lib/include/DarkModeSubclass.h"
25+
#include "../../../../DarkMode/lib/include/Darkmodelib.h"
2626

2727

2828
using namespace NWindows;
@@ -284,7 +284,7 @@ bool CMenuPage::OnInit()
284284
_listView.SetColumnWidthAuto(0);
285285
_initMode = false;
286286

287-
DarkMode::setDarkListViewCheckboxes(_listView);
287+
dmlib::setDarkListViewCheckboxes(_listView);
288288

289289
return CPropertyPage::OnInit();
290290
}
@@ -294,7 +294,7 @@ bool CMenuPage::OnInit()
294294

295295
static void ShowMenuErrorMessage(const wchar_t *m, HWND hwnd)
296296
{
297-
DarkMode::darkMessageBoxW(hwnd, m, L"7-Zip", MB_ICONERROR);
297+
dmlib::darkMessageBoxW(hwnd, m, L"7-Zip", MB_ICONERROR);
298298
}
299299

300300
#endif

CPP/7zip/UI/FileManager/Panel.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
#include "PropertyNameRes.h"
3535

36-
#include "../../../../DarkMode/lib/include/DarkModeSubclass.h"
36+
#include "../../../../DarkMode/lib/include/Darkmodelib.h"
3737

3838
using namespace NWindows;
3939
using namespace NControl;
@@ -1199,7 +1199,7 @@ LRESULT CALLBACK CPanel::ListNotifySubclass(
11991199

12001200
case WM_NOTIFY:
12011201
{
1202-
if (!DarkMode::isEnabled()
1202+
if (!dmlib::isEnabled()
12031203
|| (!pPanelData->_mySelectMode
12041204
&& (!pPanelData->_markDeletedItems
12051205
|| !pPanelData->_thereAreDeletedItems)))
@@ -1230,14 +1230,14 @@ LRESULT CALLBACK CPanel::ListNotifySubclass(
12301230
&& realIndex != kParentIndex
12311231
&& pPanelData->_selectedStatusVector[realIndex])
12321232
{
1233-
lplvcd->clrTextBk = DarkMode::getHeaderHotBackgroundColor();
1233+
lplvcd->clrTextBk = dmlib::getHeaderHotBackgroundColor();
12341234
}
12351235

12361236
if (pPanelData->_markDeletedItems
12371237
&& pPanelData->_thereAreDeletedItems
12381238
&& pPanelData->IsItem_Deleted(realIndex))
12391239
{
1240-
lplvcd->clrText = DarkMode::getLinkTextColor();
1240+
lplvcd->clrText = dmlib::getLinkTextColor();
12411241
}
12421242
return resVal;
12431243
}

CPP/7zip/UI/FileManager/ProgressDialog2.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include "ProgressDialog2.h"
2121
#include "ProgressDialog2Res.h"
2222

23-
#include "../../../../DarkMode/lib/include/DarkModeSubclass.h"
23+
#include "../../../../DarkMode/lib/include/Darkmodelib.h"
2424

2525
using namespace NWindows;
2626

@@ -986,7 +986,7 @@ INT_PTR CProgressDialog::Create(const UString &title, NWindows::CThread &thread,
986986
thread.Wait_Close();
987987
if (!MessagesDisplayed)
988988
if (!g_DisableUserQuestions)
989-
DarkMode::darkMessageBoxW(wndParent, L"Progress Error", L"7-Zip", MB_ICONERROR);
989+
dmlib::darkMessageBoxW(wndParent, L"Progress Error", L"7-Zip", MB_ICONERROR);
990990
return res;
991991
}
992992

@@ -1022,7 +1022,7 @@ bool CProgressDialog::OnExternalCloseMessage()
10221022
if (fm.ErrorMessage.Title.IsEmpty())
10231023
fm.ErrorMessage.Title = "7-Zip";
10241024
if (!g_DisableUserQuestions)
1025-
DarkMode::darkMessageBoxW(*this, fm.ErrorMessage.Message, fm.ErrorMessage.Title, MB_ICONERROR);
1025+
dmlib::darkMessageBoxW(*this, fm.ErrorMessage.Message, fm.ErrorMessage.Title, MB_ICONERROR);
10261026
}
10271027
else if (!thereAreMessages)
10281028
{
@@ -1033,7 +1033,7 @@ bool CProgressDialog::OnExternalCloseMessage()
10331033
if (fm.OkMessage.Title.IsEmpty())
10341034
fm.OkMessage.Title = "7-Zip";
10351035
if (!g_DisableUserQuestions)
1036-
DarkMode::darkMessageBoxW(*this, fm.OkMessage.Message, fm.OkMessage.Title, MB_OK);
1036+
dmlib::darkMessageBoxW(*this, fm.OkMessage.Message, fm.OkMessage.Title, MB_OK);
10371037
}
10381038
}
10391039

@@ -1258,7 +1258,7 @@ bool CProgressDialog::OnButtonClicked(unsigned buttonID, HWND buttonHWND)
12581258
}
12591259

12601260
_inCancelMessageBox = true;
1261-
const int res = DarkMode::darkMessageBoxW(*this, LangString(IDS_PROGRESS_ASK_CANCEL), _title, MB_YESNOCANCEL);
1261+
const int res = dmlib::darkMessageBoxW(*this, LangString(IDS_PROGRESS_ASK_CANCEL), _title, MB_YESNOCANCEL);
12621262
_inCancelMessageBox = false;
12631263
if (res == IDYES)
12641264
_cancelWasPressed = true;

CPP/7zip/UI/FileManager/SettingsPage.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include "SettingsPage.h"
2525
#include "SettingsPageRes.h"
2626

27-
#include "../../../../DarkMode/lib/include/DarkModeSubclass.h"
27+
#include "../../../../DarkMode/lib/include/Darkmodelib.h"
2828

2929
using namespace NWindows;
3030

@@ -248,7 +248,7 @@ bool CSettingsPage::OnInit()
248248
}
249249

250250
{
251-
const bool isININotUsed = !DarkMode::doesConfigFileExist() && DarkMode::isAtLeastWindows10();
251+
const bool isININotUsed = !dmlib::doesConfigFileExist() && dmlib::isAtLeastWindows10();
252252
EnableItem(IDC_COLOR_MODE, isININotUsed);
253253

254254
_clrModeCombo.Attach(GetItem(IDC_COLOR_MODE));
@@ -265,7 +265,7 @@ bool CSettingsPage::OnInit()
265265
}
266266
else
267267
{
268-
const wchar_t* mode = DarkMode::isAtLeastWindows10() ? L"INI used" : L"Old OS";
268+
const wchar_t* mode = dmlib::isAtLeastWindows10() ? L"INI used" : L"Old OS";
269269
_clrModeCombo.AddString(mode);
270270
_clrModeCombo.SetCurSel(0);
271271
}
@@ -358,34 +358,34 @@ LONG CSettingsPage::OnApply()
358358
{
359359
case 0:
360360
{
361-
DarkMode::setDarkModeConfigEx(static_cast<UINT>(DarkMode::DarkModeType::classic));
361+
dmlib::setDarkModeConfigEx(static_cast<UINT>(dmlib::DarkModeType::classic));
362362
break;
363363
}
364364

365365
case 2:
366366
{
367-
DarkMode::setDarkModeConfig();
367+
dmlib::setDarkModeConfig();
368368
break;
369369
}
370370

371371
//case 1:
372372
default:
373373
{
374-
DarkMode::setDarkModeConfigEx(static_cast<UINT>(DarkMode::DarkModeType::dark));
374+
dmlib::setDarkModeConfigEx(static_cast<UINT>(dmlib::DarkModeType::dark));
375375
break;
376376
}
377377
}
378378

379-
DarkMode::setDefaultColors(true);
379+
dmlib::setDefaultColors(true);
380380

381381
HWND hOption = GetParent();
382-
DarkMode::setChildCtrlsTheme(hOption);
383-
DarkMode::setDarkTitleBarEx(hOption, true);
382+
dmlib::setChildCtrlsTheme(hOption);
383+
dmlib::setDarkTitleBarEx(hOption, true);
384384
RedrawWindow(hOption, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_ALLCHILDREN | RDW_UPDATENOW | RDW_FRAME);
385385

386386
HWND hMain = ::GetParent(GetParent());
387-
DarkMode::setChildCtrlsTheme(hMain);
388-
DarkMode::setDarkTitleBarEx(hMain, true);
387+
dmlib::setChildCtrlsTheme(hMain);
388+
dmlib::setDarkTitleBarEx(hMain, true);
389389
RedrawWindow(hMain, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_ALLCHILDREN | RDW_UPDATENOW | RDW_FRAME);
390390

391391
_clrMode_wasChanged = false;

CPP/Windows/Control/Dialog.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#if !defined(Z7_SFX)
1414
#include "../../7zip/UI/FileManager/RegistryUtils.h"
1515
#endif
16-
#include "../../../DarkMode/lib/include/DarkModeSubclass.h"
16+
#include "../../../DarkMode/lib/include/Darkmodelib.h"
1717

1818
extern HINSTANCE g_hInstance;
1919
#ifndef _UNICODE
@@ -42,22 +42,22 @@ DialogProcedure(HWND dialogHWND, UINT message, WPARAM wParam, LPARAM lParam)
4242
{
4343
dialog->Attach(dialogHWND);
4444
#if defined(Z7_LANG)
45-
DarkMode::initDarkModeEx(L"7zDark");
45+
dmlib::initDarkModeEx(L"7zDark");
4646
#endif
4747
#if !defined(Z7_SFX)
48-
if (!DarkMode::doesConfigFileExist())
48+
if (!dmlib::doesConfigFileExist())
4949
{
5050
switch (Read_ClrMode())
5151
{
5252
case 0:
5353
{
54-
DarkMode::setDarkModeConfigEx(static_cast<UINT>(DarkMode::DarkModeType::classic));
54+
dmlib::setDarkModeConfigEx(static_cast<UINT>(dmlib::DarkModeType::classic));
5555
break;
5656
}
5757

5858
case 2:
5959
{
60-
DarkMode::setDarkModeConfig();
60+
dmlib::setDarkModeConfig();
6161
break;
6262
}
6363

@@ -67,10 +67,10 @@ DialogProcedure(HWND dialogHWND, UINT message, WPARAM wParam, LPARAM lParam)
6767
break;
6868
}
6969
}
70-
DarkMode::setDefaultColors(false);
70+
dmlib::setDefaultColors(false);
7171
}
7272
#endif
73-
DarkMode::setDarkWndNotifySafeEx(*dialog, true, true);
73+
dmlib::setDarkWndNotifySafeEx(*dialog, true, true);
7474
}
7575

7676
/* MSDN: The dialog box procedure should return

CPP/Windows/Control/PropertyPage.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include "PropertyPage.h"
1010

11-
#include "../../../DarkMode/lib/include/DarkModeSubclass.h"
11+
#include "../../../DarkMode/lib/include/Darkmodelib.h"
1212

1313
extern HINSTANCE g_hInstance;
1414
#ifndef _UNICODE
@@ -35,10 +35,10 @@ APIENTRY MyProperyPageProcedure(HWND dialogHWND, UINT message, WPARAM wParam, LP
3535
if (message == WM_INITDIALOG)
3636
{
3737
dialog->Attach(dialogHWND);
38-
DarkMode::setDarkWndNotifySafeEx(::GetParent(*dialog), true, true);
39-
DarkMode::setWindowCtlColorSubclass(*dialog);
40-
DarkMode::setWindowNotifyCustomDrawSubclass(*dialog);
41-
DarkMode::setChildCtrlsSubclassAndTheme(*dialog);
38+
dmlib::setDarkWndNotifySafeEx(::GetParent(*dialog), true, true);
39+
dmlib::setWindowCtlColorSubclass(*dialog);
40+
dmlib::setWindowNotifyCustomDrawSubclass(*dialog);
41+
dmlib::setChildCtrlsSubclassAndTheme(*dialog);
4242
}
4343
try { return BoolToBOOL(dialog->OnMessage(message, wParam, lParam)); }
4444
catch(...) { return TRUE; }

CPP/Windows/Shell.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include "MemoryGlobal.h"
1111
#include "Shell.h"
1212

13-
#include "../../DarkMode/lib/include/DarkModeSubclass.h"
13+
#include "../../DarkMode/lib/include/Darkmodelib.h"
1414

1515
#ifndef _UNICODE
1616
extern bool g_IsNT;
@@ -685,7 +685,7 @@ static int CALLBACK BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM /* lp */, LP
685685
{
686686
case BFFM_INITIALIZED:
687687
{
688-
DarkMode::setDarkWndSafeEx(hwnd, false);
688+
dmlib::setDarkWndSafeEx(hwnd, false);
689689
SendMessage(hwnd, BFFM_SETSELECTION, TRUE, data);
690690
break;
691691
}

DarkMode/7zRes/7zDarkObj.mak

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
!IFDEF WIN_CTRL_OBJS
22
DARK_MODE_OBJS = \
3-
$O\DarkModeSubclass.obj \
3+
$O\Darkmodelib.obj \
44
$O\DmlibColor.obj \
55
$O\DmlibDpi.obj \
66
$O\DmlibHook.obj \

0 commit comments

Comments
 (0)