[][src]Struct cnx::widgets::Pager

pub struct Pager { /* fields omitted */ }

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]

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

impl Widget for Pager[src]

Auto Trait Implementations

impl !Send for Pager

impl !Sync for Pager

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Erased for T