Skip to content

Commit

Permalink
Merge pull request #227 from ALTaleX531/master
Browse files Browse the repository at this point in the history
Bump to v2.1.0
  • Loading branch information
ALTaleX531 authored Mar 27, 2024
2 parents 28d3971 + 31ba31c commit 0f8d419
Show file tree
Hide file tree
Showing 44 changed files with 4,202 additions and 325 deletions.
57 changes: 36 additions & 21 deletions Common/Common.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/**
* FileName: Common.cpp
*
* Copyright (C) 2024 Maplespe
Expand Down Expand Up @@ -82,6 +82,8 @@ namespace MDWMBlurGlass
cfgData.reflection = Utils::GetIniString(path, L"config", L"reflection") == L"true";
cfgData.oldBtnHeight = Utils::GetIniString(path, L"config", L"oldBtnHeight") == L"true";
cfgData.customAmount = Utils::GetIniString(path, L"config", L"customAmount") == L"true";
// newly added params since 2.1.0
cfgData.overrideAccent = Utils::GetIniString(path, L"config", L"overrideAccent") == L"true";

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

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

// new - begin

ret = Utils::GetIniString(path, L"aero", L"PrimaryBalance");
// newly added params since 2.1.0
ret = Utils::GetIniString(path, L"config", L"glassIntensity");
if (!ret.empty())
cfgData.PrimaryBalance = (float)std::clamp(_wtof(ret.data()), 0.0, 1.0);

ret = Utils::GetIniString(path, L"aero", L"Active_SecondaryBalance");
cfgData.glassIntensity = (float)std::clamp(_wtof(ret.data()), 0.0, 1.0);
ret = Utils::GetIniString(path, L"config.aero", L"activeColorBalance");
if (!ret.empty())
cfgData.Active_SecondaryBalance = (float)std::clamp(_wtof(ret.data()), 0.0, 1.0);

ret = Utils::GetIniString(path, L"aero", L"Inactive_SecondaryBalance");
cfgData.activeColorBalance = (float)std::clamp(_wtof(ret.data()), 0.0, 1.0);
ret = Utils::GetIniString(path, L"config.aero", L"inactiveColorBalance");
if (!ret.empty())
cfgData.Inactive_SecondaryBalance = (float)std::clamp(_wtof(ret.data()), 0.0, 1.0);

cfgData.inactiveColorBalance = (float)std::clamp(_wtof(ret.data()), 0.0, 1.0);

ret = Utils::GetIniString(path, L"aero", L"Active_BlurBalance");
ret = Utils::GetIniString(path, L"config.aero", L"activeBlurBalance");
if (!ret.empty())
cfgData.Active_BlurBalance = (float)std::clamp(_wtof(ret.data()), -1.0, 1.0);

ret = Utils::GetIniString(path, L"aero", L"Inactive_BlurBalance");
cfgData.activeBlurBalance = (float)std::clamp(_wtof(ret.data()), -1.0, 1.0);
ret = Utils::GetIniString(path, L"config.aero", L"inactiveBlurBalance");
if (!ret.empty())
cfgData.Inactive_BlurBalance = (float)std::clamp(_wtof(ret.data()), -1.0, 1.0);


// new - end
cfgData.inactiveBlurBalance = (float)std::clamp(_wtof(ret.data()), -1.0, 1.0);
//

ret = Utils::GetIniString(path, L"config", L"effectType");
if (!ret.empty())
Expand All @@ -181,6 +176,13 @@ namespace MDWMBlurGlass
if (cfgData.blurmethod != blurMethod::CustomBlur && cfgData.effectType > effectType::Acrylic)
cfgData.effectType = effectType::Acrylic;
}

// newly added params since 2.1.0
ret = Utils::GetIniString(path, L"config", L"crossfadeTime");
if (!ret.empty())
{
cfgData.crossfadeTime = (UINT)_wtoll(ret.data());
}
return cfgData;
}

Expand All @@ -191,9 +193,21 @@ namespace MDWMBlurGlass
Utils::SetIniString(path, L"config", L"reflection", cfg.reflection ? L"true" : L"false");
Utils::SetIniString(path, L"config", L"oldBtnHeight", cfg.oldBtnHeight ? L"true" : L"false");
Utils::SetIniString(path, L"config", L"customAmount", cfg.customAmount ? L"true" : L"false");

// newly added params since 2.1.0
Utils::SetIniString(path, L"config", L"overrideAccent", cfg.overrideAccent ? L"true" : L"false");

Utils::SetIniString(path, L"config", L"blurAmount", std::to_wstring(cfg.blurAmount));
Utils::SetIniString(path, L"config", L"customBlurAmount", std::to_wstring(cfg.customBlurAmount));
Utils::SetIniString(path, L"config", L"luminosityOpacity", std::to_wstring(cfg.luminosityOpacity));

// newly added params since 2.1.0
Utils::SetIniString(path, L"config", L"glassIntensity", std::to_wstring(cfg.glassIntensity));
Utils::SetIniString(path, L"config.aero", L"activeColorBalance", std::to_wstring(cfg.activeColorBalance));
Utils::SetIniString(path, L"config.aero", L"inactiveColorBalance", std::to_wstring(cfg.inactiveColorBalance));
Utils::SetIniString(path, L"config.aero", L"activeBlurBalance", std::to_wstring(cfg.activeBlurBalance));
Utils::SetIniString(path, L"config.aero", L"inactiveBlurBalance", std::to_wstring(cfg.inactiveBlurBalance));

Utils::SetIniString(path, L"config", L"activeTextColor", std::to_wstring(cfg.activeTextColor));
Utils::SetIniString(path, L"config", L"inactiveTextColor", std::to_wstring(cfg.inactiveTextColor));
Utils::SetIniString(path, L"config", L"activeTextColorDark", std::to_wstring(cfg.activeTextColorDark));
Expand All @@ -205,6 +219,7 @@ namespace MDWMBlurGlass
Utils::SetIniString(path, L"config", L"blurMethod", std::to_wstring((int)cfg.blurmethod));
Utils::SetIniString(path, L"config", L"effectType", std::to_wstring((int)cfg.effectType));

// not on the gui... not sure if i should put the new entries here!
// newly added params since 2.1.0
Utils::SetIniString(path, L"config", L"crossfadeTime", std::to_wstring(cfg.crossfadeTime));
}
}
18 changes: 12 additions & 6 deletions Common/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ namespace MDWMBlurGlass

enum class effectType
{
None=-1,
Blur,
Aero,
Acrylic,
Expand All @@ -46,19 +47,22 @@ namespace MDWMBlurGlass
bool reflection = false;
bool oldBtnHeight = false;
bool customAmount = false;
// newly added params since 2.1.0
bool overrideAccent = false;

int extendRound = 10;
float blurAmount = 20.f;
float customBlurAmount = 20.f;
float luminosityOpacity = 0.65f;
// newly added params since 2.1.0
float glassIntensity = 1.f;

// these settings are optimal for the default Sky color from Windows 7

float PrimaryBalance = 0.08f;
float Active_SecondaryBalance = 0.43f;
float Inactive_SecondaryBalance = 0.43f;
float Active_BlurBalance = -0.125f;
float Inactive_BlurBalance = 0.365f;
// newly added params since 2.1.0
float activeColorBalance = 0.08f;
float inactiveColorBalance = 0.032f;
float activeBlurBalance = -0.125f;
float inactiveBlurBalance = 0.365f;

COLORREF activeTextColor = 0xFF000000;
COLORREF inactiveTextColor = 0xFFB4B4B4;
Expand All @@ -73,6 +77,8 @@ namespace MDWMBlurGlass

blurMethod blurmethod = blurMethod::CustomBlur;
effectType effectType = effectType::Blur;
// newly added params since 2.1.0
UINT crossfadeTime = 87;

bool isDefault()
{
Expand Down
2 changes: 1 addition & 1 deletion Common/VersionHelper.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/**
* FileName: VersionHelper.cpp
*
* Copyright (C) 2024 Maplespe
Expand Down
5 changes: 3 additions & 2 deletions DWMBlurGlass/MHostHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,9 @@ namespace MDWMBlurGlass
const bool ret = Inject(GetProcessId(L"dwm.exe"), Utils::GetCurrentDir() + L"\\DWMBlurGlassExt.dll", err);
if(ret)
{
BOOL enable = TRUE;
SystemParametersInfoW(SPI_SETGRADIENTCAPTIONS, 0, &enable, SPIF_SENDCHANGE);
/*BOOL enable = TRUE;
SystemParametersInfoW(SPI_SETGRADIENTCAPTIONS, 0, &enable, SPIF_SENDCHANGE);*/
PostMessageW(FindWindowW(L"Dwm", nullptr), WM_THEMECHANGED, 0, 0);
}
return ret;
}
Expand Down
2 changes: 1 addition & 1 deletion DWMBlurGlass/MainWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

namespace MDWMBlurGlass
{
inline const std::wstring g_vernum = L"2.0.1";
inline const std::wstring g_vernum = L"2.1.0";

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

Expand Down
20 changes: 11 additions & 9 deletions DWMBlurGlass/Page/MainPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,13 +263,13 @@ namespace MDWMBlurGlass
MessageBoxW(hWnd, (m_ui->GetStringValue(L"loadfail") + err).c_str(), L"Error", MB_ICONERROR);
return false;
}
if (symbolState)
RefreshSysConfig();
MessageBoxW(hWnd,
// if (symbolState)
//RefreshSysConfig();
/* MessageBoxW(hWnd,
m_ui->GetStringValue(symbolState ? L"installsucs" : L"installsucs1").c_str(),
m_ui->GetStringValue(L"install").c_str(),
MB_ICONINFORMATION
);
);*/
}
else
MessageBoxW(hWnd,
Expand All @@ -285,13 +285,13 @@ namespace MDWMBlurGlass
ShutdownDWMExtension(errinfo);
if (DeleteScheduledTasks(errinfo))
{
RefreshSysConfig();
//RefreshSysConfig();

MessageBoxW(hWnd,
/*MessageBoxW(hWnd,
m_ui->GetStringValue(L"uninstallsucs").c_str(),
m_ui->GetStringValue(L"uninstall").c_str(),
MB_ICONINFORMATION
);
);*/
}
else
MessageBoxW(hWnd,
Expand Down Expand Up @@ -673,10 +673,12 @@ namespace MDWMBlurGlass

void MainWindowPage::RefreshSysConfig()
{
BOOL enable = TRUE;
PostMessageW(FindWindowW(L"Dwm", nullptr), WM_THEMECHANGED, 0, 0);
InvalidateRect(nullptr, nullptr, FALSE);
/*BOOL enable = TRUE;
SystemParametersInfoW(SPI_SETGRADIENTCAPTIONS, 0, &enable, SPIF_SENDCHANGE);
SendNotifyMessageW(HWND_BROADCAST, WM_DWMCOLORIZATIONCOLORCHANGED, m_cfgData.activeBlendColor, 1);
BroadcastSystemMessageW(BSF_POSTMESSAGE, nullptr, WM_THEMECHANGED, 0, 0);
BroadcastSystemMessageW(BSF_POSTMESSAGE, nullptr, WM_THEMECHANGED, 0, 0);*/
}

void MainWindowPage::RefreshBlurPreview()
Expand Down
Binary file modified DWMBlurGlass/Resource.rc
Binary file not shown.
2 changes: 1 addition & 1 deletion DWMBlurGlass/pugixml/pugiconfig.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/**
* pugixml parser - version 1.12
* --------------------------------------------------------
* Copyright (C) 2006-2022, by Arseny Kapoulkine ([email protected])
Expand Down
2 changes: 1 addition & 1 deletion DWMBlurGlass/pugixml/pugixml.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/**
* pugixml parser - version 1.12
* --------------------------------------------------------
* Copyright (C) 2006-2022, by Arseny Kapoulkine ([email protected])
Expand Down
2 changes: 1 addition & 1 deletion DWMBlurGlass/pugixml/pugixml.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/**
* pugixml parser - version 1.12
* --------------------------------------------------------
* Copyright (C) 2006-2022, by Arseny Kapoulkine ([email protected])
Expand Down
Loading

0 comments on commit 0f8d419

Please sign in to comment.