pub struct FocusStyle {
pub border_chars: Option<BorderChars>,
pub border_color: Option<Color>,
pub text_color: Option<Color>,
pub bg_color: Option<Color>,
}Expand description
Styling configuration for widget focus states.
FocusStyle provides a builder pattern for configuring visual feedback
when widgets are focused. It supports custom border styles, colors, and text
highlighting to make focused widgets visually distinct.
§Examples
use minui::widgets::FocusStyle;
use minui::{BorderChars, Color};
// Default focus style
let default = FocusStyle::new();
// Custom focus style with blue double-line border
let custom = FocusStyle::new()
.with_border_chars(BorderChars::double_line())
.with_border_color(Color::Blue);
// Focus style with text highlighting
let highlighted = FocusStyle::new()
.with_text_color(Color::Cyan);Fields§
§border_chars: Option<BorderChars>Border characters for focused state (None = no border change)
border_color: Option<Color>Border color for focused state
text_color: Option<Color>Text color for focused state
bg_color: Option<Color>Background color for focused state
Implementations§
Source§impl FocusStyle
impl FocusStyle
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new focus style with defaults.
Defaults: None for all style fields (no visual change when focused).
Sourcepub fn with_border_chars(self, chars: BorderChars) -> Self
pub fn with_border_chars(self, chars: BorderChars) -> Self
Sets the border characters for the focused state.
Sourcepub fn with_border_color(self, color: Color) -> Self
pub fn with_border_color(self, color: Color) -> Self
Sets the border color for the focused state.
Sourcepub fn with_text_color(self, color: Color) -> Self
pub fn with_text_color(self, color: Color) -> Self
Sets the text color for the focused state.
Sourcepub fn with_bg_color(self, color: Color) -> Self
pub fn with_bg_color(self, color: Color) -> Self
Sets the background color for the focused state.
Sourcepub fn highlighted() -> Self
pub fn highlighted() -> Self
Creates a standard “highlighted” style (no border, just colors).
Trait Implementations§
Source§impl Clone for FocusStyle
impl Clone for FocusStyle
Source§fn clone(&self) -> FocusStyle
fn clone(&self) -> FocusStyle
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more