pub struct Attrs { /* private fields */ }
Expand description
Attributes of a panel, or the defaults for the bar.
Implementations§
Source§impl Attrs
impl Attrs
Sourcepub const fn empty() -> Self
pub const fn empty() -> Self
Creates an empty instance (all fields set to None
).
This creates the same Attrs
as Attrs::default
, but this is a
const function.
Sourcepub fn parse(name: impl AsRef<str>) -> Result<Self>
pub fn parse(name: impl AsRef<str>) -> 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>) -> Self
pub fn parse_global(name: impl AsRef<str>) -> 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§
Source§impl PartialOrd for Attrs
impl PartialOrd for Attrs
impl StructuralPartialEq for Attrs
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