[][src]Trait penrose::draw::widget::Widget

pub trait Widget {
    pub fn draw(
        &mut self,
        ctx: &mut dyn DrawContext,
        screen: usize,
        screen_has_focus: bool,
        w: f64,
        h: f64
    ) -> Result<()>;
pub fn current_extent(
        &mut self,
        ctx: &mut dyn DrawContext,
        h: f64
    ) -> Result<(f64, f64)>;
pub fn require_draw(&self) -> bool;
pub fn is_greedy(&self) -> bool; }

A status bar widget that can be rendered using a DrawContext

Required methods

pub fn draw(
    &mut self,
    ctx: &mut dyn DrawContext,
    screen: usize,
    screen_has_focus: bool,
    w: f64,
    h: f64
) -> Result<()>
[src]

Render the current state of the widget to the status bar window.

pub fn current_extent(
    &mut self,
    ctx: &mut dyn DrawContext,
    h: f64
) -> Result<(f64, f64)>
[src]

Current required width and height for this widget due to its content

pub fn require_draw(&self) -> bool[src]

Does this widget currently require re-rendering? (should be updated when 'draw' is called)

pub fn is_greedy(&self) -> bool[src]

If true, this widget will expand to fill remaining available space after layout has been computed. If multiple greedy widgets are present in a given StatusBar then the available space will be split evenly between all widgets.

Loading content...

Implementors

impl Widget for ActiveWindowName[src]

impl Widget for CurrentLayout[src]

impl Widget for InputBox[src]

impl Widget for LinesWithSelection[src]

impl Widget for RootWindowName[src]

impl Widget for Text[src]

impl Widget for Workspaces[src]

Loading content...