pub enum RenderItem {
}Expand description
A single rendering element for status bar content
RenderItems are processed sequentially to build styled text for the status bar. They can represent text content, color changes, text attributes, or layout elements.
Variants§
Text(String)
Display text content
Renders the provided string with the current text style.
§Example
use scarab_plugin_api::status_bar::RenderItem;
let item = RenderItem::Text("Hello, World!".to_string());Icon(String)
Display a Nerd Font icon
Renders an icon from the Nerd Font icon set by name. The icon will use the current foreground color and attributes.
§Example
use scarab_plugin_api::status_bar::RenderItem;
let item = RenderItem::Icon("nf-fa-battery_full".to_string());Foreground(Color)
Set foreground (text) color
Changes the text color for all subsequent text items until another color change or reset.
§Example
use scarab_plugin_api::status_bar::{RenderItem, Color};
let item = RenderItem::Foreground(Color::Rgb(122, 162, 247));ForegroundAnsi(AnsiColor)
Set foreground color using ANSI color
Alternative to Foreground using standard ANSI color names.
§Example
use scarab_plugin_api::status_bar::{RenderItem, AnsiColor};
let item = RenderItem::ForegroundAnsi(AnsiColor::BrightBlue);Background(Color)
Set background color
Changes the background color for all subsequent text items.
§Example
use scarab_plugin_api::status_bar::{RenderItem, Color};
let item = RenderItem::Background(Color::Named("darkgray".to_string()));BackgroundAnsi(AnsiColor)
Set background color using ANSI color
Alternative to Background using standard ANSI color names.
§Example
use scarab_plugin_api::status_bar::{RenderItem, AnsiColor};
let item = RenderItem::BackgroundAnsi(AnsiColor::Black);Bold
Enable bold text attribute
Makes all subsequent text bold until reset or another weight change.
§Example
use scarab_plugin_api::status_bar::RenderItem;
let items = vec![
RenderItem::Bold,
RenderItem::Text("Important".to_string()),
];Italic
Enable italic text attribute
Makes all subsequent text italic until reset.
§Example
use scarab_plugin_api::status_bar::RenderItem;
let items = vec![
RenderItem::Italic,
RenderItem::Text("Emphasis".to_string()),
];Underline(UnderlineStyle)
Enable underline with specified style
Underlines all subsequent text with the given style until reset.
§Example
use scarab_plugin_api::status_bar::{RenderItem, UnderlineStyle};
let items = vec![
RenderItem::Underline(UnderlineStyle::Curly),
RenderItem::Text("Warning".to_string()),
];Strikethrough
Enable strikethrough text attribute
Strikes through all subsequent text until reset.
§Example
use scarab_plugin_api::status_bar::RenderItem;
let items = vec![
RenderItem::Strikethrough,
RenderItem::Text("Deprecated".to_string()),
];ResetAttributes
Reset all text attributes to defaults
Clears all colors, bold, italic, underline, and strikethrough attributes.
§Example
use scarab_plugin_api::status_bar::RenderItem;
let items = vec![
RenderItem::Bold,
RenderItem::Text("Bold".to_string()),
RenderItem::ResetAttributes,
RenderItem::Text("Normal".to_string()),
];ResetForeground
Reset foreground color to default
Clears only the foreground color, keeping other attributes.
§Example
use scarab_plugin_api::status_bar::{RenderItem, Color};
let items = vec![
RenderItem::Bold,
RenderItem::Foreground(Color::Hex("#ff0000".to_string())),
RenderItem::Text("Red & Bold".to_string()),
RenderItem::ResetForeground,
RenderItem::Text("Default color, still bold".to_string()),
];ResetBackground
Reset background color to default
Clears only the background color, keeping other attributes.
§Example
use scarab_plugin_api::status_bar::{RenderItem, Color};
let items = vec![
RenderItem::Background(Color::Hex("#333333".to_string())),
RenderItem::Text("Dark background".to_string()),
RenderItem::ResetBackground,
RenderItem::Text("Default background".to_string()),
];Spacer
Insert flexible spacing
Creates space that expands to fill available room. Useful for pushing content to opposite ends of the status bar.
§Example
use scarab_plugin_api::status_bar::RenderItem;
let items = vec![
RenderItem::Text("Left".to_string()),
RenderItem::Spacer,
RenderItem::Text("Right".to_string()),
];Padding(u8)
Insert fixed spacing
Adds a fixed number of space characters (cells).
§Example
use scarab_plugin_api::status_bar::RenderItem;
let items = vec![
RenderItem::Text("A".to_string()),
RenderItem::Padding(3),
RenderItem::Text("B".to_string()),
];Separator(String)
Insert a separator string
Convenience item for common separators like “ | “ or “ • “.
§Example
use scarab_plugin_api::status_bar::RenderItem;
let items = vec![
RenderItem::Text("Section 1".to_string()),
RenderItem::Separator(" | ".to_string()),
RenderItem::Text("Section 2".to_string()),
];Trait Implementations§
Source§impl Clone for RenderItem
impl Clone for RenderItem
Source§fn clone(&self) -> RenderItem
fn clone(&self) -> RenderItem
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more