pub struct CommandPaletteStyle {Show 21 fields
pub input: TextInputStyle,
pub popup: SelectStyle,
pub backdrop: Color,
pub panel_background: Color,
pub border: Border,
pub shadows: Vec<BoxShadow>,
pub title_text: TextStyle,
pub subtitle_text: TextStyle,
pub shortcut_text: TextStyle,
pub no_results_text: TextStyle,
pub icon_tint: Color,
pub disabled_opacity: f32,
pub width: f32,
pub input_height: f32,
pub row_height: f32,
pub panel_max_height: f32,
pub panel_top: f32,
pub padding: f32,
pub gap: f32,
pub icon_size: f32,
pub radius: Radius,
}Expand description
Resolved nested styles, colors, typography, and logical-pixel geometry.
Self::popup owns the actual panel shell fill/border. The separate
panel_background and border fields are retained for compatibility but are
not currently read by the painter. radius is used for panel shadows while
the popup style owns shell radius.
§Examples
use ailloli_ui_core::Theme;
use ailloli_ui_widgets::controls::{CommandPaletteSize, CommandPaletteStyle};
let style = CommandPaletteStyle::from_theme(Theme::dark(), CommandPaletteSize::Compact);
assert_eq!(style.width, 430.0);
assert_eq!(style.row_height, 38.0);Fields§
§input: TextInputStyleSingle-line query input style.
popup: SelectStylePanel shell and active-row style.
backdrop: ColorFull-host overlay fill.
panel_background: ColorReserved panel fill; current shell uses popup.background.
border: BorderReserved panel border; current shell uses popup.border.
shadows: Vec<BoxShadow>Panel shadows; inset entries are skipped.
title_text: TextStyleCommand title text style.
subtitle_text: TextStyleOptional command subtitle style.
shortcut_text: TextStyleRight-aligned shortcut hint style.
no_results_text: TextStyleEmpty-filter-result message style.
icon_tint: ColorLeading command icon tint.
disabled_opacity: f32Alpha multiplier used for disabled items and empty-result text.
width: f32Preferred panel width and nested popup width.
input_height: f32Query input height.
row_height: f32Command row and scroll-line height; callers should keep it positive.
panel_max_height: f32Maximum complete panel height.
panel_top: f32Preferred distance from the host’s top edge.
padding: f32Panel/input/row horizontal inset.
gap: f32Gap after leading icons and before shortcut hints.
icon_size: f32Leading icon width and height.
radius: RadiusRadius used for panel shadow bounds.
Implementations§
Source§impl CommandPaletteStyle
impl CommandPaletteStyle
Sourcepub fn from_theme(theme: Theme, size: CommandPaletteSize) -> Self
pub fn from_theme(theme: Theme, size: CommandPaletteSize) -> Self
Resolves nested input/popup styles and palette geometry from theme/size.
Both built-in sizes cap the list viewport at 260 logical pixels and the whole panel at 360 logical pixels.
§Examples
use ailloli_ui_core::Theme;
use ailloli_ui_widgets::controls::{CommandPaletteSize, CommandPaletteStyle};
let style = CommandPaletteStyle::from_theme(Theme::dark(), CommandPaletteSize::Default);
assert_eq!((style.width, style.input_height), (520.0, 40.0));
assert_eq!(style.panel_max_height, 360.0);Trait Implementations§
Source§impl Clone for CommandPaletteStyle
impl Clone for CommandPaletteStyle
Source§fn clone(&self) -> CommandPaletteStyle
fn clone(&self) -> CommandPaletteStyle
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CommandPaletteStyle
impl Debug for CommandPaletteStyle
Auto Trait Implementations§
impl Freeze for CommandPaletteStyle
impl RefUnwindSafe for CommandPaletteStyle
impl Send for CommandPaletteStyle
impl Sync for CommandPaletteStyle
impl Unpin for CommandPaletteStyle
impl UnwindSafe for CommandPaletteStyle
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.