diff --git a/crates/openpencil-shell-core/src/widgets/property_panel.rs b/crates/openpencil-shell-core/src/widgets/property_panel.rs index ced8eccd2..5323bb31e 100644 --- a/crates/openpencil-shell-core/src/widgets/property_panel.rs +++ b/crates/openpencil-shell-core/src/widgets/property_panel.rs @@ -53,6 +53,9 @@ pub enum PropertyPanelAction { /// User clicked anywhere in the Export section — host queues /// `FileAction::ExportImage` so the picker dialog opens. OpenExportDialog, + /// User clicked the Effects section's "+" — host appends a + /// default drop shadow to the selected node. + AddEffect, } /// Per-NodeKind toggles for which property-panel sections render. diff --git a/crates/openpencil-shell-core/src/widgets/property_panel_layout.rs b/crates/openpencil-shell-core/src/widgets/property_panel_layout.rs index 6c34c4c5b..c629db2ee 100644 --- a/crates/openpencil-shell-core/src/widgets/property_panel_layout.rs +++ b/crates/openpencil-shell-core/src/widgets/property_panel_layout.rs @@ -241,6 +241,14 @@ pub fn action_button_rects_with_fill_picker( } if visible.effects { // Mirrors paint_effects_section: header + 8 px filler. + // The header's "+" button (drawn by + // `paint_section_label_with_add` at the right edge) maps to + // an `AddEffect` action. + let plus = Rect { + origin: Point2D::new(x0 + w - PAD_X - 22.0, y), + size: Point2D::new(28.0, SECTION_HEADER_HEIGHT), + }; + out.push((PropertyPanelAction::AddEffect, plus)); y += SECTION_HEADER_HEIGHT; y += 8.0; y += SECTION_GAP; diff --git a/crates/openpencil-shell-native/src/widget_host/property_dispatch.rs b/crates/openpencil-shell-native/src/widget_host/property_dispatch.rs index 80a190cde..ec2a29f86 100644 --- a/crates/openpencil-shell-native/src/widget_host/property_dispatch.rs +++ b/crates/openpencil-shell-native/src/widget_host/property_dispatch.rs @@ -46,6 +46,9 @@ impl WidgetHostNative { self.document.ui.pending_file_action = Some(openpencil_shell_core::document::FileAction::ExportImage); } + A::AddEffect => { + self.document.add_drop_shadow_to_selected(); + } } } diff --git a/crates/openpencil-shell-web/src/widget_host.rs b/crates/openpencil-shell-web/src/widget_host.rs index 4fe73e6af..afeca0d82 100644 --- a/crates/openpencil-shell-web/src/widget_host.rs +++ b/crates/openpencil-shell-web/src/widget_host.rs @@ -174,6 +174,9 @@ fn apply_property_action_impl( A::OpenColorPicker(target) => { let _ = document.open_color_picker(target, 0.0); } + A::AddEffect => { + document.add_drop_shadow_to_selected(); + } } }