1
0
mirror of synced 2024-11-30 18:34:29 +01:00

fix: Turning off blur again not working

This commit is contained in:
WerWolv 2023-05-22 13:20:25 +02:00
parent 7ce0613977
commit e32fc639c2
5 changed files with 16 additions and 10 deletions

View File

@ -355,8 +355,8 @@ namespace hex {
const auto SetWindowCompositionAttribute = (SetWindowCompositionAttributeFunc)(void*)GetProcAddress(user32Dll, "SetWindowCompositionAttribute");
if (SetWindowCompositionAttribute != nullptr) {
ACCENTPOLICY policy = { 3, 0, 0, 0 };
WINCOMPATTRDATA data = { ImGui::GetCustomStyle().WindowBlur > 0.0F ? 19 : 0, &policy, sizeof(ACCENTPOLICY) };
ACCENTPOLICY policy = { ImGui::GetCustomStyle().WindowBlur > 0.5F ? 3 : 0, 0, 0, 0 };
WINCOMPATTRDATA data = { 19, &policy, sizeof(ACCENTPOLICY) };
SetWindowCompositionAttribute(hwnd, &data);
}
FreeLibrary(user32Dll);

View File

@ -56,7 +56,7 @@
"title-background": "#66668CCC",
"title-background-active": "#66668CCC",
"title-background-collapse": "#66668CCC",
"window-background": "#000000D8"
"window-background": "#000000FF"
},
"imhex": {
"desc-button": "#282850FF",

View File

@ -56,7 +56,7 @@
"title-background": "#232323FF",
"title-background-active": "#232323FF",
"title-background-collapse": "#232323FF",
"window-background": "#0F0F0FEF"
"window-background": "#0F0F0FFF"
},
"imhex": {
"desc-button": "#141414FF",

View File

@ -240,7 +240,7 @@ namespace hex::plugin::builtin {
{
auto &style = ImGui::GetStyle();
const static ThemeManager::StyleMap ImGuiStyleMap = {
{ "alpha", { &style.Alpha, 0.001F, 1.0F, false } },
{ "alpha", { &style.Alpha, 0.1F, 1.0F, false } },
{ "disabled-alpha", { &style.DisabledAlpha, 0.0F, 1.0F, false } },
{ "window-padding", { &style.WindowPadding, 0.0F, 20.0F, true } },
{ "window-rounding", { &style.WindowRounding, 0.0F, 12.0F, true } },
@ -330,7 +330,7 @@ namespace hex::plugin::builtin {
{
auto &style = ImGui::GetCustomStyle();
const static ThemeManager::StyleMap ImHexStyleMap = {
{ "window-blur", { &style.WindowBlur, 0.0F, 1.0F, true } },
{ "window-blur", { &style.WindowBlur, 0.0F, 1.0F, true } },
};
ThemeManager::addStyleHandler("imhex", ImHexStyleMap);

View File

@ -27,6 +27,7 @@ namespace hex::plugin::builtin {
ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_AlphaBar | ImGuiColorEditFlags_AlphaPreviewHalf))
{
handler.setFunction(colorId, color);
EventManager::post<EventThemeChanged>();
}
}
}
@ -42,10 +43,15 @@ namespace hex::plugin::builtin {
for (auto &[styleName, style] : handler.styleMap) {
auto &[value, min, max, needsScaling] = style;
if (auto floatValue = std::get_if<float*>(&value); floatValue != nullptr)
ImGui::SliderFloat(styleName.c_str(), *floatValue, min, max, "%.1f");
else if (auto vecValue = std::get_if<ImVec2*>(&value); vecValue != nullptr)
ImGui::SliderFloat2(styleName.c_str(), &(*vecValue)->x, min, max, "%.1f");
if (auto floatValue = std::get_if<float*>(&value); floatValue != nullptr) {
if (ImGui::SliderFloat(styleName.c_str(), *floatValue, min, max, "%.1f")) {
EventManager::post<EventThemeChanged>();
}
} else if (auto vecValue = std::get_if<ImVec2*>(&value); vecValue != nullptr) {
if (ImGui::SliderFloat2(styleName.c_str(), &(*vecValue)->x, min, max, "%.1f")) {
EventManager::post<EventThemeChanged>();
}
}
}
}
}