Commit graph

97 commits

Author SHA1 Message Date
675f3b59e3 chore: reduce local stack warnings 2026-05-23 20:55:59 +02:00
4743bb8ec9 yoda: cargo clippy --fix on libcosmic-yoda (115→33 warnings)
Auto-applied clippy lint suggestions across 23 files: collapse
`else { if … }` ladders, drop unneeded `return` statements, remove
needless borrows that were immediately auto-dereffed, swap `iter().next()`
for `first()`, drop redundant `.into()` to the same type, and similar
mechanical cleanups. Behavior is unchanged; the diff is -67 lines net.

The 33 remaining warnings are architectural and need manual attention
(very-complex-type aliases, too-many-arguments on internal helpers,
redundant must_use, needs-is_empty, etc.).

Leyoda 2026 – GPLv3
2026-05-05 19:10:03 +02:00
84437e219b yoda: libcosmic-yoda dead-code purge (14→0 warnings)
Real bug fixes:
- spin_button::vertical(): was constructing the SpinButton with
  Orientation::Horizontal — vertical() rendered horizontally. Fixed
  to use Orientation::Vertical, which also resolves the
  'Vertical never constructed' warning.
- text_input/input.rs: rewrite the iterator-skip logic for trailing
  icon layout. The previous `let mut icon_layout = ...; if has_start
  ... = ...; ... = ...;` triggered two value-never-read warnings and
  obscured the intent. Now it reads as 'skip text, optionally skip
  start-icon, then take the trailing-icon layout'.

Dead code removed:
- core::Core::portal_is_high_contrast — assigned at construction,
  never read anywhere
- widget::menu::menu_bar::bar_pressed field and the
  pub fn get_mut_or_default helper — no callers
- widget::popover::State — declared, never constructed
- widget::segmented_button::widget::Focus.now — sibling of updated_at,
  never read
- widget::wayland::tooltip::widget::Variant — orphan enum (and the
  cargo fix follow-up dropped a now-unused Element import)
- widget::button::widget::Button::is_hovered method — trivial getter
  with no callers; the underlying `is_hovered` field is still used

Visibility / nits:
- segmented_button::widget::TabDragSource: gain pub(super) so the
  pub(super) field tab_drag stops exposing a more private type
- widget::menu::flex::resolve: #[allow(dead_code)] (170-line public
  helper, kept for future use)
- app/cosmic.rs: drop one unreachable arm in the surface-message match
- widget::dropdown::multi: drop unused Paragraph import

Leyoda 2026 – GPLv3
2026-05-05 19:02:31 +02:00
cdf349385b yoda: cargo fix --lib (libcosmic-yoda) — drop 99 trivial warnings
Auto-applied suggestions on libcosmic-yoda lib only: unused imports,
unused-by-name params (prefixed with _), redundant mutability. From 113
warnings down to 14 (the 14 remaining are real signals: never-read
fields, unreachable patterns, etc., to be reviewed manually).

Leyoda 2026 – GPLv3
2026-05-05 16:27:29 +02:00
Ashley Wulber
a44cff8011 fix(text_input): always clip input text with the text bounds
this issue seems unique to tiny-skia
2026-04-08 17:05:40 +02:00
Hojjat
724351727a feat: select until char and double click select delimiter
adds a feature to select from the start of the sentence until the last
occurrence of a character. This can be used to select until the
extension in cosmic-files save dialog or rename pop up.

Also, it adds a feature to select until the last occurrence of a
character on double-click.
2026-04-07 13:35:26 +02:00
KENZ
8e3672a7dd fix: focus detecting in IME logic 2026-04-06 15:59:18 +02:00
KENZ
f6eb314606
feat(text_input): minimal IME support for COSMIC specific text widgets 2026-04-02 00:35:57 +02:00
Hojjat
aef328238f fix(editable): the UX is closer to design now
This fixes the unresponsive trailing icon and changes the behavior to be
closer to the UI/UX design.
2026-04-01 23:29:26 +02:00
Hojjat
e1738d2ea7 fix(text_input): keyboard shortcuts when keyboard is a different language
Matches what Iced does
2026-04-01 23:26:42 +02:00
Hojjat
2299fba69b fix(text_input): RTL text cursor and highlight fixes 2026-04-01 23:26:42 +02:00
Ashley Wulber
413e63f62a chore: update features and feature gates 2026-03-30 22:25:27 -04:00
Ítalo Dell Areti
380b341bdc feat(text_input): add select_range method and Task function 2026-03-28 00:09:34 -04:00
Ashley Wulber
0e1a9d46eb chore: update iced & cleanup text input 2026-03-04 12:04:33 -05:00
Ashley Wulber
e10459fb37 wip rebase updates 2026-03-04 12:04:32 -05:00
Hojjat Abdollahi
b9bd773940
feat: ellipsize text (#1132) 2026-02-19 10:06:45 -07:00
Ashley Wulber
a1b64dde3e fix(input): handle ctrl shortcuts with caps lock 2025-10-27 13:22:05 -04:00
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