blockRoundedCorners: Invert if condition for readability

This commit is contained in:
OpenSauce04 2026-04-19 13:24:59 +01:00
parent 965335676f
commit d2c33df512

View file

@ -165,17 +165,7 @@ public:
HWND hwnd = reinterpret_cast<HWND>(widget->winId());
DWORD pref;
if (!block) {
auto it = original_prefs.find(hwnd);
if (it == original_prefs.end())
return;
pref = it->second;
DwmSetWindowAttribute(hwnd, DWMWA_WINDOW_CORNER_PREFERENCE, &pref, sizeof(pref));
original_prefs.erase(it);
} else {
if (block) {
pref = DWMWCP_DEFAULT;
if (SUCCEEDED(DwmGetWindowAttribute(hwnd, DWMWA_WINDOW_CORNER_PREFERENCE, &pref,
sizeof(pref)))) {
@ -186,6 +176,16 @@ public:
pref = DWMWCP_DONOTROUND;
DwmSetWindowAttribute(hwnd, DWMWA_WINDOW_CORNER_PREFERENCE, &pref, sizeof(pref));
} else {
auto it = original_prefs.find(hwnd);
if (it == original_prefs.end())
return;
pref = it->second;
DwmSetWindowAttribute(hwnd, DWMWA_WINDOW_CORNER_PREFERENCE, &pref, sizeof(pref));
original_prefs.erase(it);
}
}