pub struct Button {
core: Core,
window: Option<Sender<()>>,
unread: bool,
}Expand description
The button in the panel. See the module docs.
Fields§
§core: Core§window: Option<Sender<()>>The way to the window, once there is one.
unread: boolWhether the window said there is something not looked at.
Trait Implementations§
Source§impl Application for Button
impl Application for Button
Source§fn view(&self) -> Element<'_, Self::Message>
fn view(&self) -> Element<'_, Self::Message>
The app icon, sized and padded as the panel asks, with a dot over its corner while there is something not looked at. The dot takes no room: the button is the same size with it and without.
Source§const APP_ID: &'static str = crate::app::APP_ID
const APP_ID: &'static str = crate::app::APP_ID
An ID that uniquely identifies the application.
The standard is to pick an ID based on a reverse-domain name notation.
IE:
com.system76.SettingsSource§fn init(core: Core, _flags: Self::Flags) -> (Self, Task<Action<Self::Message>>)
fn init(core: Core, _flags: Self::Flags) -> (Self, Task<Action<Self::Message>>)
Creates the application, and optionally emits task on initialize.
Source§fn update(&mut self, message: Self::Message) -> Task<Action<Self::Message>>
fn update(&mut self, message: Self::Message) -> Task<Action<Self::Message>>
Respond to an application-specific message.
Source§fn subscription(&self) -> Subscription<Self::Message>
fn subscription(&self) -> Subscription<Self::Message>
Event sources that are to be listened to.
§fn context_drawer(&self) -> Option<ContextDrawer<'_, Self::Message>>
fn context_drawer(&self) -> Option<ContextDrawer<'_, Self::Message>>
Displays a context drawer on the side of the application window when
Some.
Use the [ApplicationExt::set_show_context] function for this to take effect.§fn dialog(
&self,
) -> Option<Element<'_, Self::Message, Theme, Renderer<Renderer, Renderer>>>
fn dialog( &self, ) -> Option<Element<'_, Self::Message, Theme, Renderer<Renderer, Renderer>>>
Displays a dialog in the center of the application window when
Some.Displays a footer at the bottom of the application window when
Some.§fn header_start(
&self,
) -> Vec<Element<'_, Self::Message, Theme, Renderer<Renderer, Renderer>>>
fn header_start( &self, ) -> Vec<Element<'_, Self::Message, Theme, Renderer<Renderer, Renderer>>>
Attaches elements to the start section of the header.
§fn header_center(
&self,
) -> Vec<Element<'_, Self::Message, Theme, Renderer<Renderer, Renderer>>>
fn header_center( &self, ) -> Vec<Element<'_, Self::Message, Theme, Renderer<Renderer, Renderer>>>
Attaches elements to the center of the header.
§fn header_end(
&self,
) -> Vec<Element<'_, Self::Message, Theme, Renderer<Renderer, Renderer>>>
fn header_end( &self, ) -> Vec<Element<'_, Self::Message, Theme, Renderer<Renderer, Renderer>>>
Attaches elements to the end section of the header.
Allows overriding the default nav bar widget.
Shows a context menu for the active nav bar item.
Allows COSMIC to integrate with your application’s [
nav_bar::Model].§fn on_app_exit(&mut self) -> Option<Self::Message>
fn on_app_exit(&mut self) -> Option<Self::Message>
Called before closing the application. Returning a message will override closing windows.
§fn on_close_requested(&self, id: Id) -> Option<Self::Message>
fn on_close_requested(&self, id: Id) -> Option<Self::Message>
Called when a window requests to be closed.
fn on_context_drawer(&mut self) -> Task<Action<Self::Message>>
Called when a navigation item is selected.
Called when a context menu is requested for a navigation item.
§fn on_search(&mut self) -> Task<Action<Self::Message>>
fn on_search(&mut self) -> Task<Action<Self::Message>>
Called when the search function is requested.
§fn on_window_resize(&mut self, id: Id, width: f32, height: f32)
fn on_window_resize(&mut self, id: Id, width: f32, height: f32)
Called when a window is resized.
§fn system_theme_update(
&mut self,
keys: &[&'static str],
new_theme: &Theme,
) -> Task<Action<Self::Message>>
fn system_theme_update( &mut self, keys: &[&'static str], new_theme: &Theme, ) -> Task<Action<Self::Message>>
Respond to a system theme change
§fn system_theme_mode_update(
&mut self,
keys: &[&'static str],
new_theme: &ThemeMode,
) -> Task<Action<Self::Message>>
fn system_theme_mode_update( &mut self, keys: &[&'static str], new_theme: &ThemeMode, ) -> Task<Action<Self::Message>>
Respond to a system theme mode change
§fn view_window(
&self,
id: Id,
) -> Element<'_, Self::Message, Theme, Renderer<Renderer, Renderer>>
fn view_window( &self, id: Id, ) -> Element<'_, Self::Message, Theme, Renderer<Renderer, Renderer>>
Constructs views for other windows.
Auto Trait Implementations§
impl !RefUnwindSafe for Button
impl !UnwindSafe for Button
impl Freeze for Button
impl Send for Button
impl Sync for Button
impl Unpin for Button
impl UnsafeUnpin for Button
Blanket Implementations§
Source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
Source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
👎Deprecated since 0.7.7:
replaced by palette::chromatic_adaptation::AdaptIntoUnclamped
Convert the source color to the destination color using the specified
method.
Source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
👎Deprecated since 0.7.7:
replaced by palette::chromatic_adaptation::AdaptIntoUnclamped
Convert the source color to the destination color using the bradford
method by default.
Source§impl<T, C> AdaptIntoUnclamped<T> for Cwhere
T: AdaptFromUnclamped<C>,
impl<T, C> AdaptIntoUnclamped<T> for Cwhere
T: AdaptFromUnclamped<C>,
Source§type Scalar = <T as AdaptFromUnclamped<C>>::Scalar
type Scalar = <T as AdaptFromUnclamped<C>>::Scalar
The number type that’s used as the color’s components.
Source§fn adapt_into_unclamped_with<M>(self) -> Twhere
M: LmsToXyz<<C as AdaptIntoUnclamped<T>>::Scalar> + XyzToLms<<C as AdaptIntoUnclamped<T>>::Scalar>,
fn adapt_into_unclamped_with<M>(self) -> Twhere
M: LmsToXyz<<C as AdaptIntoUnclamped<T>>::Scalar> + XyzToLms<<C as AdaptIntoUnclamped<T>>::Scalar>,
§impl<T> Also for T
impl<T> Also for T
§impl<App> ApplicationExt for Appwhere
App: Application,
impl<App> ApplicationExt for Appwhere
App: Application,
§fn view_main(
&self,
) -> Element<'_, Action<<App as Application>::Message>, Theme, Renderer<Renderer, Renderer>>
fn view_main( &self, ) -> Element<'_, Action<<App as Application>::Message>, Theme, Renderer<Renderer, Renderer>>
Creates the view for the main window.
§fn set_window_title(
&mut self,
title: String,
id: Id,
) -> Task<Action<<App as Application>::Message>>
fn set_window_title( &mut self, title: String, id: Id, ) -> Task<Action<<App as Application>::Message>>
Set the title of a window.
§fn set_show_context(&mut self, show: bool)
fn set_show_context(&mut self, show: bool)
Set the context drawer visibility.
§fn set_header_title(&mut self, title: String)
fn set_header_title(&mut self, title: String)
Set the header bar title.
fn watch_config<T>(&self, id: &'static str) -> Subscription<Update<T>>
fn watch_state<T>(&self, id: &'static str) -> Subscription<Update<T>>
§impl<T, Res> Apply<Res> for Twhere
T: ?Sized,
impl<T, Res> Apply<Res> for Twhere
T: ?Sized,
Source§impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
Source§fn arrays_from(colors: C) -> T
fn arrays_from(colors: C) -> T
Cast a collection of colors into a collection of arrays.
Source§impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
Source§fn arrays_into(self) -> C
fn arrays_into(self) -> C
Cast this collection of arrays into a collection of colors.
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
Source§impl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
impl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
Source§type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
The number type that’s used in
parameters when converting.Source§fn cam16_into_unclamped(
self,
parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>,
) -> T
fn cam16_into_unclamped( self, parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>, ) -> T
Converts
self into C, using the provided parameters.impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
Source§fn components_from(colors: C) -> T
fn components_from(colors: C) -> T
Cast a collection of colors into a collection of color components.
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> FromAngle<T> for T
impl<T> FromAngle<T> for T
Source§fn from_angle(angle: T) -> T
fn from_angle(angle: T) -> T
Performs a conversion from
angle.Source§impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
Source§fn from_stimulus(other: U) -> T
fn from_stimulus(other: U) -> T
Converts
other into Self, while performing the appropriate scaling,
rounding and clamping.§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, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
Source§fn into_angle(self) -> U
fn into_angle(self) -> U
Performs a conversion into
T.§impl<State, Message> IntoBoot<State, Message> for State
impl<State, Message> IntoBoot<State, Message> for State
Source§impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
Source§type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
The number type that’s used in
parameters when converting.Source§fn into_cam16_unclamped(
self,
parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>,
) -> T
fn into_cam16_unclamped( self, parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>, ) -> T
Converts
self into C, using the provided parameters.Source§impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
Source§fn into_color(self) -> U
fn into_color(self) -> U
Convert into T with values clamped to the color defined bounds Read more
Source§impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
Source§fn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
Convert into T. The resulting color might be invalid in its color space Read more
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 moreSource§impl<T> IntoStimulus<T> for T
impl<T> IntoStimulus<T> for T
Source§fn into_stimulus(self) -> T
fn into_stimulus(self) -> T
Converts
self into T, while performing the appropriate scaling,
rounding and clamping.impl<T> MaybeClone for T
impl<T> MaybeDebug for T
impl<T> MaybeSend for Twhere
T: Send,
impl<T> MaybeSync for Twhere
T: Sync,
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
Source§type Error = <C as TryFromComponents<T>>::Error
type Error = <C as TryFromComponents<T>>::Error
The error for when
try_into_colors fails to cast.Source§fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
Try to cast this collection of color components into a collection of
colors. Read more
Source§impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
Source§fn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
Convert into T, returning ok if the color is inside of its defined
range, otherwise an
OutOfBounds error is returned which contains
the unclamped color. Read moreSource§impl<C, U> UintsFrom<C> for Uwhere
C: IntoUints<U>,
impl<C, U> UintsFrom<C> for Uwhere
C: IntoUints<U>,
Source§fn uints_from(colors: C) -> U
fn uints_from(colors: C) -> U
Cast a collection of colors into a collection of unsigned integers.
Source§impl<C, U> UintsInto<C> for Uwhere
C: FromUints<U>,
impl<C, U> UintsInto<C> for Uwhere
C: FromUints<U>,
Source§fn uints_into(self) -> C
fn uints_into(self) -> C
Cast this collection of unsigned integers into a collection of colors.