Use shared theme tokens across components

- Replace remaining raw component metrics with theme constants.
- Share disabled opacity, focus ring alpha, and code line height.
- Route editor borders, weights, and links through the theme.
- Align tab, alert, toast, panel, and resize spacing.
This commit is contained in:
2026-11-16 18:35:00 +07:00
parent 9e61147ca9
commit 1dafa87bef
27 changed files with 136 additions and 89 deletions
+18
View File
@@ -29,6 +29,24 @@ use std::time::Duration;
/// The hairline width of the control border every button and field paints.
pub const BORDER_WIDTH: Pixels = px(1.0);
/// The underline and drop indicators a tab strip paints.
pub const TAB_INDICATOR_WIDTH: Pixels = px(2.0);
/// Opacity applied to disabled controls.
pub const DISABLED_OPACITY: f32 = 0.5;
/// The focus ring's ink alpha.
pub const FOCUS_RING_ALPHA: f32 = 0.5;
/// The narrowest a popover may grow.
pub const POPOVER_MIN_WIDTH: Pixels = px(128.0);
/// The default minimum width of a dialog.
pub const DIALOG_MIN_WIDTH: Pixels = px(384.0);
/// The default minimum width of a menu.
pub const MENU_MIN_WIDTH: Pixels = px(224.0);
/// The width of the pushed-alert stack.
pub const ALERT_STACK_WIDTH: Pixels = px(320.0);
/// The width of the speech waveform strip.
pub const SPEECH_WAVEFORM_WIDTH: Pixels = px(96.0);
/// The line-height ratio of monospace code.
pub const CODE_LINE_HEIGHT: f32 = 1.5;
/// The tallest an anchored popup's list may grow.
pub const POPUP_MAX_HEIGHT: Pixels = px(320.0);
/// The widest a tooltip may grow.