feat(props): select whole value when a property field is clicked

Clicking an editable property value field now selects its entire value instead
of only placing the caret, so typing immediately replaces it. The click is
observed through a global left-press subscription (PropPointerPressed); a focus
sweep reports which widget took focus and PropSyncActive maps it back to the
active property row, then issues a select-all operation only when focus landed
on a different field.

The active row stays highlighted while its text input holds keyboard focus and
clears when focus moves elsewhere.
This commit is contained in:
Karim Jerbi committed 2026-08-14 21:21:40 +01:00
1 parent dceb9626ae
commit 9f68034a60
6 files changed
+336 -18

No files matched your search

+11
View File
@@ -2362,6 +2362,17 @@ pub enum Message {
PropAttrInput { tag: String, value: String },
/// User committed a block-attribute value edit (Enter pressed).
PropAttrCommit(String),
/// Reports the currently keyboard-focused widget (if any) after a
/// [`sync_active_field_task`](crate::ui::properties::sync_active_field_task)
/// sweep, so the update handler can keep the active-row marker reconciled
/// against real focus instead of pointer hover.
PropSyncActive(Option<iced::widget::Id>),
/// A left mouse button was pressed anywhere. The clicked widget has already
/// been given focus by the time this arrives (the widget tree processes the
/// event before the runtime broadcasts it to subscriptions), so a focus
/// sweep — which resolves as `PropSyncActive` — reveals whether a property
/// value field was clicked and can select its whole value.
PropPointerPressed,
/// Toggle the inline color picker dropdown open/closed.
PropColorPickerToggle,
/// Toggle the MTEXT background-colour picker dropdown open/closed.