Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions editor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ interpreted-executor = { workspace = true }
graphene-std = { workspace = true } # NOTE: `core-types` should not be added here because `graphene-std` re-exports its contents
preprocessor = { workspace = true }
math-parser = { workspace = true }
ipsum = { workspace = true }

# Workspace dependencies
js-sys = { workspace = true }
Expand Down Expand Up @@ -52,6 +53,7 @@ color = { workspace = true }
zip = { workspace = true }
reqwest = { workspace = true }
url = { workspace = true }
rand = { workspace = true }

# Optional local dependencies
wgpu-executor = { workspace = true, optional = true }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,30 @@ impl PreferencesDialogMessageHandler {
selection_mode,
];

rows.extend_from_slice(&[header, selection_label, selection_mode]);
let checkbox_id = CheckboxId::new();
let lorem_ipsum_description = "
Fill newly created text boxes with placeholder 'Lorem ipsum' text.\n\
\n\
*Default: On.*
"
.trim();
let lorem_ipsum_placeholder = vec![
Separator::new(SeparatorStyle::Unrelated).widget_instance(),
Separator::new(SeparatorStyle::Unrelated).widget_instance(),
CheckboxInput::new(preferences.lorem_ipsum_placeholder)
.tooltip_label("Lorem Ipsum Placeholder")
.tooltip_description(lorem_ipsum_description)
.on_update(|checkbox_input: &CheckboxInput| PreferencesMessage::LoremIpsumPlaceholder { enabled: checkbox_input.checked }.into())
.for_label(checkbox_id)
.widget_instance(),
TextLabel::new("Lorem Ipsum Placeholder")
.tooltip_label("Lorem Ipsum Placeholder")
.tooltip_description(lorem_ipsum_description)
.for_checkbox(checkbox_id)
.widget_instance(),
];

rows.extend_from_slice(&[header, selection_label, selection_mode, lorem_ipsum_placeholder]);
}

// =========
Expand Down
1 change: 1 addition & 0 deletions editor/src/messages/frontend/frontend_message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ pub enum FrontendMessage {
},
DisplayEditableTextbox {
text: String,
editable: bool,
#[serde(rename = "lineHeightRatio")]
line_height_ratio: f64,
#[serde(rename = "fontSize")]
Expand Down
3 changes: 3 additions & 0 deletions editor/src/messages/preferences/preferences_message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ pub enum PreferencesMessage {
BrushTool {
enabled: bool,
},
LoremIpsumPlaceholder {
enabled: bool,
},
ModifyLayout {
zoom_with_scroll: bool,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ pub struct PreferencesMessageHandler {
pub selection_mode: SelectionMode,
pub zoom_with_scroll: bool,
pub brush_tool: bool,
pub lorem_ipsum_placeholder: bool,
pub graph_wire_style: GraphWireStyle,
pub viewport_zoom_wheel_rate: f64,
pub ui_scale: f64,
Expand Down Expand Up @@ -64,6 +65,7 @@ impl Default for PreferencesMessageHandler {
selection_mode: SelectionMode::Touched,
zoom_with_scroll: matches!(MappingVariant::default(), MappingVariant::ZoomWithScroll),
brush_tool: false,
lorem_ipsum_placeholder: true,
graph_wire_style: GraphWireStyle::default(),
viewport_zoom_wheel_rate: VIEWPORT_ZOOM_WHEEL_RATE,
ui_scale: UI_SCALE_DEFAULT,
Expand Down Expand Up @@ -110,6 +112,9 @@ impl MessageHandler<PreferencesMessage, PreferencesMessageContext<'_>> for Prefe

responses.add(ToolMessage::RefreshToolShelf);
}
PreferencesMessage::LoremIpsumPlaceholder { enabled } => {
self.lorem_ipsum_placeholder = enabled;
}
PreferencesMessage::ModifyLayout { zoom_with_scroll } => {
self.zoom_with_scroll = zoom_with_scroll;

Expand Down
Loading
Loading