pub enum Button {
Icon {
svg_data: &'static str,
background: Color,
foreground: Color,
},
IconWithText {
svg_data: &'static str,
text: String,
background: Color,
foreground: Color,
},
Text {
text: String,
background: Color,
foreground: Color,
},
CustomImage {
image: DynamicImage,
},
Gradient {
start_color: Rgba<u8>,
end_color: Rgba<u8>,
},
}Expand description
Represents different types of buttons for the Stream Deck
Variants§
Icon
A button with just an SVG icon
IconWithText
A button with an SVG icon and text label
Text
A button with only text
CustomImage
A button with a custom image
Fields
§
image: DynamicImageGradient
A button with a gradient background
Implementations§
Source§impl Button
impl Button
Sourcepub fn text(
text: impl Into<String>,
background: Color,
foreground: Color,
) -> Self
pub fn text( text: impl Into<String>, background: Color, foreground: Color, ) -> Self
Create a new text button
Sourcepub fn icon(
svg_data: &'static str,
background: Color,
foreground: Color,
) -> Self
pub fn icon( svg_data: &'static str, background: Color, foreground: Color, ) -> Self
Create a new icon button
Sourcepub fn icon_with_text(
svg_data: &'static str,
text: impl Into<String>,
background: Color,
foreground: Color,
) -> Self
pub fn icon_with_text( svg_data: &'static str, text: impl Into<String>, background: Color, foreground: Color, ) -> Self
Create a new icon with text button
Sourcepub fn custom_image(image: DynamicImage) -> Self
pub fn custom_image(image: DynamicImage) -> Self
Create a new custom image button
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Button
impl RefUnwindSafe for Button
impl Send for Button
impl Sync for Button
impl Unpin for Button
impl UnwindSafe for Button
Blanket Implementations§
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.