pub struct Theme {
pub background: Color,
pub label: Color,
pub secondary_label: Color,
pub accent: Color,
pub separator: Color,
pub row_highlight: Color,
pub row_font: Font,
pub header_font: Font,
pub row_height: f32,
pub corner_radius: f32,
pub padding: Insets,
pub column_gap: f32,
}Expand description
The full visual theme. Every semantic Color resolves against one of these,
and spacing/radius/row-height are tunable so a consumer can fully restyle.
Fields§
§background: ColorPopup background fill.
label: ColorPrimary text color.
secondary_label: ColorDe-emphasized text color.
accent: ColorAccent color (selection, checkmarks).
separator: ColorSeparator / hairline color.
row_highlight: ColorRow background when hovered/selected.
row_font: FontDefault row font.
header_font: FontSection-header font.
row_height: f32Default row height in logical points.
corner_radius: f32Corner radius of the popup panel in logical points. (The hover highlight uses its own fixed selection radius, independent of this value.)
padding: InsetsInner padding of the popup.
column_gap: f32Horizontal gap between leading icon, segments, and trailing column.
Implementations§
Source§impl Theme
impl Theme
Sourcepub fn native() -> Self
pub fn native() -> Self
The native light theme: light() with a translucent
background so OS vibrancy shows through.
The platform present path composites the raster surface over a native
effect backdrop (NSVisualEffectView on macOS, DWM acrylic on Windows)
using per-pixel alpha (spec 10-rendering-layout.md §11, locked decision
#6); every other field stays the same as light(). The alpha here is a
fixed ~82% (209 / 255), approximating the macOS vibrancy material.
Sourcepub fn native_dark() -> Self
pub fn native_dark() -> Self
Sourcepub fn macos(dark: bool) -> Theme
pub fn macos(dark: bool) -> Theme
The macOS menu theme (Big Sur+ NSMenu): translucent vibrancy background,
tight rows, ~6pt corner radius, SF at the OS menu size. The platform
backend injects the live accent, label/separator colors (NSColor), and
the SF face + point size on top; these are the native-accurate defaults.
Metrics are the named MACOS_* reference constants (each documents its
native NSMenu source); values still needing a pixel-accurate capture are
flagged DEVICE-VERIFY(0.10.8) at their definition.
Sourcepub fn windows(dark: bool) -> Theme
pub fn windows(dark: bool) -> Theme
The Windows 11 menu-flyout theme: acrylic (translucent) background,
generously padded rows, 8pt rounded corners, Segoe UI at the OS size. The
Windows backend injects the live accent (DwmGetColorizationColor),
menu text/graytext colors (GetSysColor), and the Segoe UI face + size.
DEVICE-VERIFY: metrics matched to the Win11 flyout by eye; nudge here.
Sourcepub fn gnome(dark: bool) -> Theme
pub fn gnome(dark: bool) -> Theme
The GNOME/Adwaita menu theme (GTK4 popover): a flat, opaque surface
(Linux/X11 has no vibrancy backdrop), 12pt rounded corners, roomy rows,
Adwaita colors. The Linux backend injects the live accent and, where the
desktop exposes it, the UI font; menu text colors are Adwaita constants
(GNOME does not expose them over gsettings).
DEVICE-VERIFY: metrics matched to the Adwaita popover by eye; nudge here.
Sourcepub fn for_family(family: OsFamily, dark: bool) -> Theme
pub fn for_family(family: OsFamily, dark: bool) -> Theme
Sourcepub fn make_opaque(&mut self)
pub fn make_opaque(&mut self)
Force the background fully opaque (alpha 255), preserving its RGB. Used when the user has disabled OS transparency/vibrancy so the menu is solid instead of translucent-over-nothing.