mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-29 04:08:12 +08:00
Add 'Zoom with Scroll' input navigation scheme to preferences (#1021)
* Add use_scroll_as_zoom field to preference handler
* Add {Create,Delete}Mapping variants to message
* Revert "Add {Create,Delete}Mapping variants to message"
This reverts commit 0ba74754c9fb0c78d0b590c96e1d4fe2cfdd13e7.
* Revert "Add use_scroll_as_zoom field to preference handler"
This reverts commit d30f7c9edfa6d6e156939ca07f4db81f288975fd.
* Add basic scroll_as_zoom mapping
* Create overengineered mapping patch abstraction
* Add (for now passthrough) input layout manager
* Actually handle ModifyLayout messages (untested)
* Add backend preferences <-> layout manager comms
* Add scroll-as-zoom to actual preferences UI
* Rename LayoutManager -> KeyMapping
* Add Input section to preferences and title case
* Add scrollAsZoom frontend handling code (untested)
* Handle frontend <-> preferences comms
* (broken) Move scrollAsZoom persistence into state
* Fix scrollAsZoom having no effect on node graph
* Remove debugging helpers
* Fix confusion between horizontal and vertical
* Rename feature
* Move new message handler into folder
---------
Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
committed by
Keavon Chambers
co-authored by
Keavon Chambers
parent
c2234ce3fe
commit
7a52e50a94
+31
-1
@@ -1,7 +1,7 @@
|
||||
use crate::messages::layout::utility_types::layout_widget::{Layout, LayoutGroup, Widget, WidgetCallback, WidgetHolder, WidgetLayout};
|
||||
use crate::messages::layout::utility_types::misc::LayoutTarget;
|
||||
use crate::messages::layout::utility_types::widgets::button_widgets::TextButton;
|
||||
use crate::messages::layout::utility_types::widgets::input_widgets::{NumberInput, TextInput};
|
||||
use crate::messages::layout::utility_types::widgets::input_widgets::{CheckboxInput, NumberInput, TextInput};
|
||||
use crate::messages::layout::utility_types::widgets::label_widgets::{Separator, SeparatorDirection, SeparatorType, TextLabel};
|
||||
use crate::messages::prelude::*;
|
||||
|
||||
@@ -33,6 +33,35 @@ impl PreferencesDialogMessageHandler {
|
||||
}
|
||||
|
||||
fn properties(&self, preferences: &PreferencesMessageHandler) -> Layout {
|
||||
let zoom_with_scroll = vec![
|
||||
WidgetHolder::new(Widget::TextLabel(TextLabel {
|
||||
value: "Input".into(),
|
||||
min_width: 60,
|
||||
italic: true,
|
||||
..Default::default()
|
||||
})),
|
||||
WidgetHolder::new(Widget::TextLabel(TextLabel {
|
||||
value: "Zoom with Scroll".into(),
|
||||
table_align: true,
|
||||
..Default::default()
|
||||
})),
|
||||
WidgetHolder::new(Widget::Separator(Separator {
|
||||
separator_type: SeparatorType::Unrelated,
|
||||
direction: SeparatorDirection::Horizontal,
|
||||
})),
|
||||
WidgetHolder::new(Widget::CheckboxInput(CheckboxInput {
|
||||
checked: preferences.zoom_with_scroll,
|
||||
tooltip: "Use the scroll wheel for zooming instead of vertically panning (not recommended for trackpads)".into(),
|
||||
on_update: WidgetCallback::new(|checkbox_input: &CheckboxInput| {
|
||||
PreferencesMessage::ModifyLayout {
|
||||
zoom_with_scroll: checkbox_input.checked,
|
||||
}
|
||||
.into()
|
||||
}),
|
||||
..Default::default()
|
||||
})),
|
||||
];
|
||||
|
||||
let imaginate_server_hostname = vec![
|
||||
WidgetHolder::new(Widget::TextLabel(TextLabel {
|
||||
value: "Imaginate".into(),
|
||||
@@ -107,6 +136,7 @@ impl PreferencesDialogMessageHandler {
|
||||
..Default::default()
|
||||
}))],
|
||||
},
|
||||
LayoutGroup::Row { widgets: zoom_with_scroll },
|
||||
LayoutGroup::Row { widgets: imaginate_server_hostname },
|
||||
LayoutGroup::Row { widgets: imaginate_refresh_frequency },
|
||||
LayoutGroup::Row { widgets: button_widgets },
|
||||
|
||||
Reference in New Issue
Block a user