pub struct BadgeState {
pub enabled: bool,
pub format: String,
pub rendered_text: String,
pub color: [u8; 3],
pub alpha: f32,
pub font: String,
pub font_bold: bool,
pub top_margin: f32,
pub right_margin: f32,
pub max_width: f32,
pub max_height: f32,
pub variables: Arc<RwLock<SessionVariables>>,
/* private fields */
}Expand description
Badge state and configuration
Fields§
§enabled: boolWhether badge is enabled
format: StringBadge format string (with variable placeholders)
rendered_text: StringRendered badge text after variable interpolation
color: [u8; 3]Badge text color [R, G, B]
alpha: f32Badge opacity (0.0-1.0)
font: StringFont family for badge
font_bold: boolUse bold font
top_margin: f32Top margin in pixels
right_margin: f32Right margin in pixels
max_width: f32Maximum width as fraction of terminal width (0.0-1.0)
max_height: f32Maximum height as fraction of terminal height (0.0-1.0)
variables: Arc<RwLock<SessionVariables>>Session variables for interpolation
Implementations§
Source§impl BadgeState
impl BadgeState
Sourcepub fn update_config(&mut self, config: &Config)
pub fn update_config(&mut self, config: &Config)
Update badge configuration
Sourcepub fn set_format(&mut self, format: String)
pub fn set_format(&mut self, format: String)
Set badge format directly (e.g., from OSC 1337)
Sourcepub fn mark_dirty(&mut self)
pub fn mark_dirty(&mut self)
Mark badge as needing re-render
Sourcepub fn clear_dirty(&mut self)
pub fn clear_dirty(&mut self)
Clear dirty flag
Sourcepub fn interpolate(&mut self)
pub fn interpolate(&mut self)
Interpolate variables in the format string
Sourcepub fn variables_mut(&self) -> RwLockWriteGuard<'_, SessionVariables>
pub fn variables_mut(&self) -> RwLockWriteGuard<'_, SessionVariables>
Access session variables for mutation
Sourcepub fn apply_profile_settings(&mut self, profile: &Profile)
pub fn apply_profile_settings(&mut self, profile: &Profile)
Apply badge settings from a profile (overrides global config where set)
This is called when a profile is activated to apply its custom badge settings. Only non-None profile settings override the current values.
Trait Implementations§
Source§impl Clone for BadgeState
impl Clone for BadgeState
Source§fn clone(&self) -> BadgeState
fn clone(&self) -> BadgeState
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for BadgeState
impl !RefUnwindSafe for BadgeState
impl Send for BadgeState
impl Sync for BadgeState
impl Unpin for BadgeState
impl UnsafeUnpin for BadgeState
impl !UnwindSafe for BadgeState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more