pub struct SelectionStyle {
pub kind: SelectionKind,
pub highlight: Color,
pub handle: Color,
pub zoom: f32,
}Expand description
Theme-extension value carrying the selection look — see the module doc.
Fields§
§kind: SelectionKind§highlight: ColorTint painted behind the selected glyphs.
handle: ColorHandle grip/bar color.
zoom: f32Glass only: lens magnification (1.0 = no zoom).
Implementations§
Source§impl SelectionStyle
impl SelectionStyle
Sourcepub fn flat() -> Self
pub fn flat() -> Self
The Material/default look — exactly the colors the widgets used before selection became themeable.
Sourcepub fn glass() -> Self
pub fn glass() -> Self
The Liquid-Glass look: cooler, softer tint; near-white glass handles; a magnifier lens over the selected run. Zoom is a subtle 1.15x “lift” — a stronger lens crops the ends of the selection out of the pill (physically correct, but wrong as selection UX; found live at 1.35x).
Sourcepub fn lens_uniforms(radius: f32, zoom: f32) -> Vec<u8> ⓘ
pub fn lens_uniforms(radius: f32, zoom: f32) -> Vec<u8> ⓘ
Pack the lens uniforms (radius, zoom + two pad scalars) in the
WGSL layout builtin::SELECTION_LENS declares — four tightly
packed f32s, one 16-byte uniform row.
Sourcepub fn glass_lens(&self, x0: f32, x1: f32, y_top: f32, line_h: f32) -> GlassLens
pub fn glass_lens(&self, x0: f32, x1: f32, y_top: f32, line_h: f32) -> GlassLens
The glass lens geometry for a single-line selection spanning
x0..x1 on a line at y_top with height line_h — the pill rect,
the end-bar x positions, and the grip anchor y. Used by BOTH
TextInput’s painting AND the engine’s handle-drag grab, so the
visible grips and the draggable anchors can never drift apart
(found live: grips pinned at the unzoomed endpoints floated far
inside the pill on wide selections, disconnected from the bars).
Trait Implementations§
Source§impl Clone for SelectionStyle
impl Clone for SelectionStyle
Source§fn clone(&self) -> SelectionStyle
fn clone(&self) -> SelectionStyle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more