settings_ui: Fix stepper buttons to Inactive Opacity to 0.1 increment adjustments (#40477)
Closes #40279 Release Notes: - Fix stepper buttons (+/-) to the Inactive Opacity setting for 0.1 increment adjustments on settings UI --------- Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
This commit is contained in:
@@ -1306,7 +1306,7 @@ mod element {
|
||||
let overlay_opacity = WorkspaceSettings::get(None, cx)
|
||||
.active_pane_modifiers
|
||||
.inactive_opacity
|
||||
.map(|val| val.clamp(0.0, 1.0))
|
||||
.map(|val| val.0.clamp(0.0, 1.0))
|
||||
.and_then(|val| (val <= 1.).then_some(val));
|
||||
|
||||
let mut overlay_background = cx.theme().colors().editor_background;
|
||||
|
||||
@@ -4,11 +4,11 @@ use crate::DockPosition;
|
||||
use collections::HashMap;
|
||||
use serde::Deserialize;
|
||||
pub use settings::AutosaveSetting;
|
||||
use settings::Settings;
|
||||
pub use settings::{
|
||||
BottomDockLayout, PaneSplitDirectionHorizontal, PaneSplitDirectionVertical,
|
||||
RestoreOnStartupBehavior,
|
||||
};
|
||||
use settings::{InactiveOpacity, Settings};
|
||||
|
||||
pub struct WorkspaceSettings {
|
||||
pub active_pane_modifiers: ActivePanelModifiers,
|
||||
@@ -50,7 +50,7 @@ pub struct ActivePanelModifiers {
|
||||
///
|
||||
/// Default: `1.0`
|
||||
// TODO: make this not an option, it is never None
|
||||
pub inactive_opacity: Option<f32>,
|
||||
pub inactive_opacity: Option<InactiveOpacity>,
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
|
||||
Reference in New Issue
Block a user