struct MenuBarStyle
Swift
struct MenuBarStyle
How a menubar strip and its dropdowns look.
The IR (MenuModel) is just titles and actions; this is the paint. An
in-window bar wants a filled strip and a theme.panel popup. A desktop
panel already paints its own gradient and wants the titles to sit on it
with a matching, compact dropdown — pass .panel() there rather than
restyle every row.
Sources/LavaUI/MenuBarView.swift:14
Constructors
init(stripFill: Color?, stripHeight: Float?, titlePadding: EdgeInsets, iconPadding: EdgeInsets, titleCornerRadius: Float, titleHover: Color, titleOpenFill: Color, itemPadding: EdgeInsets, itemCornerRadius: Float, itemHover: Color, itemSpacing: Float, dropdownPadding: Float, dropdownMinWidth: Float, dropdownBackground: Color, dropdownBorder: Color?, dropdownCornerRadius: Float, dropdownBlur: Float?)
Creates a style from every metric. standard() and panel() are the usual starting points.
Sources/LavaUI/MenuBarView.swift:55
Properties
var dropdownBackground: Color
Fill behind the dropdown.
Sources/LavaUI/MenuBarView.swift:46
var dropdownBlur: Float?
Radius of the frosted-glass blur behind the dropdown, or nil for a plain fill.
Sources/LavaUI/MenuBarView.swift:52
var dropdownBorder: Color?
Outline of the dropdown, or nil for none.
Sources/LavaUI/MenuBarView.swift:48
var dropdownCornerRadius: Float
Corner radius of the dropdown, in points.
Sources/LavaUI/MenuBarView.swift:50
var dropdownMinWidth: Float
Narrowest the dropdown is drawn, in points.
Sources/LavaUI/MenuBarView.swift:44
var dropdownPadding: Float
Space between the dropdown's edge and its rows, in points.
Sources/LavaUI/MenuBarView.swift:42
var iconPadding: EdgeInsets
Inset around an icon-only title. Tighter than titlePadding so a
18pt mark does not sit in a text-sized chip.
Sources/LavaUI/MenuBarView.swift:25
var itemCornerRadius: Float
Corner radius of a row's hover fill, in points.
Sources/LavaUI/MenuBarView.swift:36
var itemHover: Color
Fill under a row while the pointer is over it.
Sources/LavaUI/MenuBarView.swift:38
var itemPadding: EdgeInsets
Inset around each dropdown row.
Sources/LavaUI/MenuBarView.swift:34
var itemSpacing: Float
Space between dropdown rows, in points.
Sources/LavaUI/MenuBarView.swift:40
var overlayStyle: OverlayStyle { get }
Overlay chrome for the dropdown (and anything else that should match it — a panel clock or volume popover).
Sources/LavaUI/MenuBarView.swift:95
var stripFill: Color?
Fill behind the title strip. nil leaves whatever is already there.
Sources/LavaUI/MenuBarView.swift:16
var stripHeight: Float?
Forced strip height. nil sizes to the titles, which is what a
panel wants when the strip itself is already a fixed 32pt.
Sources/LavaUI/MenuBarView.swift:19
var titleCornerRadius: Float
Corner radius of a title's hover and open fill, in points.
Sources/LavaUI/MenuBarView.swift:27
var titleHover: Color
Fill under a title while the pointer is over it.
Sources/LavaUI/MenuBarView.swift:29
var titleOpenFill: Color
Fill under an open title, so the chip stays lit after the pointer has moved into the dropdown.
Sources/LavaUI/MenuBarView.swift:32
var titlePadding: EdgeInsets
Inset around each text title. All the room there is: a Text's box
is its glyphs.
Sources/LavaUI/MenuBarView.swift:22
Methods
static func panel(theme: Theme = Theme.current) -> MenuBarStyle
Desktop panel: no strip fill (the bar already painted one), compact rows, and a popup that wears the desktop theme rather than a hard-coded indigo wash.
The old fill was 0.10, 0.10, 0.24 at alpha 0.88. Linear blending
lets ~0.30 of the desktop through at that alpha, which is why the
menu read as a stained-glass pane instead of a surface — see
docs/colour-and-blending.md. Without compositor frost the useful
band is 0.97–1.0. With frost (a client that filled
BackdropBridge.frostOverlays) the wash can drop so the blur shows.
Sources/LavaUI/MenuBarView.swift:143
static func standard(theme: Theme = Theme.current) -> MenuBarStyle
In-window bar: filled strip, theme colours, room for shortcuts.
Sources/LavaUI/MenuBarView.swift:107