Expand description
TimeEdit — text input for time-of-day, bound to Signal<Option<Time>>.
Single-line editable time field with strftime-pattern parse/format
and optional 12h/24h mode + AM/PM. Same compositional pattern as
DateEdit (TextInputField + commit on
Enter/blur + step keys), without a popover (desktop convention is no
graphical time picker).
§Behaviour
- Value binding:
Signal<Option<Time>>—Noneshows the placeholder. - Pattern: 24h default
%H:%M; 12h is%I:%M %p. Override viaformat_pattern. Add seconds withseconds(SecondsMode::Editable). - Keyboard (preview-pass on the wrapper): the step is
segment-relative — it moves the field under the caret (hour,
minute, second or AM/PM), which is what
QDateTimeEditdoes.- Arrow Up / Down → ±1 unit of that segment; Shift+ → ±10.
- PageUp / PageDown → ±10 units; Shift+ → ±100.
- Hours wrap within the day and minutes and seconds within the hour and minute, so a sweep never rolls the value over.
§Accessibility
- Container —
Role::TimeInputwithset_valueformatted asHH:MM:SSandset_labelfrom.label(). - Underlying TextInputField keeps
Role::TextInputso AT knows it’s editable. It is where focus lands, so it carries the same name (the.label(), or “Time”), and it is the composite’saccessibility_proxy: what an application gives theTimeEdit(access_label,access_described_by) lands on the field. As onDateEdit, the field’s own name is read before alabelled_byrelation, so name a time field in a form with.label().
ⓘ
use teksilo_core::signal::Signal;
use teksilo_widgets::time_edit::{TimeEdit, TimeFormat, SecondsMode};
let value = Signal::new(None);
let _field = TimeEdit::new(value)
.format(TimeFormat::Hour24)
.seconds(SecondsMode::Hidden);§Touch and pen
See DateEdit’s “Touch and pen” section: the whole
date/time family carries focus_within and on_key_preview only, and its
pointer surface is the embedded field, the trigger button and the popover.
Structs§
- Time
Edit - Single-line editable time-of-day field.
Enums§
- Seconds
Mode - Whether the seconds segment is shown in
TimeEdit. - Time
Format - 12h vs 24h time formatting.