pub struct Bar { /* private fields */ }
Expand description
The bar itself.
See parser::parse
for configuration details.
Implementations§
Source§impl Bar
impl Bar
Sourcepub fn new(
name: &str,
position: Position,
height: u16,
transparent: bool,
bg: Color,
margins: Margins,
reverse_scroll: bool,
ipc: bool,
monitor: Option<String>,
) -> Result<(Self, Pin<Box<dyn Stream<Item = Result<UnixStream, Error>>>>)>
pub fn new( name: &str, position: Position, height: u16, transparent: bool, bg: Color, margins: Margins, reverse_scroll: bool, ipc: bool, monitor: Option<String>, ) -> Result<(Self, Pin<Box<dyn Stream<Item = Result<UnixStream, Error>>>>)>
Create a new bar, typically from information held by a
BarConfig
.
Sourcepub fn process_event(&mut self, event: &Event) -> Result<()>
pub fn process_event(&mut self, event: &Event) -> Result<()>
Handle an event from the X server.
Sourcepub fn send_message(
&mut self,
message: &str,
ipc_set: &mut JoinSet<Result<()>>,
ipc_send: UnboundedSender<EventResponse>,
) -> Result<bool>
pub fn send_message( &mut self, message: &str, ipc_set: &mut JoinSet<Result<()>>, ipc_send: UnboundedSender<EventResponse>, ) -> Result<bool>
Sends a message to the appropriate panel.
Sourcepub fn update_panel(
&mut self,
alignment: Alignment,
idx: usize,
draw_info: PanelDrawInfo,
) -> Result<()>
pub fn update_panel( &mut self, alignment: Alignment, idx: usize, draw_info: PanelDrawInfo, ) -> Result<()>
Handle a change in the content of a panel.
Sourcepub fn redraw_bar(&mut self) -> Result<()>
pub fn redraw_bar(&mut self) -> Result<()>
Redraw the entire bar, either as the result of an expose event or because the width of a panel changed.
Note: this function is not called for every panel update. If the width
doesn’t change, only one panel is redrawn, and there are a number of
other cases in which we can redraw only the left or right side. See
Bar::update_panel
for specifics.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Bar
impl !RefUnwindSafe for Bar
impl !Send for Bar
impl !Sync for Bar
impl Unpin for Bar
impl !UnwindSafe for Bar
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