pub struct TerminalWidgetStyle {Show 21 fields
pub background: Color,
pub border: Border,
pub focus_ring: Border,
pub text: TextStyle,
pub selection_background: Color,
pub cursor: Color,
pub scrollbar_track: Color,
pub scrollbar_thumb: Color,
pub diagnostic_error: Color,
pub diagnostic_warning: Color,
pub diagnostic_info: Color,
pub diagnostic_hint: Color,
pub radius: Radius,
pub padding_x: f32,
pub padding_y: f32,
pub width: f32,
pub height: f32,
pub line_height: f32,
pub char_width: f32,
pub scrollbar_width: f32,
pub scrollbar_inset: f32,
}Expand description
Resolved terminal colors, typography, and logical-pixel geometry.
Runtime measurement clamps fallback char_width and line_height to at
least 1.0. Padding can collapse content to zero; other custom non-finite
geometry may propagate into layout or painting.
§Examples
use ailloli_ui_core::Theme;
use ailloli_ui_widgets::controls::TerminalWidgetStyle;
let style = TerminalWidgetStyle::from_theme(Theme::dark());
assert_eq!((style.width, style.height), (760.0, 280.0));
assert_eq!((style.line_height, style.char_width), (19.0, 7.8));Fields§
§background: ColorRounded terminal surface fill.
border: BorderUnfocused outer border.
focus_ring: BorderBorder repainted over the outer border while focused.
text: TextStyleBase monospace terminal text style.
selection_background: ColorSelection highlight fill.
cursor: ColorCursor fill.
scrollbar_track: ColorScrollbar track fill.
scrollbar_thumb: ColorScrollbar thumb fill.
diagnostic_error: ColorError diagnostic accent.
diagnostic_warning: ColorWarning diagnostic accent.
diagnostic_info: ColorInformational diagnostic accent.
diagnostic_hint: ColorHint diagnostic accent.
radius: RadiusTerminal surface corner radii.
padding_x: f32Horizontal content padding in logical pixels.
padding_y: f32Vertical content padding in logical pixels.
width: f32Intrinsic widget width in logical pixels.
height: f32Intrinsic widget height in logical pixels.
line_height: f32Terminal row height and scroll-line amount in logical pixels.
char_width: f32Fallback cell width without a text system, in logical pixels.
scrollbar_width: f32Scrollbar track/thumb width in logical pixels.
scrollbar_inset: f32Scrollbar distance from widget edges and reserved content gap.
Implementations§
Source§impl TerminalWidgetStyle
impl TerminalWidgetStyle
Sourcepub fn from_theme(theme: Theme) -> Self
pub fn from_theme(theme: Theme) -> Self
Resolves the dark terminal presentation from a UI theme.
§Examples
use ailloli_ui_core::Theme;
use ailloli_ui_widgets::controls::TerminalWidgetStyle;
let style = TerminalWidgetStyle::from_theme(Theme::default());
assert_eq!((style.padding_x, style.padding_y), (12.0, 10.0));
assert_eq!((style.scrollbar_width, style.scrollbar_inset), (6.0, 4.0));Trait Implementations§
Source§impl Clone for TerminalWidgetStyle
impl Clone for TerminalWidgetStyle
Source§fn clone(&self) -> TerminalWidgetStyle
fn clone(&self) -> TerminalWidgetStyle
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TerminalWidgetStyle
impl Debug for TerminalWidgetStyle
Source§impl Default for TerminalWidgetStyle
impl Default for TerminalWidgetStyle
Source§impl PartialEq for TerminalWidgetStyle
impl PartialEq for TerminalWidgetStyle
impl StructuralPartialEq for TerminalWidgetStyle
Auto Trait Implementations§
impl Freeze for TerminalWidgetStyle
impl RefUnwindSafe for TerminalWidgetStyle
impl Send for TerminalWidgetStyle
impl Sync for TerminalWidgetStyle
impl Unpin for TerminalWidgetStyle
impl UnwindSafe for TerminalWidgetStyle
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
§fn into_click_action(self) -> ClickAction<A>
fn into_click_action(self) -> ClickAction<A>
Implements the into_click_action helper used by this module.