Commit graph

80 commits

Author SHA1 Message Date
Cheong Lau
bd438a8581 perf: reduce memory allocations
This also changes `widget::column::with_children` and
`widget::row::with_children` to take an `impl IntoIterator` instead
of a `Vec`, like the `iced` variants of these functions do.

This shouldn't be a breaking change since passing in a `Vec` will still
compile and function exactly as before.

(Using `iced::widget::Column::from_vec` or
`iced::widget::Row::from_vec` isn't possible, since the elements of the
`Vec` aren't checked, so the size of the resulting `Column` or `Row`
won't adapt to the size of its children. Perhaps a new function could
be added to mirror `iced`'s?)
2025-10-22 04:30:57 +02:00
Ashley Wulber
529eeebaeb fix: avoid focus effects if already focused 2025-10-20 11:58:40 -04:00
Ashley Wulber
f17cd2928a fix: forward events to trailing element regardless of cursor position 2025-10-09 05:28:10 +02:00
Ashley Wulber
dc4e0edd73 fix(input): drag threshold 2025-10-07 19:43:26 +02:00
Cheong Lau
a27bb5e05d chore: apply clippy suggestions 2025-10-05 04:40:51 +02:00
Ashley Wulber
9ff208e9d7 fix: if editable input is focused by operation, emit a message 2025-09-17 22:27:37 +02:00
Ashley Wulber
0e797b2440 improv(input): better initial handling of focus state 2025-09-16 00:27:25 +02:00
Ashley Wulber
989fcad99e fix(input): reset cursor and last click state on unfocus 2025-08-12 17:54:47 +02:00
Michael Aaron Murphy
3f4a50ee2c
chore: remove eprintln logs 2025-06-11 11:49:32 +02:00
Ashley Wulber
ce56237ab9 fix(dnd): leave event handlers should expect None as the drag Id 2025-05-22 17:18:56 +02:00
Ashley Wulber
c8c650c041 fix: text input RTL panic
RTL text will want to alight to the right, and will try to use all of an unbounded width in the input. It also tends to be offset in a negative direction.
2025-05-06 14:21:19 -04:00
Ashley Wulber
924a9ff371 fix(input): don't ignore typing for managed inputs 2025-04-11 18:18:37 +02:00
Michael Aaron Murphy
f16bc4a764
fix(text_input): Backspace key ignored 2025-03-27 16:38:28 +01:00
Michael Aaron Murphy
0eb86850ce fix(text_input): support numpad keys 2025-03-27 16:33:23 +01:00
Michael Aaron Murphy
c0b0b817e8 fix(text_input): send on_unfocus message where they were missing 2025-03-26 16:42:50 +01:00
Michael Aaron Murphy
ae5bb40d6e
fix(text_input): conflicts with keyboard focus navigation 2025-03-24 03:37:14 +01:00
Michael Aaron Murphy
0aa518984e
chore: format for 2024 edition 2025-03-21 13:33:07 +01:00
Michael Aaron Murphy
c538d672df
improv(text_input): optimize, fix, and improve the text inputs 2025-03-21 13:21:57 +01:00
Michael Aaron Murphy
b2b6d90fb6 fix(text_input): fixing multiple issues 2025-03-18 16:56:01 +01:00
Ashley Wulber
337b80d4ca
feat: Tooltips and Better Surface Management 2025-03-14 16:56:21 +01:00
Michael Aaron Murphy
1914006cdd
fix(text_input): compiler errors after Cow change 2025-01-16 06:38:08 +01:00
Soso
90c5c84cce
improv(text_input): use Cow<str> for label, helper, and error text 2025-01-16 06:29:03 +01:00
Ian Douglas Scott
af9e353f50 dnd_source: Add suppport for surface offset
The `drag_icon` callback is passed the offset of the cursor within the
widget at the start of the drag, and can return an offset the drag
surface should be placed relative to the cursor.
2025-01-13 10:44:33 -07:00
Jason Rodney Hansen
aaa2ba3ad4 Fix entering text with compose key
Previously entering text in text inputs with the compose key would insert one
or more NUL bytes before the inserted character.
2025-01-05 17:51:44 -07:00
Ashley Wulber
931165050d
chore: update iced 2024-12-03 05:13:27 +01:00
Ashley Wulber
953685a882 fix(input): fallback on text layout for dnd 2024-10-21 15:59:32 -06:00
Ashley Wulber
533e099cf6 fix: text input icon render 2024-10-21 15:46:55 +02:00
Ashley Wulber
0491c4baaa libcosmic updates 2024-10-18 14:04:39 -04:00
Vukašin Vojinović
e645dee2f0 fix(header_bar): increase compact height
Increases Compact header height to 40 (from 36), to better accommodate larger widgets (e.g. the search bar). This makes it distinct from the SSD header, which is now addressed by the `_` match case.
Also makes the horizontal header padding fixed at 8, so that the app window padding can also be 8.
2024-10-03 15:39:00 +02:00
Vukašin Vojinović
9bfb159977 fix(text_input): make icon padding fixed
This prevents the icons from becoming too large or too small relative to the input box, that leads to visual issues.
2024-09-23 12:40:22 -04:00
Michael Aaron Murphy
f12de010ec fix!(widget): rename button function to button::custom 2024-09-16 11:36:42 -06:00
Ashley Wulber
8ba2185f43 fix: reset text_input focus when clicked outside 2024-08-28 22:50:33 +02:00
Jason Hansen
84afe7b50a
improv(text_input): Switch icon when toggling visibility of secure input 2024-08-09 20:36:31 +02:00
Michael Aaron Murphy
756f4b6ba6
fix(text_input): prevent simultaneous input focus 2024-08-03 12:33:24 +02:00
Victoria Brekenfeld
b40839638a fix: Use globals instead of thread-locals
Better support for multi-threaded applications,
especially cosmic-comp rendering in parallel on
multiple threads, each potentially accessing
global configurations such as the active theme,
icon_theme and more...
2024-08-02 20:27:08 +02:00
Ashley Wulber
22138671b4 fix: keep the cursor at the end if it previously when diffing 2024-07-29 22:53:55 +02:00
Michael Aaron Murphy
5474232796 fix: widget unfocus on mouse click 2024-07-22 07:05:47 +02:00
Jeremy Soller
c9a2265ab1 Make text wrap configurable 2024-07-09 11:14:49 -06:00
Ashley Wulber
2b7f0c55e1 cleanup: cargo fmt 2024-06-28 09:12:05 -06:00
Michael Aaron Murphy
5c6fa840f4
fix(text_input): set read_only to false when focusing editable_input 2024-06-27 15:48:06 +02:00
Michael Aaron Murphy
ff3e4423f9
feat(text_input): add select_on_focus field 2024-06-27 00:20:05 +02:00
Michael Aaron Murphy
bd84f1f07d
fix(inline_input): wrong colors for focused style 2024-06-20 14:00:25 +02:00
Michael Aaron Murphy
d8cb87cae7
fix(inline_input): add placeholder parameter 2024-06-20 13:45:46 +02:00
Ashley Wulber
33eec39268
fix: border artifacts in button and input 2024-06-15 22:04:42 +02:00
Ashley Wulber
d138232655 text input always_active field & ids 2024-06-13 14:18:46 -04:00
Eduardo Flores
9ce3a51728 fix: text input attempting to subtract with overflow 2024-05-21 06:56:15 -04:00
Ashley Wulber
1ae9dae4cb fix(text_input): the trailing icon should always receive input 2024-05-17 22:28:57 +02:00
Ashley Wulber
11a73354ca fix(text-input): avoid jumping to start of text as cursor blinks, and clipping text inside the input 2024-05-17 01:23:06 +02:00
Ashley Wulber
7a964772c2 cargo fmt 2024-05-01 11:52:07 -06:00
Ian Douglas Scott
2ebf7e8e0a Update text_input widget for iced_sctk drag-and-drop change 2024-04-30 16:17:07 -07:00