pub struct TimePickerState { /* private fields */ }Expand description
A time picker’s state. Create it with cx.new and hand it to
TimePicker.
Implementations§
Source§impl TimePickerState
impl TimePickerState
pub fn new( labels: TimePickerLabels, time: NaiveTime, window: &mut Window, cx: &mut Context<'_, Self>, ) -> Self
Sourcepub fn format(
self,
format: TimeFormat,
window: &mut Window,
cx: &mut Context<'_, Self>,
) -> Self
pub fn format( self, format: TimeFormat, window: &mut Window, cx: &mut Context<'_, Self>, ) -> Self
Use the 24-hour clock.
pub fn input_mode(self) -> Self
Sourcepub fn seconds(
self,
label: impl Into<SharedString>,
window: &mut Window,
cx: &mut Context<'_, Self>,
) -> Self
pub fn seconds( self, label: impl Into<SharedString>, window: &mut Window, cx: &mut Context<'_, Self>, ) -> Self
Show seconds: a third selector (named label), a seconds dial unit
and a seconds input segment.
Sourcepub fn minute_step(self, step: u32) -> Self
pub fn minute_step(self, step: u32) -> Self
Snap the dial and its arrow keys to every step minutes (e.g. 5 or
15; 0 and 1 mean every minute).
Sourcepub fn limits(
self,
earliest: NaiveTime,
latest: NaiveTime,
window: &mut Window,
cx: &mut Context<'_, Self>,
) -> Self
pub fn limits( self, earliest: NaiveTime, latest: NaiveTime, window: &mut Window, cx: &mut Context<'_, Self>, ) -> Self
Only times from earliest to latest can be chosen; the current
time moves inside them.
pub fn unit(self, unit: TimeUnit) -> Self
pub fn labels(&self) -> &TimePickerLabels
pub fn time(&self) -> NaiveTime
pub fn current_format(&self) -> TimeFormat
pub fn mode(&self) -> TimeInputMode
pub fn current_unit(&self) -> TimeUnit
pub fn shows_seconds(&self) -> bool
pub fn current_minute_step(&self) -> u32
pub fn current_limits(&self) -> Option<(NaiveTime, NaiveTime)>
pub fn dial_focus(&self) -> &FocusHandle
pub fn set_format( &mut self, format: TimeFormat, window: &mut Window, cx: &mut Context<'_, Self>, )
Sourcepub fn set_time(
&mut self,
time: NaiveTime,
window: &mut Window,
cx: &mut Context<'_, Self>,
)
pub fn set_time( &mut self, time: NaiveTime, window: &mut Window, cx: &mut Context<'_, Self>, )
Set the time as a person would, emitting TimePickerEvent::Change.
Sourcepub fn set_pm(
&mut self,
pm: bool,
window: &mut Window,
cx: &mut Context<'_, Self>,
)
pub fn set_pm( &mut self, pm: bool, window: &mut Window, cx: &mut Context<'_, Self>, )
AM (false) or PM (true).
pub fn toggle_mode(&mut self, window: &mut Window, cx: &mut Context<'_, Self>)
Trait Implementations§
impl EventEmitter<TimePickerEvent> for TimePickerState
Auto Trait Implementations§
impl !RefUnwindSafe for TimePickerState
impl !Send for TimePickerState
impl !Sync for TimePickerState
impl !UnwindSafe for TimePickerState
impl Freeze for TimePickerState
impl Unpin for TimePickerState
impl UnsafeUnpin for TimePickerState
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more