Struct penrose_ui::bar::StatusBar
source · pub struct StatusBar<X: XConn> { /* private fields */ }
Expand description
A simple text based status bar that renders a user defined array of Widget
s.
Implementations§
source§impl<X: XConn> StatusBar<X>
impl<X: XConn> StatusBar<X>
sourcepub fn try_new(
position: Position,
h: u32,
bg: impl Into<Color>,
font: &str,
point_size: u8,
widgets: Vec<Box<dyn Widget<X>>>,
) -> Result<Self>
pub fn try_new( position: Position, h: u32, bg: impl Into<Color>, font: &str, point_size: u8, widgets: Vec<Box<dyn Widget<X>>>, ) -> Result<Self>
Try to initialise a new empty status bar. Can fail if we are unable to create a new window for each bar.
sourcepub fn try_new_per_screen(
position: Position,
bg: impl Into<Color>,
font: &str,
widgets: Vec<PerScreen<X>>,
) -> Result<Self>
pub fn try_new_per_screen( position: Position, bg: impl Into<Color>, font: &str, widgets: Vec<PerScreen<X>>, ) -> Result<Self>
Try to create a new status bar using a different arrangement of widgets for each screen.
If more screens are attached than available widget arrangements, the last widget arrangement will be used as a fallback.
sourcepub fn add_to(self, wm: WindowManager<X>) -> WindowManager<X>where
X: 'static,
pub fn add_to(self, wm: WindowManager<X>) -> WindowManager<X>where
X: 'static,
Add this StatusBar
into the given WindowManager
along with the required
hooks for driving it from the main WindowManager event loop.
If any UpdateSchedules are requested by [Widgets] then they will be extracted and run as part of calling this method.
Trait Implementations§
Auto Trait Implementations§
impl<X> !Freeze for StatusBar<X>
impl<X> !RefUnwindSafe for StatusBar<X>
impl<X> !Send for StatusBar<X>
impl<X> !Sync for StatusBar<X>
impl<X> Unpin for StatusBar<X>
impl<X> !UnwindSafe for StatusBar<X>
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