Skip to content

Commit 117640f

Browse files
ozone10mcmilk
authored andcommitted
Update darkmodelib to 0.64.0
1 parent 4d79dd7 commit 117640f

13 files changed

Lines changed: 81 additions & 53 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
@@ -30,7 +30,7 @@
3030
#include "PropertyNameRes.h"
3131

3232
#ifdef ZIP7_DARKMODE
33-
#include "../../../../DarkMode/lib/include/DarkModeSubclass.h"
33+
#include "../../../../DarkMode/lib/include/Darkmodelib.h"
3434
#endif
3535

3636
using namespace NWindows;
@@ -113,19 +113,19 @@ void CApp::SetListSettings()
113113
panel.SetExtendedStyle();
114114
}
115115
#ifdef ZIP7_DARKMODE
116-
if (!DarkMode::doesConfigFileExist())
116+
if (!dmlib::doesConfigFileExist())
117117
{
118118
switch (Read_ClrMode())
119119
{
120120
case 0:
121121
{
122-
DarkMode::setDarkModeConfigEx(static_cast<UINT>(DarkMode::DarkModeType::classic));
122+
dmlib::setDarkModeConfigEx(static_cast<UINT>(dmlib::DarkModeType::classic));
123123
break;
124124
}
125125

126126
case 2:
127127
{
128-
DarkMode::setDarkModeConfig();
128+
dmlib::setDarkModeConfig();
129129
break;
130130
}
131131

@@ -135,7 +135,7 @@ void CApp::SetListSettings()
135135
return;
136136
}
137137
}
138-
DarkMode::setDefaultColors(false);
138+
dmlib::setDefaultColors(false);
139139
}
140140
#endif
141141
}
@@ -172,16 +172,16 @@ HRESULT CApp::CreateOnePanel(unsigned panelIndex, const UString &mainPath, const
172172
#ifdef ZIP7_DARKMODE
173173
if (resVal == S_OK && Panels[panelIndex].PanelCreated)
174174
{
175-
DarkMode::setChildCtrlsSubclassAndTheme(Panels[panelIndex]);
176-
DarkMode::setWindowEraseBgSubclass(Panels[panelIndex]);
177-
DarkMode::setWindowCtlColorSubclass(Panels[panelIndex]);
178-
DarkMode::setWindowNotifyCustomDrawSubclass(Panels[panelIndex]);
179-
DarkMode::setWindowEraseBgSubclass(Panels[panelIndex]._headerReBar);
180-
DarkMode::setWindowCtlColorSubclass(Panels[panelIndex]._headerReBar);
175+
dmlib::setChildCtrlsSubclassAndTheme(Panels[panelIndex]);
176+
dmlib::setWindowEraseBgSubclass(Panels[panelIndex]);
177+
dmlib::setWindowCtlColorSubclass(Panels[panelIndex]);
178+
dmlib::setWindowNotifyCustomDrawSubclass(Panels[panelIndex]);
179+
dmlib::setWindowEraseBgSubclass(Panels[panelIndex]._headerReBar);
180+
dmlib::setWindowCtlColorSubclass(Panels[panelIndex]._headerReBar);
181181

182182
Panels[panelIndex].setSubclassListNotify();
183183

184-
DarkMode::redrawWindowFrame(Panels[panelIndex]._headerComboBox);
184+
dmlib::redrawWindowFrame(Panels[panelIndex]._headerComboBox);
185185
}
186186
#endif
187187

@@ -318,8 +318,8 @@ void CApp::ReloadToolbars()
318318
AddButton(_buttonsImageList, _toolBar, g_StandardButtons[i], ShowButtonsLables, LargeButtons);
319319

320320
#ifdef ZIP7_DARKMODE
321-
DarkMode::setDarkLineAbovePanelToolbar(_toolBar);
322-
DarkMode::setDarkTooltips(_toolBar, static_cast<int>(DarkMode::ToolTipsType::toolbar));
321+
dmlib::setDarkLineAbovePanelToolbar(_toolBar);
322+
dmlib::setDarkTooltips(_toolBar, static_cast<int>(dmlib::ToolTipsType::toolbar));
323323
#endif
324324

325325
_toolBar.AutoSize();
@@ -339,7 +339,7 @@ HRESULT CApp::Create(HWND hwnd, const UString &mainPath, const UString &arcForma
339339
_window.Attach(hwnd);
340340

341341
#ifdef ZIP7_DARKMODE
342-
DarkMode::initDarkModeEx(L"7zDark");
342+
dmlib::initDarkModeEx(L"7zDark");
343343
#endif
344344

345345
#ifdef UNDER_CE
@@ -409,9 +409,9 @@ HRESULT CApp::Create(HWND hwnd, const UString &mainPath, const UString &arcForma
409409
}
410410

411411
#ifdef ZIP7_DARKMODE
412-
DarkMode::setWindowEraseBgSubclass(hwnd);
413-
DarkMode::setDarkWndNotifySafeEx(hwnd, true, true);
414-
DarkMode::setWindowMenuBarSubclass(hwnd);
412+
dmlib::setWindowEraseBgSubclass(hwnd);
413+
dmlib::setDarkWndNotifySafeEx(hwnd, true, true);
414+
dmlib::setWindowMenuBarSubclass(hwnd);
415415
#endif
416416

417417
SetFocusedPanel(LastFocusedPanel);

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

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

2525
#ifdef ZIP7_DARKMODE
26-
#include "../../../../DarkMode/lib/include/DarkModeSubclass.h"
26+
#include "../../../../DarkMode/lib/include/Darkmodelib.h"
2727
#endif
2828

2929
using namespace NWindows;
@@ -286,7 +286,7 @@ bool CMenuPage::OnInit()
286286
_initMode = false;
287287

288288
#ifdef ZIP7_DARKMODE
289-
DarkMode::setDarkListViewCheckboxes(_listView);
289+
dmlib::setDarkListViewCheckboxes(_listView);
290290
#endif
291291

292292
return CPropertyPage::OnInit();

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#include "PropertyNameRes.h"
3535

3636
#ifdef ZIP7_DARKMODE
37-
#include "../../../../DarkMode/lib/include/DarkModeSubclass.h"
37+
#include "../../../../DarkMode/lib/include/Darkmodelib.h"
3838
#endif
3939

4040
using namespace NWindows;
@@ -1202,7 +1202,7 @@ LRESULT CALLBACK CPanel::ListNotifySubclass(
12021202

12031203
case WM_NOTIFY:
12041204
{
1205-
if (!DarkMode::isEnabled()
1205+
if (!dmlib::isEnabled()
12061206
|| (!pPanelData->_mySelectMode
12071207
&& (!pPanelData->_markDeletedItems
12081208
|| !pPanelData->_thereAreDeletedItems)))
@@ -1233,14 +1233,14 @@ LRESULT CALLBACK CPanel::ListNotifySubclass(
12331233
&& realIndex != kParentIndex
12341234
&& pPanelData->_selectedStatusVector[realIndex])
12351235
{
1236-
lplvcd->clrTextBk = DarkMode::getHeaderHotBackgroundColor();
1236+
lplvcd->clrTextBk = dmlib::getHeaderHotBackgroundColor();
12371237
}
12381238

12391239
if (pPanelData->_markDeletedItems
12401240
&& pPanelData->_thereAreDeletedItems
12411241
&& pPanelData->IsItem_Deleted(realIndex))
12421242
{
1243-
lplvcd->clrText = DarkMode::getLinkTextColor();
1243+
lplvcd->clrText = dmlib::getLinkTextColor();
12441244
}
12451245
return resVal;
12461246
}

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

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

23+
#ifdef ZIP7_DARKMODE
24+
#include "../../../../DarkMode/lib/include/Darkmodelib.h"
25+
#endif
26+
2327
using namespace NWindows;
2428

2529
extern HINSTANCE g_hInstance;
@@ -984,7 +988,13 @@ INT_PTR CProgressDialog::Create(const UString &title, NWindows::CThread &thread,
984988
thread.Wait_Close();
985989
if (!MessagesDisplayed)
986990
if (!g_DisableUserQuestions)
991+
{
992+
#ifdef ZIP7_DARKMODE
993+
dmlib::darkMessageBoxW(wndParent, L"Progress Error", L"7-Zip", MB_ICONERROR);
994+
#else
987995
MessageBoxW(wndParent, L"Progress Error", L"7-Zip", MB_ICONERROR);
996+
#endif
997+
}
988998
return res;
989999
}
9901000

@@ -1020,7 +1030,13 @@ bool CProgressDialog::OnExternalCloseMessage()
10201030
if (fm.ErrorMessage.Title.IsEmpty())
10211031
fm.ErrorMessage.Title = "7-Zip";
10221032
if (!g_DisableUserQuestions)
1033+
{
1034+
#ifdef ZIP7_DARKMODE
1035+
dmlib::darkMessageBoxW(*this, fm.ErrorMessage.Message, fm.ErrorMessage.Title, MB_ICONERROR);
1036+
#else
10231037
MessageBoxW(*this, fm.ErrorMessage.Message, fm.ErrorMessage.Title, MB_ICONERROR);
1038+
#endif
1039+
}
10241040
}
10251041
else if (!thereAreMessages)
10261042
{
@@ -1031,7 +1047,13 @@ bool CProgressDialog::OnExternalCloseMessage()
10311047
if (fm.OkMessage.Title.IsEmpty())
10321048
fm.OkMessage.Title = "7-Zip";
10331049
if (!g_DisableUserQuestions)
1050+
{
1051+
#ifdef ZIP7_DARKMODE
1052+
dmlib::darkMessageBoxW(*this, fm.OkMessage.Message, fm.OkMessage.Title, MB_OK);
1053+
#else
10341054
MessageBoxW(*this, fm.OkMessage.Message, fm.OkMessage.Title, MB_OK);
1055+
#endif
1056+
}
10351057
}
10361058
}
10371059

@@ -1256,7 +1278,11 @@ bool CProgressDialog::OnButtonClicked(unsigned buttonID, HWND buttonHWND)
12561278
}
12571279

12581280
_inCancelMessageBox = true;
1281+
#ifdef ZIP7_DARKMODE
1282+
const int res = dmlib::darkMessageBoxW(*this, LangString(IDS_PROGRESS_ASK_CANCEL), _title, MB_YESNOCANCEL);
1283+
#else
12591284
const int res = ::MessageBoxW(*this, LangString(IDS_PROGRESS_ASK_CANCEL), _title, MB_YESNOCANCEL);
1285+
#endif
12601286
_inCancelMessageBox = false;
12611287
if (res == IDYES)
12621288
_cancelWasPressed = true;

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

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

2727
#ifdef ZIP7_DARKMODE
28-
#include "../../../../DarkMode/lib/include/DarkModeSubclass.h"
28+
#include "../../../../DarkMode/lib/include/Darkmodelib.h"
2929
#endif
3030

3131
using namespace NWindows;
@@ -263,7 +263,7 @@ bool CSettingsPage::OnInit()
263263

264264
#ifdef ZIP7_DARKMODE
265265
{
266-
const bool isININotUsed = !DarkMode::doesConfigFileExist() && DarkMode::isAtLeastWindows10();
266+
const bool isININotUsed = !dmlib::doesConfigFileExist() && dmlib::isAtLeastWindows10();
267267
EnableItem(IDC_COLOR_MODE, isININotUsed);
268268

269269
_clrModeCombo.Attach(GetItem(IDC_COLOR_MODE));
@@ -280,7 +280,7 @@ bool CSettingsPage::OnInit()
280280
}
281281
else
282282
{
283-
const wchar_t* mode = DarkMode::isAtLeastWindows10() ? L"INI used" : L"Old OS";
283+
const wchar_t* mode = dmlib::isAtLeastWindows10() ? L"INI used" : L"Old OS";
284284
_clrModeCombo.AddString(mode);
285285
_clrModeCombo.SetCurSel(0);
286286
}
@@ -380,34 +380,34 @@ LONG CSettingsPage::OnApply()
380380
{
381381
case 0:
382382
{
383-
DarkMode::setDarkModeConfigEx(static_cast<UINT>(DarkMode::DarkModeType::classic));
383+
dmlib::setDarkModeConfigEx(static_cast<UINT>(dmlib::DarkModeType::classic));
384384
break;
385385
}
386386

387387
case 2:
388388
{
389-
DarkMode::setDarkModeConfig();
389+
dmlib::setDarkModeConfig();
390390
break;
391391
}
392392

393393
//case 1:
394394
default:
395395
{
396-
DarkMode::setDarkModeConfigEx(static_cast<UINT>(DarkMode::DarkModeType::dark));
396+
dmlib::setDarkModeConfigEx(static_cast<UINT>(dmlib::DarkModeType::dark));
397397
break;
398398
}
399399
}
400400

401-
DarkMode::setDefaultColors(true);
401+
dmlib::setDefaultColors(true);
402402

403403
HWND hOption = GetParent();
404-
DarkMode::setChildCtrlsTheme(hOption);
405-
DarkMode::setDarkTitleBarEx(hOption, true);
404+
dmlib::setChildCtrlsTheme(hOption);
405+
dmlib::setDarkTitleBarEx(hOption, true);
406406
RedrawWindow(hOption, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_ALLCHILDREN | RDW_UPDATENOW | RDW_FRAME);
407407

408408
HWND hMain = ::GetParent(GetParent());
409-
DarkMode::setChildCtrlsTheme(hMain);
410-
DarkMode::setDarkTitleBarEx(hMain, true);
409+
dmlib::setChildCtrlsTheme(hMain);
410+
dmlib::setDarkTitleBarEx(hMain, true);
411411
RedrawWindow(hMain, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_ALLCHILDREN | RDW_UPDATENOW | RDW_FRAME);
412412

413413
_clrMode_wasChanged = false;

CPP/Windows/Control/Dialog.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include "../../7zip/UI/FileManager/RegistryUtils.h"
1515
#endif
1616
#ifdef ZIP7_DARKMODE
17-
#include "../../../DarkMode/lib/include/DarkModeSubclass.h"
17+
#include "../../../DarkMode/lib/include/Darkmodelib.h"
1818
#endif
1919

2020
extern HINSTANCE g_hInstance;
@@ -45,22 +45,22 @@ DialogProcedure(HWND dialogHWND, UINT message, WPARAM wParam, LPARAM lParam)
4545
dialog->Attach(dialogHWND);
4646
#ifdef ZIP7_DARKMODE
4747
#if defined(Z7_LANG)
48-
DarkMode::initDarkModeEx(L"7zDark");
48+
dmlib::initDarkModeEx(L"7zDark");
4949
#endif
5050
#if !defined(Z7_SFX)
51-
if (!DarkMode::doesConfigFileExist())
51+
if (!dmlib::doesConfigFileExist())
5252
{
5353
switch (Read_ClrMode())
5454
{
5555
case 0:
5656
{
57-
DarkMode::setDarkModeConfigEx(static_cast<UINT>(DarkMode::DarkModeType::classic));
57+
dmlib::setDarkModeConfigEx(static_cast<UINT>(dmlib::DarkModeType::classic));
5858
break;
5959
}
6060

6161
case 2:
6262
{
63-
DarkMode::setDarkModeConfig();
63+
dmlib::setDarkModeConfig();
6464
break;
6565
}
6666

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

CPP/Windows/Control/PropertyPage.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include "PropertyPage.h"
1010

1111
#ifdef ZIP7_DARKMODE
12-
#include "../../../DarkMode/lib/include/DarkModeSubclass.h"
12+
#include "../../../DarkMode/lib/include/Darkmodelib.h"
1313
#endif
1414

1515
extern HINSTANCE g_hInstance;
@@ -38,10 +38,10 @@ APIENTRY MyProperyPageProcedure(HWND dialogHWND, UINT message, WPARAM wParam, LP
3838
{
3939
dialog->Attach(dialogHWND);
4040
#ifdef ZIP7_DARKMODE
41-
DarkMode::setDarkWndNotifySafeEx(::GetParent(*dialog), true, true);
42-
DarkMode::setWindowCtlColorSubclass(*dialog);
43-
DarkMode::setWindowNotifyCustomDrawSubclass(*dialog);
44-
DarkMode::setChildCtrlsSubclassAndTheme(*dialog);
41+
dmlib::setDarkWndNotifySafeEx(::GetParent(*dialog), true, true);
42+
dmlib::setWindowCtlColorSubclass(*dialog);
43+
dmlib::setWindowNotifyCustomDrawSubclass(*dialog);
44+
dmlib::setChildCtrlsSubclassAndTheme(*dialog);
4545
#endif
4646
}
4747
try { return BoolToBOOL(dialog->OnMessage(message, wParam, lParam)); }

CPP/Windows/Shell.cpp

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

1313
#ifdef ZIP7_DARKMODE
14-
#include "../../DarkMode/lib/include/DarkModeSubclass.h"
14+
#include "../../DarkMode/lib/include/Darkmodelib.h"
1515
#endif
1616

1717
#ifndef _UNICODE
@@ -688,7 +688,7 @@ static int CALLBACK BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM /* lp */, LP
688688
case BFFM_INITIALIZED:
689689
{
690690
#ifdef ZIP7_DARKMODE
691-
DarkMode::setDarkWndSafeEx(hwnd, false);
691+
dmlib::setDarkWndSafeEx(hwnd, false);
692692
#endif
693693
SendMessage(hwnd, BFFM_SETSELECTION, TRUE, data);
694694
break;

DarkMode/7zRes/7zDark.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ textDisabled = "808080"
1919
edge = "646464"
2020
edgeHot = "9B9B9B"
2121
edgeDisabled = "484848"
22+
highlight = "60CDFF"
2223

2324
[dark.colors.view]
2425
backgroundView = "3F3F3F"
@@ -46,6 +47,7 @@ textDisabled = "6D6D6D"
4647
edge = "8D8D8D"
4748
edgeHot = "0078D4"
4849
edgeDisabled = "6D6D6D"
50+
highlight = "0078D4"
4951

5052
[light.colors.view]
5153
backgroundView = "FFFFFF"

0 commit comments

Comments
 (0)