logo

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

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

A status bar widget that can be rendered using a DrawContext

Required methods

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

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

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

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.

Implementors