pub struct TerminalViewStyle {Show 25 fields
pub background: Color,
pub border: Border,
pub focus_ring: Border,
pub text: TextStyle,
pub prompt_text: TextStyle,
pub stderr_text: TextStyle,
pub system_text: TextStyle,
pub success_text: TextStyle,
pub warning_text: TextStyle,
pub selection_background: Color,
pub search_background: Color,
pub active_search_background: Color,
pub cursor: Color,
pub scrollbar_track: Color,
pub scrollbar_thumb: 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 cursor_width: f32,
pub scrollbar_width: f32,
pub scrollbar_inset: f32,
}Expand description
Terminal palette, typography, geometry, and scrollbar metrics.
Dimensions are logical pixels. Fields are consumed as supplied; nonpositive line height prevents line painting, while content dimensions are floored at zero. The default uses the default theme.
§Examples
use ailloli_ui_widgets::controls::TerminalViewStyle;
let style = TerminalViewStyle::default();
assert_eq!((style.width, style.height, style.line_height), (680.0, 260.0, 19.0));Fields§
§background: ColorRoot terminal surface.
border: BorderUnfocused root border.
focus_ring: BorderBorder painted in addition while focused.
text: TextStyleNormal stdout text style.
prompt_text: TextStylePrompt and command text style.
stderr_text: TextStyleStderr text style.
system_text: TextStyleSystem/status text style.
success_text: TextStyleSuccess text style.
warning_text: TextStyleWarning text style.
selection_background: ColorSelection highlight color.
search_background: ColorNon-active search-hit color.
active_search_background: ColorFirst search-hit color.
cursor: ColorCursor color.
scrollbar_track: ColorScrollbar track color.
scrollbar_thumb: ColorScrollbar thumb color.
radius: RadiusRoot corner radii.
padding_x: f32Horizontal content inset in logical pixels.
padding_y: f32Vertical content inset in logical pixels.
width: f32Default/intrinsic width in logical pixels.
height: f32Default/intrinsic height in logical pixels.
line_height: f32Row advance and vertical scrolling unit in logical pixels.
char_width: f32Approximate character width used for hit testing and highlights.
cursor_width: f32Painted cursor width in logical pixels.
scrollbar_width: f32Scrollbar track/thumb width in logical pixels.
scrollbar_inset: f32Scrollbar inset from the right/top/bottom edges in logical pixels.
Implementations§
Source§impl TerminalViewStyle
impl TerminalViewStyle
Sourcepub fn from_theme(theme: Theme) -> Self
pub fn from_theme(theme: Theme) -> Self
Derives a dark terminal palette from theme with fixed geometry defaults.
§Examples
use ailloli_ui_core::Theme;
use ailloli_ui_widgets::controls::TerminalViewStyle;
let style = TerminalViewStyle::from_theme(Theme::default());
assert_eq!((style.padding_x, style.padding_y, style.char_width), (12.0, 10.0, 7.8));Trait Implementations§
Source§impl Clone for TerminalViewStyle
impl Clone for TerminalViewStyle
Source§fn clone(&self) -> TerminalViewStyle
fn clone(&self) -> TerminalViewStyle
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TerminalViewStyle
impl Debug for TerminalViewStyle
Source§impl Default for TerminalViewStyle
impl Default for TerminalViewStyle
Source§impl PartialEq for TerminalViewStyle
impl PartialEq for TerminalViewStyle
impl StructuralPartialEq for TerminalViewStyle
Auto Trait Implementations§
impl Freeze for TerminalViewStyle
impl RefUnwindSafe for TerminalViewStyle
impl Send for TerminalViewStyle
impl Sync for TerminalViewStyle
impl Unpin for TerminalViewStyle
impl UnwindSafe for TerminalViewStyle
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.