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}
0 commit comments