[−][src]Struct rust_bitbar::Line
Line holds the content, styling and behaviour of a line in a Bitbar menu, both in the menu and submenus
Methods
impl Line
[src]
pub fn new(text: String) -> Self
[src]
Function to create empty line
pub fn set_text(&mut self, text: String) -> &mut Self
[src]
Change text of the line
pub fn set_style(&mut self, style: Style) -> &mut Self
[src]
Style provides a alternate method for setting the text style related options.
pub fn set_command(&mut self, cmd: Cmd) -> &mut Self
[src]
command provides a alternate method for setting the bash script and params along with some related flags via a Cmd struct.
pub fn set_href(&mut self, href: String) -> &mut Self
[src]
href adds a URL to the line and makes it clickable.
pub fn set_color(&mut self, color: String) -> &mut Self
[src]
Color sets the lines font color, can take a name or hex value.
pub fn set_font(&mut self, font: String) -> &mut Self
[src]
Font sets the lines font.
pub fn set_size(&mut self, size: i64) -> &mut Self
[src]
Size sets the lines font size.
pub fn set_bash(&mut self, bash: String) -> &mut Self
[src]
Bash makes makes the line clickable and adds a script that will be run on click.
pub fn set_params(&mut self, params: Vec<String>) -> &mut Self
[src]
Params adds arguments which are passed to the script specified by line.bash()
pub fn set_terminal(&mut self, terminal: bool) -> &mut Self
[src]
Terminal sets a flag which controls whether a Terminal is opened when the bash script is run.
pub fn set_refresh(&mut self, refresh: bool) -> &mut Self
[src]
Refresh controls whether clicking the line results in the plugin being refreshed. If the line has a bash script attached then the plugin is refreshed after the script finishes.
pub fn set_drop_down(&mut self, drop_down: bool) -> &mut Self
[src]
DropDown sets a flag which controls whether the line only appears and cycles in the status bar but not in the dropdown.
pub fn set_length(&mut self, length: i64) -> &mut Self
[src]
Length truncates the line after the specified number of characters. An elipsis will be added to any truncated strings, as well as a tooltip displaying the full string.
pub fn set_trim(&mut self, trim: bool) -> &mut Self
[src]
Trim sets a flag to control whether leading/trailing whitespace is trimmed from the
title. Defaults to true
.
pub fn set_alternate(&mut self, alternate: bool) -> &mut Self
[src]
Alternate sets a flag to mark a line as an alternate to the previous one for when the Option key is pressed in the dropdown.
pub fn set_emojize(&mut self, emojize: bool) -> &mut Self
[src]
Emojize sets a flag to control parsing of github style :mushroom: into 🍄.
pub fn set_ansi(&mut self, ansi: bool) -> &mut Self
[src]
Ansi sets a flag to control parsing of ANSI codes.
Trait Implementations
impl Default for Line
[src]
impl Clone for Line
[src]
fn clone(&self) -> Line
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl ToString for Line
[src]
impl Debug for Line
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,