Skip to main content

Module recipe_text_selection_style

Module recipe_text_selection_style 

Source
Expand description

Default TextSelectionStyle impl — the shipped look of the touch selection handles and the magnifier.

An accent disc on an accent stem, ringed in the surface colour so it stays visible over text of its own hue; a lens on the editor’s own background with a hairline border. Apps that want another treatment write their own impl TextSelectionStyle and install it theme-wide (theme.style_slots.text_selection = Some(Rc::new(MyHandles))).

The dimensions are not this module’s to invent: they are teksilo_core::text_touch’s constants, because the controller hit-tests a handle from the same numbers the style paints it with, and two copies would drift. Everything this file adds is which token each part is coloured from.

Structs§

RecipeTextSelectionStyle
Default TextSelectionStyle shipped with Teksilo. Colours come from the active theme’s roles, so a theme swap repaints for free.
TextSelectionRecipe
Dimension recipe for RecipeTextSelectionStyle.

Constants§

HANDLE_OUTLINE_WIDTH
Width of the ring drawn around a handle’s disc, in dp.
MAGNIFIER_BORDER_WIDTH
Width of the magnifier’s frame, in dp.
MAGNIFIER_CORNER_RADIUS
Corner radius of the magnifier’s frame, in dp — zero, so the shipped lens is a rectangle.