change(acrylic): lower the blur slider's range to a gentle max
Now that panels frost at full alpha, the slider's old top end (multiplier 4.0) was far too blurry. Cap the range at multiplier 1.25 (kAcrylicMaxBlur) — the slider still reads 0–100%, but 100% now maps to a moderate frost instead of a heavy wash. Snap-to-off threshold scales with the new range, and a value saved under the old 0–4 range is clamped on load so it lands within 0–100%. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -57,6 +57,11 @@ namespace ui {
|
||||
|
||||
using namespace material;
|
||||
|
||||
// Top of the Acrylic slider's range (the blur-radius multiplier at 100%). The panels frost at full
|
||||
// alpha now, so this only controls how BLURRY the max is — kept gentle (the old max of 4.0 was way
|
||||
// too strong). The slider still reads 0–100%; this is just what 100% maps to.
|
||||
static constexpr float kAcrylicMaxBlur = 1.25f;
|
||||
|
||||
// Helper: build "TranslatedLabel##id" for ImGui widgets that use label as ID
|
||||
static std::string TrId(const char* tr_key, const char* id) {
|
||||
std::string s = TR(tr_key);
|
||||
@@ -391,8 +396,9 @@ static void loadSettingsPageState(config::Settings* settings) {
|
||||
idx++;
|
||||
}
|
||||
|
||||
// Load blur amount directly from saved multiplier
|
||||
s_settingsState.blur_amount = settings->getBlurMultiplier();
|
||||
// Load blur amount directly from saved multiplier, clamped to the (now gentler) slider max so a
|
||||
// value saved under the old 0–4 range maps into 0–100% instead of pinning far past the top.
|
||||
s_settingsState.blur_amount = std::min(settings->getBlurMultiplier(), kAcrylicMaxBlur);
|
||||
s_settingsState.acrylic_enabled = (s_settingsState.blur_amount > 0.001f);
|
||||
s_settingsState.ui_opacity = settings->getUIOpacity();
|
||||
s_settingsState.window_opacity = settings->getWindowOpacity();
|
||||
@@ -883,10 +889,10 @@ void RenderSettingsPage(App* app) {
|
||||
if (s_settingsState.blur_amount < 0.01f)
|
||||
snprintf(blur_fmt, sizeof(blur_fmt), "%s", TR("slider_off"));
|
||||
else
|
||||
snprintf(blur_fmt, sizeof(blur_fmt), "%.0f%%%%", s_settingsState.blur_amount * 25.0f);
|
||||
if (ImGui::SliderFloat("##AcrylicBlur", &s_settingsState.blur_amount, 0.0f, 4.0f, blur_fmt,
|
||||
snprintf(blur_fmt, sizeof(blur_fmt), "%.0f%%%%", s_settingsState.blur_amount / kAcrylicMaxBlur * 100.0f);
|
||||
if (ImGui::SliderFloat("##AcrylicBlur", &s_settingsState.blur_amount, 0.0f, kAcrylicMaxBlur, blur_fmt,
|
||||
ImGuiSliderFlags_AlwaysClamp)) {
|
||||
if (s_settingsState.blur_amount > 0.0f && s_settingsState.blur_amount < 0.15f) s_settingsState.blur_amount = 0.0f;
|
||||
if (s_settingsState.blur_amount > 0.0f && s_settingsState.blur_amount < kAcrylicMaxBlur * 0.04f) s_settingsState.blur_amount = 0.0f;
|
||||
s_settingsState.acrylic_enabled = (s_settingsState.blur_amount > 0.001f);
|
||||
effects::ImGuiAcrylic::ApplyBlurAmount(s_settingsState.blur_amount);
|
||||
}
|
||||
@@ -1129,10 +1135,10 @@ void RenderSettingsPage(App* app) {
|
||||
if (s_settingsState.blur_amount < 0.01f)
|
||||
snprintf(blur_fmt, sizeof(blur_fmt), "%s", TR("slider_off"));
|
||||
else
|
||||
snprintf(blur_fmt, sizeof(blur_fmt), "%.0f%%%%", s_settingsState.blur_amount * 25.0f);
|
||||
if (ImGui::SliderFloat("##AcrylicBlur", &s_settingsState.blur_amount, 0.0f, 4.0f, blur_fmt,
|
||||
snprintf(blur_fmt, sizeof(blur_fmt), "%.0f%%%%", s_settingsState.blur_amount / kAcrylicMaxBlur * 100.0f);
|
||||
if (ImGui::SliderFloat("##AcrylicBlur", &s_settingsState.blur_amount, 0.0f, kAcrylicMaxBlur, blur_fmt,
|
||||
ImGuiSliderFlags_AlwaysClamp)) {
|
||||
if (s_settingsState.blur_amount > 0.0f && s_settingsState.blur_amount < 0.15f) s_settingsState.blur_amount = 0.0f;
|
||||
if (s_settingsState.blur_amount > 0.0f && s_settingsState.blur_amount < kAcrylicMaxBlur * 0.04f) s_settingsState.blur_amount = 0.0f;
|
||||
s_settingsState.acrylic_enabled = (s_settingsState.blur_amount > 0.001f);
|
||||
effects::ImGuiAcrylic::ApplyBlurAmount(s_settingsState.blur_amount);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user