@effindomv2/fui-rs 0.1.22 → 0.1.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/Cargo.toml +1 -1
  2. package/README.md +12 -0
  3. package/package.json +1 -1
  4. package/src/controls/anti_selection_area.rs +0 -18
  5. package/src/controls/button.rs +14 -42
  6. package/src/controls/checkbox.rs +7 -0
  7. package/src/controls/combobox.rs +7 -6
  8. package/src/controls/context_menu.rs +38 -5
  9. package/src/controls/dialog.rs +41 -3
  10. package/src/controls/dropdown.rs +2 -2
  11. package/src/controls/form.rs +16 -20
  12. package/src/controls/internal/button_presenter.rs +5 -5
  13. package/src/controls/internal/checkbox_indicator_presenter.rs +1 -1
  14. package/src/controls/internal/pressable_labeled_control.rs +21 -7
  15. package/src/controls/internal/selectable_popup_list.rs +2 -2
  16. package/src/controls/internal/text_input_core.rs +38 -68
  17. package/src/controls/internal/text_input_presenter.rs +4 -4
  18. package/src/controls/mod.rs +11 -4
  19. package/src/controls/popup.rs +35 -20
  20. package/src/controls/radio_button.rs +7 -0
  21. package/src/controls/radio_group.rs +17 -0
  22. package/src/controls/selection_area.rs +0 -18
  23. package/src/controls/shared.rs +2 -17
  24. package/src/controls/switch.rs +7 -0
  25. package/src/controls/tests.rs +230 -6
  26. package/src/controls/text_area.rs +28 -142
  27. package/src/controls/text_editor_surface.rs +167 -0
  28. package/src/controls/text_input.rs +30 -144
  29. package/src/lib.rs +26 -20
  30. package/src/mobile_text_selection_toolbar.rs +2 -2
  31. package/src/node/core.rs +451 -60
  32. package/src/node/custom_drawable.rs +20 -0
  33. package/src/node/flex_box.rs +39 -47
  34. package/src/node/grid.rs +43 -128
  35. package/src/node/helpers.rs +34 -43
  36. package/src/node/image.rs +47 -56
  37. package/src/node/mod.rs +398 -73
  38. package/src/node/scroll_bar.rs +6 -0
  39. package/src/node/scroll_box.rs +8 -21
  40. package/src/node/scroll_view.rs +144 -13
  41. package/src/node/svg_node.rs +47 -66
  42. package/src/node/text_node.rs +358 -79
  43. package/src/node/virtual_list.rs +17 -0
  44. package/src/popup_presenter.rs +31 -0
  45. package/src/text.rs +59 -0
  46. package/src/text_indices.rs +48 -0
@@ -0,0 +1,167 @@
1
+ use super::internal::text_input_presenter::TextInputTemplate;
2
+ use super::TextInputColors;
3
+ use crate::event::{SelectionChangedEventArgs, TextChangedEventArgs};
4
+ use crate::FontFamily;
5
+ use std::rc::Rc;
6
+
7
+ /// Shared editable-text behavior implemented by [`TextInput`](super::TextInput)
8
+ /// and [`TextArea`](super::TextArea).
9
+ ///
10
+ /// Selection and caret positions use Unicode scalar-value indices. The
11
+ /// explicitly named byte-offset getters expose the corresponding UTF-8 runtime
12
+ /// offsets for diagnostics and low-level interop only.
13
+ pub trait TextEditorSurface: Sized {
14
+ fn text(&self, value: impl Into<String>) -> &Self;
15
+ fn value(&self) -> String;
16
+ fn selection_start(&self) -> u32;
17
+ fn selection_end(&self) -> u32;
18
+ fn selection_start_byte_offset(&self) -> u32;
19
+ fn selection_end_byte_offset(&self) -> u32;
20
+ fn placeholder(&self, value: impl Into<String>) -> &Self;
21
+ fn max_chars(&self, limit: i32) -> &Self;
22
+ fn read_only(&self, flag: bool) -> &Self;
23
+ fn accepts_tab(&self, flag: bool) -> &Self;
24
+ fn selection_range(&self, start: u32, end: u32) -> &Self;
25
+ fn caret(&self, position: u32) -> &Self;
26
+ fn caret_to_end(&self) -> &Self;
27
+ fn colors(&self, colors: TextInputColors) -> &Self;
28
+ fn clear_colors(&self) -> &Self;
29
+ fn template(&self, template: Rc<dyn TextInputTemplate>) -> &Self;
30
+ fn clear_template(&self) -> &Self;
31
+ fn line_height(&self, value: f32) -> &Self;
32
+ fn font_family(&self, family: FontFamily) -> &Self;
33
+ fn font_size(&self, size: f32) -> &Self;
34
+ fn on_changed(&self, handler: impl Fn(TextChangedEventArgs) + 'static) -> &Self;
35
+ fn on_text_changed(&self, handler: impl Fn(TextChangedEventArgs) + 'static) -> &Self;
36
+ fn on_selection_changed(&self, handler: impl Fn(SelectionChangedEventArgs) + 'static) -> &Self;
37
+ }
38
+
39
+ macro_rules! impl_text_editor_surface {
40
+ ($control:ty) => {
41
+ impl crate::controls::TextEditorSurface for $control {
42
+ fn text(&self, value: impl Into<String>) -> &Self {
43
+ self.core.text(value);
44
+ self
45
+ }
46
+
47
+ fn value(&self) -> String {
48
+ self.core.value()
49
+ }
50
+
51
+ fn selection_start(&self) -> u32 {
52
+ self.core.selection_start()
53
+ }
54
+
55
+ fn selection_end(&self) -> u32 {
56
+ self.core.selection_end()
57
+ }
58
+
59
+ fn selection_start_byte_offset(&self) -> u32 {
60
+ self.core.selection_start_byte_offset()
61
+ }
62
+
63
+ fn selection_end_byte_offset(&self) -> u32 {
64
+ self.core.selection_end_byte_offset()
65
+ }
66
+
67
+ fn placeholder(&self, value: impl Into<String>) -> &Self {
68
+ self.core.placeholder(value);
69
+ self
70
+ }
71
+
72
+ fn max_chars(&self, limit: i32) -> &Self {
73
+ self.core.max_chars(limit);
74
+ self
75
+ }
76
+
77
+ fn read_only(&self, flag: bool) -> &Self {
78
+ self.core.read_only(flag);
79
+ self
80
+ }
81
+
82
+ fn accepts_tab(&self, flag: bool) -> &Self {
83
+ self.core.accepts_tab(flag);
84
+ self
85
+ }
86
+
87
+ fn selection_range(&self, start: u32, end: u32) -> &Self {
88
+ self.core.selection_range(start, end);
89
+ self
90
+ }
91
+
92
+ fn caret(&self, position: u32) -> &Self {
93
+ self.core.caret(position);
94
+ self
95
+ }
96
+
97
+ fn caret_to_end(&self) -> &Self {
98
+ self.core.caret_to_end();
99
+ self
100
+ }
101
+
102
+ fn colors(&self, colors: crate::controls::TextInputColors) -> &Self {
103
+ self.core.colors(colors);
104
+ self
105
+ }
106
+
107
+ fn clear_colors(&self) -> &Self {
108
+ self.core.clear_colors();
109
+ self
110
+ }
111
+
112
+ fn template(
113
+ &self,
114
+ template: std::rc::Rc<dyn crate::controls::TextInputTemplate>,
115
+ ) -> &Self {
116
+ self.core.template(template);
117
+ self
118
+ }
119
+
120
+ fn clear_template(&self) -> &Self {
121
+ self.core.clear_template();
122
+ self
123
+ }
124
+
125
+ fn line_height(&self, value: f32) -> &Self {
126
+ self.core.line_height(value);
127
+ self
128
+ }
129
+
130
+ fn font_family(&self, family: crate::FontFamily) -> &Self {
131
+ self.core.font_family(family);
132
+ self
133
+ }
134
+
135
+ fn font_size(&self, size: f32) -> &Self {
136
+ self.core.font_size(size);
137
+ self
138
+ }
139
+
140
+ fn on_changed(
141
+ &self,
142
+ handler: impl Fn(crate::event::TextChangedEventArgs) + 'static,
143
+ ) -> &Self {
144
+ self.core.on_changed(handler);
145
+ self
146
+ }
147
+
148
+ fn on_text_changed(
149
+ &self,
150
+ handler: impl Fn(crate::event::TextChangedEventArgs) + 'static,
151
+ ) -> &Self {
152
+ self.core.on_text_changed(handler);
153
+ self
154
+ }
155
+
156
+ fn on_selection_changed(
157
+ &self,
158
+ handler: impl Fn(crate::event::SelectionChangedEventArgs) + 'static,
159
+ ) -> &Self {
160
+ self.core.on_selection_changed(handler);
161
+ self
162
+ }
163
+ }
164
+ };
165
+ }
166
+
167
+ pub(crate) use impl_text_editor_surface;
@@ -1,9 +1,7 @@
1
1
  use super::internal::text_input_core::TextInputCore;
2
- use super::internal::text_input_presenter::TextInputTemplate;
3
- use super::TextInputColors;
4
- use crate::event::{FocusChangedEventArgs, SelectionChangedEventArgs, TextChangedEventArgs};
5
- use crate::node::{FlexBox, HasFlexBoxRoot, Node, NodeRef, TextCore};
6
- use crate::FontFamily;
2
+ use super::text_editor_surface::impl_text_editor_surface;
3
+ use crate::event::FocusChangedEventArgs;
4
+ use crate::node::{FlexBox, HasFlexBoxRoot, Node, NodeRef, TextNode};
7
5
  use std::any::Any;
8
6
  use std::rc::Rc;
9
7
 
@@ -25,51 +23,6 @@ impl TextInput {
25
23
  Self { core }
26
24
  }
27
25
 
28
- pub fn text(&self, value: impl Into<String>) -> &Self {
29
- self.core.text(value);
30
- self
31
- }
32
-
33
- pub fn value(&self) -> String {
34
- self.core.value()
35
- }
36
-
37
- pub fn selection_start(&self) -> u32 {
38
- self.core.selection_start()
39
- }
40
-
41
- pub fn selection_end(&self) -> u32 {
42
- self.core.selection_end()
43
- }
44
-
45
- pub fn selection_start_byte_offset(&self) -> u32 {
46
- self.core.selection_start_byte_offset()
47
- }
48
-
49
- pub fn selection_end_byte_offset(&self) -> u32 {
50
- self.core.selection_end_byte_offset()
51
- }
52
-
53
- pub fn placeholder(&self, value: impl Into<String>) -> &Self {
54
- self.core.placeholder(value);
55
- self
56
- }
57
-
58
- pub fn max_chars(&self, limit: i32) -> &Self {
59
- self.core.max_chars(limit);
60
- self
61
- }
62
-
63
- pub fn read_only(&self, flag: bool) -> &Self {
64
- self.core.read_only(flag);
65
- self
66
- }
67
-
68
- pub fn accepts_tab(&self, flag: bool) -> &Self {
69
- self.core.accepts_tab(flag);
70
- self
71
- }
72
-
73
26
  pub fn password(&self, flag: bool) -> &Self {
74
27
  self.core.password(flag);
75
28
  self
@@ -85,104 +38,13 @@ impl TextInput {
85
38
  self
86
39
  }
87
40
 
88
- pub fn selection_range(&self, start: u32, end: u32) -> &Self {
89
- self.core.selection_range(start, end);
90
- self
91
- }
92
-
93
- pub fn caret(&self, position: u32) -> &Self {
94
- self.core.caret(position);
95
- self
96
- }
97
-
98
- pub fn caret_to_end(&self) -> &Self {
99
- self.core.caret_to_end();
100
- self
101
- }
102
-
103
- pub fn colors(&self, colors: TextInputColors) -> &Self {
104
- self.core.colors(colors);
105
- self
106
- }
107
-
108
- pub fn clear_colors(&self) -> &Self {
109
- self.core.clear_colors();
110
- self
111
- }
112
-
113
- pub fn template(&self, template: Rc<dyn TextInputTemplate>) -> &Self {
114
- self.core.template(template);
115
- self
116
- }
117
-
118
- pub fn clear_template(&self) -> &Self {
119
- self.core.clear_template();
120
- self
121
- }
122
-
123
- pub fn enabled(&self, enabled: bool) -> &Self {
124
- self.core.enabled(enabled);
125
- self
126
- }
127
-
128
- pub fn focusable(&self, enabled: bool, tab_index: i32) -> &Self {
129
- self.core.focusable(enabled, tab_index);
130
- self
131
- }
132
-
133
- pub fn node_id(&self, id: impl Into<String>) -> &Self {
134
- self.core.node_id(id);
135
- self
136
- }
137
-
138
- pub fn line_height(&self, value: f32) -> &Self {
139
- self.core.line_height(value);
140
- self
141
- }
142
-
143
- pub fn font_family(&self, family: FontFamily) -> &Self {
144
- self.core.font_family(family);
145
- self
146
- }
147
-
148
- pub fn font_size(&self, size: f32) -> &Self {
149
- self.core.font_size(size);
150
- self
151
- }
152
-
153
- pub fn on_changed(&self, handler: impl Fn(TextChangedEventArgs) + 'static) -> &Self {
154
- self.core.on_changed(handler);
155
- self
156
- }
157
-
158
- pub fn on_text_changed(&self, handler: impl Fn(TextChangedEventArgs) + 'static) -> &Self {
159
- self.core.on_text_changed(handler);
160
- self
161
- }
162
-
163
- pub fn on_selection_changed(
164
- &self,
165
- handler: impl Fn(SelectionChangedEventArgs) + 'static,
166
- ) -> &Self {
167
- self.core.on_selection_changed(handler);
168
- self
169
- }
170
-
171
- pub fn on_focus_changed(&self, handler: impl Fn(FocusChangedEventArgs) + 'static) -> &Self {
172
- self.core.on_focus_changed(handler);
173
- self
174
- }
175
-
176
- pub fn focus_now(&self) -> &Self {
177
- self.core.focus_now();
178
- self
179
- }
180
-
181
- pub(crate) fn editor_node(&self) -> TextCore {
41
+ pub(crate) fn editor_node(&self) -> TextNode {
182
42
  self.core.editor_node()
183
43
  }
184
44
  }
185
45
 
46
+ impl_text_editor_surface!(TextInput);
47
+
186
48
  impl HasFlexBoxRoot for TextInput {
187
49
  fn flex_box_root(&self) -> &FlexBox {
188
50
  self.core.flex_box_root()
@@ -205,6 +67,30 @@ impl crate::ThemeBindable for TextInput {
205
67
  }
206
68
 
207
69
  impl Node for TextInput {
70
+ fn apply_node_id(&self, node_id: String) {
71
+ self.core.node_id(node_id);
72
+ }
73
+
74
+ fn apply_semantic_label(&self, label: String) {
75
+ self.core.semantic_label(label);
76
+ }
77
+
78
+ fn apply_focusable(&self, enabled: bool, tab_index: i32) {
79
+ self.core.focusable(enabled, tab_index);
80
+ }
81
+
82
+ fn apply_focus_now(&self) {
83
+ self.core.focus_now();
84
+ }
85
+
86
+ fn apply_enabled(&self, enabled: bool) {
87
+ self.core.enabled(enabled);
88
+ }
89
+
90
+ fn apply_focus_changed_handler(&self, handler: Rc<dyn Fn(FocusChangedEventArgs)>) {
91
+ self.core.set_focus_changed_callback(handler);
92
+ }
93
+
208
94
  fn retained_node_ref(&self) -> NodeRef {
209
95
  let core = self.core.clone();
210
96
  self.core
package/src/lib.rs CHANGED
@@ -43,6 +43,7 @@ pub(crate) mod selection_handle_adorner;
43
43
  #[doc(hidden)]
44
44
  pub mod signal;
45
45
  pub mod text;
46
+ mod text_indices;
46
47
  pub mod theme;
47
48
  pub mod timers;
48
49
  pub mod tool_tip;
@@ -460,7 +461,7 @@ pub mod prelude {
460
461
  text_area, text_input, use_control_templates, AntiSelectionArea, Button, ButtonColors,
461
462
  ButtonPresenter, ButtonTemplate, ButtonVisualState, CheckState, Checkbox,
462
463
  CheckboxChangedEventArgs, CheckboxIndicatorPresenter, CheckboxIndicatorTemplate,
463
- CheckboxIndicatorVisualState, ClickEventArgs, ComboBox, ComboBoxChangedEventArgs,
464
+ CheckboxIndicatorVisualState, Clickable, ClickEventArgs, ComboBox, ComboBoxChangedEventArgs,
464
465
  ComboBoxCommitMode, ComboBoxFilterMode, ComboBoxItem, ContextMenu, ContextMenuAction,
465
466
  ContextMenuAppearance, ContextMenuItemAppearance, ContextMenuVisibilityChangedEventArgs,
466
467
  ControlTemplateSet, DefaultButtonTemplate, DefaultCheckboxIndicatorTemplate,
@@ -481,8 +482,8 @@ pub mod prelude {
481
482
  Slider, SliderChangedEventArgs, SliderColors, SliderPresenter, SliderPresenterMetrics,
482
483
  SliderSizing, SliderTemplate, SliderVisualState, SurfaceAppearance, Switch,
483
484
  SwitchChangedEventArgs, SwitchIndicatorPresenter, SwitchIndicatorTemplate,
484
- SwitchIndicatorVisualState, TextArea, TextInput, TextInputColors, TextInputPresenter,
485
- TextInputTemplate, TextInputVisualState, DEFAULT_BUTTON_TEMPLATE,
485
+ SwitchIndicatorVisualState, TextArea, TextEditorSurface, TextInput, TextInputColors,
486
+ TextInputPresenter, TextInputTemplate, TextInputVisualState, DEFAULT_BUTTON_TEMPLATE,
486
487
  DEFAULT_CHECKBOX_INDICATOR_TEMPLATE, DEFAULT_DROPDOWN_CHEVRON_TEMPLATE,
487
488
  DEFAULT_DROPDOWN_FIELD_TEMPLATE, DEFAULT_DROPDOWN_OPTION_ROW_TEMPLATE,
488
489
  DEFAULT_RADIO_INDICATOR_TEMPLATE, DEFAULT_SLIDER_TEMPLATE,
@@ -527,11 +528,14 @@ pub mod prelude {
527
528
  pub use crate::node::{
528
529
  auto, column, custom_drawable, fill, flex_box, grid, image, pct, portal, px, row,
529
530
  scroll_box, scroll_view, svg, text, viewport_height, viewport_width, virtual_list, Border,
530
- Child, ContextMenuEventArgs, Corners, CustomDrawable, DrawableInvalidator, EdgeInsets,
531
- FlexBox, FlexBoxSurface, GradientStop, Grid, GridTrack, HasFlexBoxRoot, HasTextNode, Image,
532
- ImageNode, Length, Node, PresenterHostStyle, ScrollBar, ScrollBarStyle,
533
- ScrollBarVisibility, ScrollBox, ScrollState, ScrollView, Shadow, Svg, SvgNode, Text,
534
- TextCore, TextLayoutSurface, TextNode, ThemeBindable, VirtualList,
531
+ BoxStyleSurface, Child, ChildContainerSurface, ContextMenuEventArgs, Corners,
532
+ CustomDrawable, DrawableInvalidator, EdgeInsets, FlexBox, FlexBoxSurface,
533
+ FlexLayoutSurface, GradientStop, Grid, GridTrack, HasFlexBoxRoot, HasTextNode, Image,
534
+ ImageNode, LayoutSurface, Length, Node, Portal, PresenterHostStyle, ScrollBar,
535
+ ScrollBarStyle, ScrollBarVisibility, ScrollBox, ScrollState, ScrollView, Shadow, Svg,
536
+ SvgNode, Text, TextContentSurface, TextEditingSurface, TextEventSurface, TextLayoutSurface,
537
+ TextNode, TextSelectionSurface, TextSurface, TextTypographySurface, ThemeBindable,
538
+ VirtualList,
535
539
  };
536
540
  pub use crate::persisted;
537
541
  pub use crate::platform;
@@ -606,12 +610,12 @@ pub use controls::{
606
610
  RadioIndicatorVisualState, SelectionArea, Slider, SliderChangedEventArgs, SliderColors,
607
611
  SliderPresenter, SliderPresenterMetrics, SliderSizing, SliderTemplate, SliderVisualState,
608
612
  SurfaceAppearance, Switch, SwitchChangedEventArgs, SwitchIndicatorPresenter,
609
- SwitchIndicatorTemplate, SwitchIndicatorVisualState, TextArea, TextInput, TextInputColors,
610
- TextInputPresenter, TextInputTemplate, TextInputVisualState, DEFAULT_BUTTON_TEMPLATE,
611
- DEFAULT_CHECKBOX_INDICATOR_TEMPLATE, DEFAULT_DROPDOWN_CHEVRON_TEMPLATE,
612
- DEFAULT_DROPDOWN_FIELD_TEMPLATE, DEFAULT_DROPDOWN_OPTION_ROW_TEMPLATE,
613
- DEFAULT_RADIO_INDICATOR_TEMPLATE, DEFAULT_SLIDER_TEMPLATE, DEFAULT_SWITCH_INDICATOR_TEMPLATE,
614
- DEFAULT_TEXT_INPUT_TEMPLATE,
613
+ SwitchIndicatorTemplate, SwitchIndicatorVisualState, TextArea, TextEditorSurface, TextInput,
614
+ TextInputColors, TextInputPresenter, TextInputTemplate, TextInputVisualState,
615
+ DEFAULT_BUTTON_TEMPLATE, DEFAULT_CHECKBOX_INDICATOR_TEMPLATE,
616
+ DEFAULT_DROPDOWN_CHEVRON_TEMPLATE, DEFAULT_DROPDOWN_FIELD_TEMPLATE,
617
+ DEFAULT_DROPDOWN_OPTION_ROW_TEMPLATE, DEFAULT_RADIO_INDICATOR_TEMPLATE,
618
+ DEFAULT_SLIDER_TEMPLATE, DEFAULT_SWITCH_INDICATOR_TEMPLATE, DEFAULT_TEXT_INPUT_TEMPLATE,
615
619
  };
616
620
  pub use debug::*;
617
621
  pub use drag_drop::{
@@ -647,12 +651,14 @@ pub use logger::*;
647
651
  pub use navigation::*;
648
652
  pub use node::{
649
653
  auto, column, custom_drawable, fill, flex_box, grid, image, pct, portal, px, row, scroll_box,
650
- scroll_view, svg, text, viewport_height, viewport_width, virtual_list, Border, Child,
651
- ContextMenuEventArgs, Corners, CustomDrawable, DrawableInvalidator, EdgeInsets, FlexBox,
652
- FlexBoxSurface, GradientStop, Grid, GridTrack, HasFlexBoxRoot, HasTextNode, Image, ImageNode,
653
- Length, Node, PresenterHostStyle, ScrollBar, ScrollBarStyle, ScrollBarVisibility, ScrollBox,
654
- ScrollState, ScrollView, Shadow, Svg, SvgNode, Text, TextCore, TextLayoutSurface, TextNode,
655
- ThemeBindable, VirtualList,
654
+ scroll_view, svg, text, viewport_height, viewport_width, virtual_list, Border, BoxStyleSurface,
655
+ Child, ChildContainerSurface, ContextMenuEventArgs, Corners, CustomDrawable,
656
+ DrawableInvalidator, EdgeInsets, FlexBox, FlexBoxSurface, FlexLayoutSurface, GradientStop,
657
+ Grid, GridTrack, HasFlexBoxRoot, HasTextNode, Image, ImageNode, LayoutSurface, Length, Node,
658
+ Portal, PresenterHostStyle, ScrollBar, ScrollBarStyle, ScrollBarVisibility, ScrollBox,
659
+ ScrollState, ScrollView, Shadow, Svg, SvgNode, Text, TextContentSurface, TextEditingSurface,
660
+ TextEventSurface, TextLayoutSurface, TextNode, TextSelectionSurface, TextSurface,
661
+ TextTypographySurface, ThemeBindable, VirtualList,
656
662
  };
657
663
  pub use persisted::*;
658
664
  pub use platform::*;
@@ -4,10 +4,10 @@ use crate::ffi::{
4
4
  AlignItems, FlexDirection, JustifyContent, PositionType, SemanticRole, TextOverflow, Unit,
5
5
  Visibility,
6
6
  };
7
- use crate::node::FlexBoxSurface;
8
7
  use crate::node::{
9
8
  flex_box, portal, text, FlexBox, Node, NodeHandle, NodeRef, ScrollBox, TextNode,
10
9
  };
10
+ use crate::node::{ChildContainerSurface, LayoutSurface};
11
11
  use crate::theme::current_theme;
12
12
  use std::cell::RefCell;
13
13
 
@@ -121,7 +121,7 @@ impl ToolbarButton {
121
121
  activate_toolbar_slot(slot);
122
122
  event.handled = true;
123
123
  })
124
- .on_click(move |_| activate_toolbar_slot(slot));
124
+ .on_pointer_click(move |_| activate_toolbar_slot(slot));
125
125
  append_child_ref(&root, &child_node);
126
126
  Self {
127
127
  root,