Trait penrose_ui::bar::widgets::WorkspacesUi
source · pub trait WorkspacesUi {
// Required methods
fn background_color(&self) -> Color;
fn colors_for_workspace(
&self,
workspace_meta: &WsMeta,
focus_state: FocusState,
screen_has_focus: bool,
) -> (Color, Color);
// Provided methods
fn update_from_state<X>(
&mut self,
workspace_meta: &[WsMeta],
focused_tags: &[String],
state: &State<X>,
x: &X,
) -> bool
where X: XConn { ... }
fn ui_tag(&self, workspace_meta: &WsMeta) -> String { ... }
}
Expand description
A UI implementation for the WorkspacesWidget widget.
Required Methods§
sourcefn background_color(&self) -> Color
fn background_color(&self) -> Color
The background color to be used for the parent WorkspacesWidget.
sourcefn colors_for_workspace(
&self,
workspace_meta: &WsMeta,
focus_state: FocusState,
screen_has_focus: bool,
) -> (Color, Color)
fn colors_for_workspace( &self, workspace_meta: &WsMeta, focus_state: FocusState, screen_has_focus: bool, ) -> (Color, Color)
The foreground and background color to be used for rendering a given workspace.
The FocusState provided indicates the current state of the workspace itself, while
screen_has_focus
is used to indicate whether or not the screen the parent
WorkspacesWidget is on is currently focused or not.
Provided Methods§
sourcefn update_from_state<X>(
&mut self,
workspace_meta: &[WsMeta],
focused_tags: &[String],
state: &State<X>,
x: &X,
) -> boolwhere
X: XConn,
fn update_from_state<X>(
&mut self,
workspace_meta: &[WsMeta],
focused_tags: &[String],
state: &State<X>,
x: &X,
) -> boolwhere
X: XConn,
Update the UI properties of the parent WorkspacesWidget as part of startup and refresh hooks.
The boolean return of this method is used to indicate to the parent widget that a redraw
is now required. If state has not changed since the last time this method was called then
you should return false
to reduce unnecessary rendering.
Object Safety§
This trait is not object safe.