[−][src]Struct cnx::widgets::Pager
Shows the WM's workspaces/groups, highlighting whichever is currently active.
This widget shows the WM's workspaces/groups, as determined by the EWMH
_NET_NUMBER_OF_DESKTOPS
and _NET_DESKTOP_NAMES
and
_NET_CURRENT_DESKTOP
properties. The active workspace is highlighted.
Methods
impl Pager
[src]
pub fn new(
cnx: &Cnx,
active_attr: Attributes,
inactive_attr: Attributes
) -> Pager
[src]
cnx: &Cnx,
active_attr: Attributes,
inactive_attr: Attributes
) -> Pager
Creates a new Pager widget.
Creates a new Pager
widget. The widget will list the current
workspaces in order, using the given inactive_attr
Attributes
for
all inactive groups, and the active_attr
Attributes
for the
currently active group.
The Cnx
instance is borrowed during construction in order to get
access to handles of its event loop. However, it is not borrowed for
the lifetime of the widget. See the cnx_add_widget!()
for more
discussion about the lifetime of the borrow.
Examples
let attr = Attributes { font: Font::new("SourceCodePro 21"), fg_color: Color::white(), bg_color: None, padding: Padding::new(8.0, 8.0, 0.0, 0.0), }; let mut active_attr = attr.clone(); active_attr.bg_color = Some(Color::blue()); let mut cnx = Cnx::new(Position::Top)?; cnx_add_widget!(cnx, Pager::new(&cnx, active_attr, attr.clone()));
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.