Struct lazybar_core::attrs::Attrs
source · pub struct Attrs { /* private fields */ }
Expand description
Attributes of a panel, or the defaults for the bar.
Implementations§
source§impl Attrs
impl Attrs
sourcepub fn parse(name: impl AsRef<str>, global: &Config) -> Result<Self>
pub fn parse(name: impl AsRef<str>, global: &Config) -> Result<Self>
Parses an instance of this type from a subset of the global
Config
.
This function first looks for a top-level table called attrs
and then
a subtable of the given name. These options are contained within the
subtable.
Configuration options:
-
fg: String
: Specify the foreground (usually text) color. All parsing methods from csscolorparser are available. -
bg
: SeeBg::parse
. -
font: String
: Specify the font to be used. This will be turned into apango::FontDescription
, so it’s very configurable. Font family, weight, size, and more can be specified.
sourcepub fn parse_global(name: impl AsRef<str>, global: &Config) -> Self
pub fn parse_global(name: impl AsRef<str>, global: &Config) -> Self
sourcepub fn apply_font(&self, layout: &Layout)
pub fn apply_font(&self, layout: &Layout)
Sets the font of a pango::Layout
.
sourcepub fn apply_fg(&self, cr: &Context)
pub fn apply_fg(&self, cr: &Context)
Sets the foreground (usually text) color of a cairo::Context
.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Attrs
impl RefUnwindSafe for Attrs
impl Send for Attrs
impl Sync for Attrs
impl Unpin for Attrs
impl UnwindSafe for Attrs
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)