Skip to content

Commit 99cf8f0

Browse files
committed
Clean up editor preferences dialog
1 parent 4250f29 commit 99cf8f0

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

editor/src/messages/dialog/preferences_dialog/preferences_dialog_message_handler.rs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,33 +31,34 @@ impl PreferencesDialogMessageHandler {
3131
const TITLE: &'static str = "Editor Preferences";
3232

3333
fn layout(&self, preferences: &PreferencesMessageHandler) -> Layout {
34+
let zoom_with_scroll_tooltip = "Use the scroll wheel for zooming instead of vertically panning (not recommended for trackpads)";
35+
let input_section = vec![TextLabel::new("Input").italic(true).widget_holder()];
3436
let zoom_with_scroll = vec![
35-
TextLabel::new("Input").min_width(60).italic(true).widget_holder(),
36-
TextLabel::new("Zoom with Scroll").table_align(true).widget_holder(),
37-
Separator::new(SeparatorType::Unrelated).widget_holder(),
3837
CheckboxInput::new(preferences.zoom_with_scroll)
39-
.tooltip("Use the scroll wheel for zooming instead of vertically panning (not recommended for trackpads)")
38+
.tooltip(zoom_with_scroll_tooltip)
4039
.on_update(|checkbox_input: &CheckboxInput| {
4140
PreferencesMessage::ModifyLayout {
4241
zoom_with_scroll: checkbox_input.checked,
4342
}
4443
.into()
4544
})
4645
.widget_holder(),
46+
Separator::new(SeparatorType::Unrelated).widget_holder(),
47+
TextLabel::new("Zoom with Scroll").table_align(true).tooltip(zoom_with_scroll_tooltip).widget_holder(),
4748
];
4849
let vello_tooltip = "Use the experimental Vello renderer (your browser must support WebGPU)";
50+
let renderer_section = vec![TextLabel::new("Renderer").italic(true).widget_holder()];
4951
let use_vello = vec![
50-
TextLabel::new("Renderer").min_width(60).italic(true).widget_holder(),
51-
TextLabel::new("Vello (Experimental)")
52-
.table_align(true)
52+
CheckboxInput::new(preferences.use_vello && preferences.supports_wgpu())
5353
.tooltip(vello_tooltip)
5454
.disabled(!preferences.supports_wgpu())
55+
.on_update(|checkbox_input: &CheckboxInput| PreferencesMessage::UseVello { use_vello: checkbox_input.checked }.into())
5556
.widget_holder(),
5657
Separator::new(SeparatorType::Unrelated).widget_holder(),
57-
CheckboxInput::new(preferences.use_vello && preferences.supports_wgpu())
58+
TextLabel::new("Vello (Experimental)")
59+
.table_align(true)
5860
.tooltip(vello_tooltip)
5961
.disabled(!preferences.supports_wgpu())
60-
.on_update(|checkbox_input: &CheckboxInput| PreferencesMessage::UseVello { use_vello: checkbox_input.checked }.into())
6162
.widget_holder(),
6263
];
6364

@@ -85,7 +86,9 @@ impl PreferencesDialogMessageHandler {
8586
// ];
8687

8788
Layout::WidgetLayout(WidgetLayout::new(vec![
89+
LayoutGroup::Row { widgets: input_section },
8890
LayoutGroup::Row { widgets: zoom_with_scroll },
91+
LayoutGroup::Row { widgets: renderer_section },
8992
LayoutGroup::Row { widgets: use_vello },
9093
// LayoutGroup::Row { widgets: imaginate_server_hostname },
9194
// LayoutGroup::Row { widgets: imaginate_refresh_frequency },

0 commit comments

Comments
 (0)