Struct bitbar::ContentItem [−][src]
pub struct ContentItem {
pub text: String,
pub extra: Option<Extra>,
pub href: Option<Url>,
pub color: Option<Color>,
pub font: Option<String>,
pub size: Option<usize>,
pub command: Option<Command>,
pub refresh: bool,
pub image: Option<Image>,
pub flavor_attrs: Option<Attrs>,
}
Expand description
A menu item that’s not a separator.
Fields
text: String
This menu item’s main content text.
Any |
in the text will be displayed as ¦
, and any newlines will be displayed as spaces.
extra: Option<Extra>
This menu item’s alternate-mode menu item or submenu.
href: Option<Url>
Corresponds to BitBar’s href=
parameter.
color: Option<Color>
Corresponds to BitBar’s color=
parameter.
font: Option<String>
Corresponds to BitBar’s font=
parameter.
size: Option<usize>
Corresponds to BitBar’s size=
parameter.
command: Option<Command>
Corresponds to BitBar’s bash=
, terminal=
, param1=
, etc. parameters.
refresh: bool
Corresponds to BitBar’s refresh=
parameter.
image: Option<Image>
Corresponds to BitBar’s image=
or templateImage=
parameter.
flavor_attrs: Option<Attrs>
Parameters for flavor-specific features.
Implementations
Returns a new menu item with the given text.
Any |
in the text will be displayed as ¦
, and any newlines will be displayed as spaces.
Adds a submenu to this menu item.
Adds a clickable link to this menu item.
Sets this menu item’s text color. Alpha channel is ignored.
Make this menu item run the given command when clicked.
Causes the BitBar plugin to be refreshed when this menu item is clicked.
Adds an alternate menu item, which is shown instead of this one as long as the option key ⌥ is held.
Adds a template image to this menu item.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for ContentItem
impl Send for ContentItem
impl Sync for ContentItem
impl Unpin for ContentItem
impl UnwindSafe for ContentItem
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
Sets value
as a parameter of self
.