pub struct Highlight {
pub overline_height: f64,
pub overline_color: Color,
pub underline_height: f64,
pub underline_color: Color,
}
Expand description
Describes a bar to be drawn below a workspace name
Fields§
§overline_height: f64
the height in pixels of the top highlight
overline_color: Color
the color of the top highlight
underline_height: f64
the height in pixels of the bottom highlight
underline_color: Color
the color of the bottom highlight
Implementations§
Source§impl Highlight
impl Highlight
Sourcepub const fn empty() -> Self
pub const fn empty() -> Self
Creates an empty instance (height set to 0.0
, color set to black).
This creates the same Highlight
as Highlight::default
, but this
is a const function.
Sourcepub const fn new(
overline_height: f64,
overline_color: Color,
underline_height: f64,
underline_color: Color,
) -> Self
pub const fn new( overline_height: f64, overline_color: Color, underline_height: f64, underline_color: Color, ) -> Self
Creates a new instance.
Sourcepub fn draw(&self, cr: &Context, bar_height: f64, width: f64) -> Result<()>
pub fn draw(&self, cr: &Context, bar_height: f64, width: f64) -> Result<()>
Draws the {over,under}lines associated with this highlight.
The current point of cr
should have the same x coordinate as the left
edge of the expected rectangles.
Sourcepub fn parse(name: impl AsRef<str>) -> Option<Self>
pub fn parse(name: impl AsRef<str>) -> Option<Self>
Parses a new instance from a subset of the global
Config
Configuration options:
{over,under}line_height
: the height in pixels of the highlight- type: f64
- default: none
{over,under}line_color
: the color of the highlight- type: String
- default: none
Trait Implementations§
Source§impl PartialOrd for Highlight
impl PartialOrd for Highlight
impl StructuralPartialEq for Highlight
Auto Trait Implementations§
impl Freeze for Highlight
impl RefUnwindSafe for Highlight
impl Send for Highlight
impl Sync for Highlight
impl Unpin for Highlight
impl UnwindSafe for Highlight
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more