Skip to content

Commit 0f8d419

Browse files
authored
Merge pull request #227 from ALTaleX531/master
Bump to v2.1.0
2 parents 28d3971 + 31ba31c commit 0f8d419

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+4202
-325
lines changed

Common/Common.cpp

Lines changed: 36 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/**
1+
/**
22
* FileName: Common.cpp
33
*
44
* Copyright (C) 2024 Maplespe
@@ -82,6 +82,8 @@ namespace MDWMBlurGlass
8282
cfgData.reflection = Utils::GetIniString(path, L"config", L"reflection") == L"true";
8383
cfgData.oldBtnHeight = Utils::GetIniString(path, L"config", L"oldBtnHeight") == L"true";
8484
cfgData.customAmount = Utils::GetIniString(path, L"config", L"customAmount") == L"true";
85+
// newly added params since 2.1.0
86+
cfgData.overrideAccent = Utils::GetIniString(path, L"config", L"overrideAccent") == L"true";
8587

8688
auto ret = Utils::GetIniString(path, L"config", L"extendRound");
8789

@@ -148,31 +150,24 @@ namespace MDWMBlurGlass
148150
if (!ret.empty())
149151
cfgData.blurmethod = (blurMethod)std::clamp(_wtoi(ret.data()), 0, 2);
150152

151-
// new - begin
152-
153-
ret = Utils::GetIniString(path, L"aero", L"PrimaryBalance");
153+
// newly added params since 2.1.0
154+
ret = Utils::GetIniString(path, L"config", L"glassIntensity");
154155
if (!ret.empty())
155-
cfgData.PrimaryBalance = (float)std::clamp(_wtof(ret.data()), 0.0, 1.0);
156-
157-
ret = Utils::GetIniString(path, L"aero", L"Active_SecondaryBalance");
156+
cfgData.glassIntensity = (float)std::clamp(_wtof(ret.data()), 0.0, 1.0);
157+
ret = Utils::GetIniString(path, L"config.aero", L"activeColorBalance");
158158
if (!ret.empty())
159-
cfgData.Active_SecondaryBalance = (float)std::clamp(_wtof(ret.data()), 0.0, 1.0);
160-
161-
ret = Utils::GetIniString(path, L"aero", L"Inactive_SecondaryBalance");
159+
cfgData.activeColorBalance = (float)std::clamp(_wtof(ret.data()), 0.0, 1.0);
160+
ret = Utils::GetIniString(path, L"config.aero", L"inactiveColorBalance");
162161
if (!ret.empty())
163-
cfgData.Inactive_SecondaryBalance = (float)std::clamp(_wtof(ret.data()), 0.0, 1.0);
164-
162+
cfgData.inactiveColorBalance = (float)std::clamp(_wtof(ret.data()), 0.0, 1.0);
165163

166-
ret = Utils::GetIniString(path, L"aero", L"Active_BlurBalance");
164+
ret = Utils::GetIniString(path, L"config.aero", L"activeBlurBalance");
167165
if (!ret.empty())
168-
cfgData.Active_BlurBalance = (float)std::clamp(_wtof(ret.data()), -1.0, 1.0);
169-
170-
ret = Utils::GetIniString(path, L"aero", L"Inactive_BlurBalance");
166+
cfgData.activeBlurBalance = (float)std::clamp(_wtof(ret.data()), -1.0, 1.0);
167+
ret = Utils::GetIniString(path, L"config.aero", L"inactiveBlurBalance");
171168
if (!ret.empty())
172-
cfgData.Inactive_BlurBalance = (float)std::clamp(_wtof(ret.data()), -1.0, 1.0);
173-
174-
175-
// new - end
169+
cfgData.inactiveBlurBalance = (float)std::clamp(_wtof(ret.data()), -1.0, 1.0);
170+
//
176171

177172
ret = Utils::GetIniString(path, L"config", L"effectType");
178173
if (!ret.empty())
@@ -181,6 +176,13 @@ namespace MDWMBlurGlass
181176
if (cfgData.blurmethod != blurMethod::CustomBlur && cfgData.effectType > effectType::Acrylic)
182177
cfgData.effectType = effectType::Acrylic;
183178
}
179+
180+
// newly added params since 2.1.0
181+
ret = Utils::GetIniString(path, L"config", L"crossfadeTime");
182+
if (!ret.empty())
183+
{
184+
cfgData.crossfadeTime = (UINT)_wtoll(ret.data());
185+
}
184186
return cfgData;
185187
}
186188

@@ -191,9 +193,21 @@ namespace MDWMBlurGlass
191193
Utils::SetIniString(path, L"config", L"reflection", cfg.reflection ? L"true" : L"false");
192194
Utils::SetIniString(path, L"config", L"oldBtnHeight", cfg.oldBtnHeight ? L"true" : L"false");
193195
Utils::SetIniString(path, L"config", L"customAmount", cfg.customAmount ? L"true" : L"false");
196+
197+
// newly added params since 2.1.0
198+
Utils::SetIniString(path, L"config", L"overrideAccent", cfg.overrideAccent ? L"true" : L"false");
199+
194200
Utils::SetIniString(path, L"config", L"blurAmount", std::to_wstring(cfg.blurAmount));
195201
Utils::SetIniString(path, L"config", L"customBlurAmount", std::to_wstring(cfg.customBlurAmount));
196202
Utils::SetIniString(path, L"config", L"luminosityOpacity", std::to_wstring(cfg.luminosityOpacity));
203+
204+
// newly added params since 2.1.0
205+
Utils::SetIniString(path, L"config", L"glassIntensity", std::to_wstring(cfg.glassIntensity));
206+
Utils::SetIniString(path, L"config.aero", L"activeColorBalance", std::to_wstring(cfg.activeColorBalance));
207+
Utils::SetIniString(path, L"config.aero", L"inactiveColorBalance", std::to_wstring(cfg.inactiveColorBalance));
208+
Utils::SetIniString(path, L"config.aero", L"activeBlurBalance", std::to_wstring(cfg.activeBlurBalance));
209+
Utils::SetIniString(path, L"config.aero", L"inactiveBlurBalance", std::to_wstring(cfg.inactiveBlurBalance));
210+
197211
Utils::SetIniString(path, L"config", L"activeTextColor", std::to_wstring(cfg.activeTextColor));
198212
Utils::SetIniString(path, L"config", L"inactiveTextColor", std::to_wstring(cfg.inactiveTextColor));
199213
Utils::SetIniString(path, L"config", L"activeTextColorDark", std::to_wstring(cfg.activeTextColorDark));
@@ -205,6 +219,7 @@ namespace MDWMBlurGlass
205219
Utils::SetIniString(path, L"config", L"blurMethod", std::to_wstring((int)cfg.blurmethod));
206220
Utils::SetIniString(path, L"config", L"effectType", std::to_wstring((int)cfg.effectType));
207221

208-
// not on the gui... not sure if i should put the new entries here!
222+
// newly added params since 2.1.0
223+
Utils::SetIniString(path, L"config", L"crossfadeTime", std::to_wstring(cfg.crossfadeTime));
209224
}
210225
}

Common/Common.h

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ namespace MDWMBlurGlass
3333

3434
enum class effectType
3535
{
36+
None=-1,
3637
Blur,
3738
Aero,
3839
Acrylic,
@@ -46,19 +47,22 @@ namespace MDWMBlurGlass
4647
bool reflection = false;
4748
bool oldBtnHeight = false;
4849
bool customAmount = false;
50+
// newly added params since 2.1.0
51+
bool overrideAccent = false;
4952

5053
int extendRound = 10;
5154
float blurAmount = 20.f;
5255
float customBlurAmount = 20.f;
5356
float luminosityOpacity = 0.65f;
57+
// newly added params since 2.1.0
58+
float glassIntensity = 1.f;
5459

5560
// these settings are optimal for the default Sky color from Windows 7
56-
57-
float PrimaryBalance = 0.08f;
58-
float Active_SecondaryBalance = 0.43f;
59-
float Inactive_SecondaryBalance = 0.43f;
60-
float Active_BlurBalance = -0.125f;
61-
float Inactive_BlurBalance = 0.365f;
61+
// newly added params since 2.1.0
62+
float activeColorBalance = 0.08f;
63+
float inactiveColorBalance = 0.032f;
64+
float activeBlurBalance = -0.125f;
65+
float inactiveBlurBalance = 0.365f;
6266

6367
COLORREF activeTextColor = 0xFF000000;
6468
COLORREF inactiveTextColor = 0xFFB4B4B4;
@@ -73,6 +77,8 @@ namespace MDWMBlurGlass
7377

7478
blurMethod blurmethod = blurMethod::CustomBlur;
7579
effectType effectType = effectType::Blur;
80+
// newly added params since 2.1.0
81+
UINT crossfadeTime = 87;
7682

7783
bool isDefault()
7884
{

Common/VersionHelper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/**
1+
/**
22
* FileName: VersionHelper.cpp
33
*
44
* Copyright (C) 2024 Maplespe

DWMBlurGlass/MHostHelper.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,9 @@ namespace MDWMBlurGlass
144144
const bool ret = Inject(GetProcessId(L"dwm.exe"), Utils::GetCurrentDir() + L"\\DWMBlurGlassExt.dll", err);
145145
if(ret)
146146
{
147-
BOOL enable = TRUE;
148-
SystemParametersInfoW(SPI_SETGRADIENTCAPTIONS, 0, &enable, SPIF_SENDCHANGE);
147+
/*BOOL enable = TRUE;
148+
SystemParametersInfoW(SPI_SETGRADIENTCAPTIONS, 0, &enable, SPIF_SENDCHANGE);*/
149+
PostMessageW(FindWindowW(L"Dwm", nullptr), WM_THEMECHANGED, 0, 0);
149150
}
150151
return ret;
151152
}

DWMBlurGlass/MainWindow.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
namespace MDWMBlurGlass
2323
{
24-
inline const std::wstring g_vernum = L"2.0.1";
24+
inline const std::wstring g_vernum = L"2.1.0";
2525

2626
Mui::_m_result MainWindow_SrcEventProc(Mui::MWindowCtx*, const Mui::MWndDefEventSource&, Mui::MEventCodeEnum, Mui::_m_param);
2727

DWMBlurGlass/Page/MainPage.cpp

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -263,13 +263,13 @@ namespace MDWMBlurGlass
263263
MessageBoxW(hWnd, (m_ui->GetStringValue(L"loadfail") + err).c_str(), L"Error", MB_ICONERROR);
264264
return false;
265265
}
266-
if (symbolState)
267-
RefreshSysConfig();
268-
MessageBoxW(hWnd,
266+
// if (symbolState)
267+
//RefreshSysConfig();
268+
/* MessageBoxW(hWnd,
269269
m_ui->GetStringValue(symbolState ? L"installsucs" : L"installsucs1").c_str(),
270270
m_ui->GetStringValue(L"install").c_str(),
271271
MB_ICONINFORMATION
272-
);
272+
);*/
273273
}
274274
else
275275
MessageBoxW(hWnd,
@@ -285,13 +285,13 @@ namespace MDWMBlurGlass
285285
ShutdownDWMExtension(errinfo);
286286
if (DeleteScheduledTasks(errinfo))
287287
{
288-
RefreshSysConfig();
288+
//RefreshSysConfig();
289289

290-
MessageBoxW(hWnd,
290+
/*MessageBoxW(hWnd,
291291
m_ui->GetStringValue(L"uninstallsucs").c_str(),
292292
m_ui->GetStringValue(L"uninstall").c_str(),
293293
MB_ICONINFORMATION
294-
);
294+
);*/
295295
}
296296
else
297297
MessageBoxW(hWnd,
@@ -673,10 +673,12 @@ namespace MDWMBlurGlass
673673

674674
void MainWindowPage::RefreshSysConfig()
675675
{
676-
BOOL enable = TRUE;
676+
PostMessageW(FindWindowW(L"Dwm", nullptr), WM_THEMECHANGED, 0, 0);
677+
InvalidateRect(nullptr, nullptr, FALSE);
678+
/*BOOL enable = TRUE;
677679
SystemParametersInfoW(SPI_SETGRADIENTCAPTIONS, 0, &enable, SPIF_SENDCHANGE);
678680
SendNotifyMessageW(HWND_BROADCAST, WM_DWMCOLORIZATIONCOLORCHANGED, m_cfgData.activeBlendColor, 1);
679-
BroadcastSystemMessageW(BSF_POSTMESSAGE, nullptr, WM_THEMECHANGED, 0, 0);
681+
BroadcastSystemMessageW(BSF_POSTMESSAGE, nullptr, WM_THEMECHANGED, 0, 0);*/
680682
}
681683

682684
void MainWindowPage::RefreshBlurPreview()

DWMBlurGlass/Resource.rc

0 Bytes
Binary file not shown.

DWMBlurGlass/pugixml/pugiconfig.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/**
1+
/**
22
* pugixml parser - version 1.12
33
* --------------------------------------------------------
44
* Copyright (C) 2006-2022, by Arseny Kapoulkine ([email protected])

DWMBlurGlass/pugixml/pugixml.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/**
1+
/**
22
* pugixml parser - version 1.12
33
* --------------------------------------------------------
44
* Copyright (C) 2006-2022, by Arseny Kapoulkine ([email protected])

DWMBlurGlass/pugixml/pugixml.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/**
1+
/**
22
* pugixml parser - version 1.12
33
* --------------------------------------------------------
44
* Copyright (C) 2006-2022, by Arseny Kapoulkine ([email protected])

0 commit comments

Comments
 (0)