Commit graph

340 commits

Author SHA1 Message Date
Héctor Ramón Jiménez
1d23db1866 Track keyboard modifiers in text_input 2020-11-25 04:10:23 +01:00
Zak
d275a4ed32 This PR fixes a bug with select all (CMD + A on MacOS) when using a text_input.
Previous behaviour: when selecting all (CMD + A) would delete the current text inside the input and replace the content with just the letter 'a'.

Now we check if the logo key (modifier key) has been pressed before checking any other key and save it to the state level. This way we can prevent any text being deleted when using the select all shortcut or text being entered at all when a modifier key is pressed (this behaviour matches other text input behaviour i.e text inputs in the browser etc...).
2020-11-25 03:57:18 +01:00
Héctor Ramón Jiménez
140bea352e Disable dragging in TextInput after double click
When using a trackpad, mouse move events may happen between the
press/release events. This was incorrectly triggering selection dragging in
the `TextInput` widget.

Eventually, we should implement proper word-aware selection dragging.
2020-11-19 02:45:47 +01:00
Héctor Ramón Jiménez
c03d46719e Remove Focus in pane_grid
Since #608, the `PaneGrid` widget does not handle pane focus.
2020-11-17 06:13:56 +01:00
Héctor Ramón Jiménez
df712f9ccf Implement flexible TextInput::draw helper 2020-11-17 05:13:06 +01:00
Héctor Ramón Jiménez
bf6c65b5ad Implement event capturing for TextInput 2020-11-12 01:11:09 +01:00
Héctor Ramón Jiménez
c361fe48c7 Implement event capturing for Slider 2020-11-12 00:56:50 +01:00
Héctor Ramón Jiménez
fd275a2fee Implement event capturing for Scrollable 2020-11-12 00:53:39 +01:00
Héctor Ramón Jiménez
451bf8dc84 Implement event capturing for Row 2020-11-12 00:48:40 +01:00
Héctor Ramón Jiménez
18172f80c9 Implement event capturing for Radio 2020-11-12 00:47:58 +01:00
Héctor Ramón Jiménez
7ff95f3a88 Implement event capturing for PickList 2020-11-12 00:47:21 +01:00
Héctor Ramón Jiménez
31c509b206 Implement event capturing for PaneGrid 2020-11-12 00:40:55 +01:00
Héctor Ramón Jiménez
3bcee62beb Implement event capturing for Column 2020-11-12 00:40:52 +01:00
Héctor Ramón Jiménez
04468a7147 Implement event capturing for Checkbox 2020-11-12 00:20:09 +01:00
Héctor Ramón Jiménez
a44cd07212 Implement event capturing for Button 2020-11-12 00:19:12 +01:00
Héctor Ramón Jiménez
3f968b8c87 Make Widget::on_event return an event::Status 2020-11-12 00:09:52 +01:00
Héctor Ramón Jiménez
3b2ed0d6f0 Remove unnecessary move in PaneGrid::new 2020-11-10 03:18:46 +01:00
Héctor Ramón Jiménez
d6d5cf0294 Restore hotkeys in pane_grid example
- Implement `subscription::events_with`
- Remove `pane_grid::KeyPressEvent`
- Return closest sibling in `pane_grid::State::close`
2020-11-10 02:32:57 +01:00
Héctor Ramón Jiménez
c53022e8df Fix typo in documentation of pane_grid::Content 2020-11-10 01:51:27 +01:00
Héctor Ramón Jiménez
8008ea5286 Introduce on_click handler in PaneGrid 2020-11-10 01:48:11 +01:00
Héctor Ramón Jiménez
5681c83d3c Remove focus concept from pane_grid 2020-11-10 01:38:27 +01:00
Héctor Ramón Jiménez
1a2cb2f35b Split focus and unfocus methods in text_input 2020-11-09 20:32:58 +01:00
Paul Delafosse
f7d67598cb Add textinput focus method 2020-11-09 20:32:50 +01:00
Héctor Ramón Jiménez
91b1886968 Fix Widget::draw for Rule 2020-10-28 06:21:07 +01:00
Héctor Ramón Jiménez
d328b07b39 Introduce viewport to Widget::draw
This should eventually allow us to only generate primitives that are
visible.
2020-10-28 06:21:07 +01:00
Héctor Ramón
8a3ce90959
Merge pull request #575 from clarkmoody/scrollable-width
Custom Scrollbar Width
2020-10-27 23:35:52 +01:00
Héctor Ramón Jiménez
d3b04bf892 Introduce Eq requirement to build a PickList 2020-10-24 09:32:23 +02:00
Clark Moody
f05578c8f8 Update scrollbar logic and introduce outer_bounds 2020-10-22 16:05:44 -05:00
Clark Moody
09e67c5c27 Replace hard-coded params with struct members 2020-10-22 14:07:07 -05:00
Héctor Ramón
23647d2f50
Merge pull request #545 from MonliH/master
Remove outdated `Fill` comment for `Column` and `Row`
2020-10-17 21:12:09 +02:00
Jonathan Li
461499dd62 Remove entirely 2020-10-17 10:48:31 -04:00
Héctor Ramón Jiménez
d7a5e54455 Require Clone for Message early when needed
Prior to this change, the widgets that needed a `Clone` bound on `Message` to
implement the `Widget` trait could be created with a non-cloneable `Message`.

As a consequence, the compiler complained only when actually trying to use the
`Widget` trait. Normally, this happens when trying to `push` the widget in a
container or turn it into an `Element`.

Furthermore, the compiler error in this case does not mention `Message` nor the
`Clone` bound, but instead complains about a missing `From` implementation.
Thus, it can easily cause confusion!

This change introduces `Clone` bounds in the main implementation of the
widgets that need it to properly implement the `Widget` trait. As a
result, the compiler complains early when trying to create one of these widgets
with a non-cloneable `Message` and explicitly mentions that the `Message` needs
to implement `Clone`.
2020-10-17 08:10:30 +02:00
Jakub Hlusička
4910e03833 Fix typo in Row's and Column's hash_layout 2020-10-13 20:48:53 +02:00
Jonathan Li
7c24277210 Document better 2020-10-02 21:53:40 -04:00
Jonathan Li
8346209c37 Satify documented behaviour 2020-10-01 17:10:13 -04:00
Héctor Ramón Jiménez
2ce5df0844 Merge branch 'feature/rule-widget' into master 2020-08-22 21:25:06 +02:00
Billy Messenger
8d68c8584e widget Rule added 2020-08-22 21:23:27 +02:00
Héctor Ramón Jiménez
bbc6e91429 Implement hash_layout for pane_grid::TitleBar 2020-08-19 02:03:21 +02:00
Héctor Ramón Jiménez
9ba4cfd23f Add height method to Slider 2020-08-01 08:18:52 +02:00
Héctor Ramón
72cfe85f7f
Merge pull request #463 from mobile-bungalow/titlebar_options
Added `always_show_controls` method to TitleBar
2020-07-31 06:55:55 +02:00
Héctor Ramón Jiménez
ac74f35424 Clarify TitleBar::always_show_controls docs a bit 2020-07-31 06:43:51 +02:00
Héctor Ramón Jiménez
ab0da5dad0 Move always_show_controls after padding 2020-07-31 06:43:27 +02:00
Héctor Ramón Jiménez
174565715e Fix typo in TitleBar::new 2020-07-31 04:23:55 +02:00
Héctor Ramón Jiménez
4ab9992bf8 Unfocus TextInput when Escape key is pressed 2020-07-30 00:52:02 +02:00
Héctor Ramón Jiménez
51c22f2426 Fix Widget::layout for Checkbox 2020-07-28 08:23:44 +02:00
Héctor Ramón Jiménez
5fd239c488 Add custom font support to Checkbox 2020-07-28 08:21:33 +02:00
mobile-bungalow
7977e970ca Added method to TitleBar, allowing controls to be show statically instead of only on mouseover 2020-07-27 01:17:02 -07:00
Héctor Ramón Jiménez
55d2c5886f Introduce state method to TextInput 2020-07-24 19:20:46 +02:00
Héctor Ramón Jiménez
a165eddd75 Avoid PaneGrid unfocus when cursor is unavailable 2020-07-23 04:44:35 +02:00
Héctor Ramón Jiménez
a225a218e0 Fix Default implementation for pick_list::State 2020-07-23 04:06:26 +02:00