settings_ui: Only allow to reset a setting to default in the file in which it was customized (#40182)
Plus some other tiny visual adjustments. Release Notes: - N/A
This commit is contained in:
@@ -734,18 +734,19 @@ fn render_settings_item(
|
||||
.when_some(
|
||||
setting_item
|
||||
.field
|
||||
.reset_to_default_fn(&file, &found_in_file, cx),
|
||||
.reset_to_default_fn(&file, &found_in_file, cx)
|
||||
.filter(|_| file_set_in.as_ref() == Some(&file)),
|
||||
|this, reset_to_default| {
|
||||
this.child(
|
||||
IconButton::new("reset-to-default-btn", IconName::Undo)
|
||||
.icon_color(Color::Muted)
|
||||
.size(ButtonSize::Compact)
|
||||
.icon_size(IconSize::Small)
|
||||
.tooltip(Tooltip::text("Reset to Default"))
|
||||
.on_click({
|
||||
move |_, _, cx| {
|
||||
reset_to_default(cx);
|
||||
}
|
||||
})
|
||||
.tooltip(Tooltip::text("Reset to default")),
|
||||
}),
|
||||
)
|
||||
},
|
||||
)
|
||||
@@ -754,7 +755,7 @@ fn render_settings_item(
|
||||
|this, file_set_in| {
|
||||
this.child(
|
||||
Label::new(format!(
|
||||
"— set in {}",
|
||||
"— Modified in {}",
|
||||
settings_window
|
||||
.display_name(&file_set_in)
|
||||
.expect("File name should exist")
|
||||
|
||||
Reference in New Issue
Block a user