Files
magpie/internal/gui/assets/omarchy.css
T
yetone bf25a3ae80 omarchy: on Omarchy, magpie is drawn in Omarchy's own design language, follows its theme, drops its panel under the bar as Omarchy's own menus do, and can put its icon in Omarchy's bar (让整个UI/UX完全符合Omarchy的设计语言…单独对Omarchy做这个支持,现在的UI/UX当然要保留) — on Hyprland magpie looked like any other GTK app: its own light/dark palette, rounded shadowed popups, and a tray panel floated framed and dimmed in the middle of the screen, labelled with the program's name, never closing on a click elsewhere (focus follows the mouse there, so Wails turns off focus-lost hiding), and its tray icon was hidden in the bar's drawer. Now, only when Omarchy is detected (internal/omarchy: ~/.local/share/omarchy and its current theme), boot.js hands the page the current theme (colors.toml, the shell's theme TOML, Hyprland's border size, colour and rounding, Omarchy's font) as CSS variables before the first paint, and omarchy.css, all under html.omarchy, draws flat as Omarchy's shell does: the theme's background, no shadows or blur, corners as round as Hyprland's windows, popups and dialogs framed by the active border's colour, uppercase letter-spaced labels, rows and picks as a faint fill with the text in the accent. /api/omarchy is polled every 2.5s, so a theme picked in Omarchy's menu reaches the windows at once; Settings → Appearance shows the theme's name instead of Light/Dark/System. Under Hyprland the tray panel gets a title of its own ("magpie panel", set through GTK since Wails leaves frameless windows untitled), and each opening gives Hyprland a named Lua window rule placing it under the bar at the click, 6px in from the edges, pinned, opaque, borderless; its height is capped to the work area. While it is open a non-consuming left-click bind emits a custom event on Hyprland's socket2; a click outside the panel and below the bar closes it (the bar is left to its icons, so the icon toggles), and the bind is removed on close or, after Escape, on the next click. The tray item's SNI id is "magpie" instead of "Wails", so it can be pinned. Settings → Bar icon (状态栏图标), shown only in the app on Omarchy's Hyprland, puts an Omarchy bar-widget plugin (usemagpie.magpie, a bird glyph, in ~/.config/omarchy/plugins, then rescanPlugins and plugin enable) beside Omarchy's own icons: a click runs magpie panel, a right-click magpie app; Off disables and removes it; a widget pointing at a moved or older magpie is rewritten at start. magpie panel (new) opens the quick panel, starting magpie if needed, or toggles it in the running instance. Elsewhere nothing changes. Tested in a Hyper-V VM on the latest Omarchy (Hyprland 0.56, 2528×960 at scale 1.6): the look with tokyo-night; the panel at [1134,32] under the bar; clicks on the panel and the bar keep it open, a click on another window closes it, the icon toggles it, Escape closes it and the bind goes; Bar icon On adds the bird to the bar, its click opens the panel under it (also with magpie not running), a second click closes it, right-click opens the window, Off removes it; autostart becomes app-magpie@autostart through systemd's XDG generator; the launcher entry and icon are there. Go: internal/omarchy tests (theme parsing, panel placement on scaled and turned monitors, click-outside geometry, widget files quoted with the executable, KeepWidget rewriting only a stale one). A new internal/gui/tests/omarchy.test.cjs, Chromium and WebKit, en and zh: with no Omarchy theme the page has no omarchy class or theme style, the Appearance choices show, no Bar icon row, nothing asked of /api/omarchy; with one, the theme's background, square corners, its name, and Bar icon's On and Off each posted with nothing scrolled, hidden when the bar isn't there. old-webkit now lets omarchy.js load in the head beside boot.js (it does nothing off Omarchy). The full GUI suite, gofmt, go vet, go build (GOOS=linux, GOOS=windows) and go test -tags nogui ./... pass. Not tried: other Hyprland setups than Omarchy's, a multi-monitor VM, and the GTK4 build in the VM (gtk3 was used).
2026-09-30 04:58:11 +08:00

67 lines
4.4 KiB
CSS

/* Omarchy: magpie drawn in Omarchy's own design language, only on Omarchy.
omarchy.js puts the class on <html> and the theme's colours, font, border
and rounding (from ~/.local/state/omarchy/current/theme and Hyprland) in
the variables; everything here is scoped under html.omarchy, so no other
system sees any of it. Omarchy's shell draws flat: no shadows, no blur, no
rounding (Hyprland's decoration:rounding, 0 by default), popups framed by
the window border's colour, uppercase letter-spaced labels, and a row
picked out by a faint fill with its text in the accent. */
/* what only Omarchy shows, and what it hides: the Appearance setting follows
Omarchy's theme instead of offering light and dark */
.om-only { display: none !important; }
html.omarchy .om-hide { display: none !important; }
html.omarchy .om-only { display: revert !important; }
html.omarchy .om-theme-name { color: var(--accent); font-size: 12px; white-space: nowrap; }
html.omarchy, html.omarchy body { font-family: var(--font); font-size: var(--om-size); }
html.omarchy body { -webkit-font-smoothing: antialiased; }
/* square, or rounded as far as Hyprland rounds its windows; what spins or
draws a dial stays round, as does a slider.s knob; a status dot goes square, like Omarchy.s workspace marks */
html.omarchy *, html.omarchy *::before, html.omarchy *::after { border-radius: var(--om-radius) !important; }
html.omarchy :is(.pq-dial, .pq-dial b, .sk-ring, .si-spin, .mk-spin, .signing .spinner, .eslide .knob, .effort-ticks i),
html.omarchy input[type="range"]::-webkit-slider-thumb { border-radius: 50% !important; }
/* no shadows or frosted glass: surfaces are the theme's background */
html.omarchy * { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
html.omarchy :is(.pop, .modal .dialog, .status.lift, body.panel .profiles.open, .list, body.panel .list, .seg > .thumb) { box-shadow: none; }
html.omarchy body.panel { background: var(--bg); border: var(--om-border) solid var(--om-edge); }
/* popups, menus and dialogs: framed by the window border's colour */
html.omarchy :is(.pop, body.panel .profiles.open, .status.lift) { background: var(--pop-bg); border: var(--om-border) solid var(--om-edge) !important; }
html.omarchy .modal { background: color-mix(in srgb, var(--bg) 55%, transparent); }
html.omarchy .modal .dialog { background: var(--bg); border: var(--om-border) solid var(--om-edge); }
/* labels as Omarchy's shell sets its headings: uppercase, spaced out */
html.omarchy :is(.label, .pop li.group, .kpi span, .editor .ehead + * .k) { letter-spacing: .12em; text-transform: uppercase; font-weight: 500; }
html.omarchy .brand { letter-spacing: 0; font-weight: 700; }
/* the tabs: no track, the chosen one a faint square with its text in the accent */
html.omarchy .seg { background: transparent; }
html.omarchy .seg > .thumb { background: var(--om-sel); }
html.omarchy :is(.seg button.on, .ptabs button.on, .opt.on) { color: var(--accent); }
html.omarchy :is(.segs, .ptabs) { background: transparent; }
html.omarchy :is(.segs, .ptabs) > .thumb { background: var(--om-sel); box-shadow: inset 0 0 0 1px var(--om-sel-line); }
/* lists: a hairline frame, rows picked out by a faint fill */
html.omarchy .list { border: 1px solid var(--line); background: transparent; }
html.omarchy .row:hover { background: var(--om-hover); }
/* controls: Omarchy's buttons are a faint fill under a thin edge */
html.omarchy .field, html.omarchy body.panel .field, html.omarchy body.panel .field:hover { background: var(--om-hover); box-shadow: inset 0 0 0 1px var(--om-hover-line); }
html.omarchy .field:hover { background: var(--om-sel); }
html.omarchy .field.open, html.omarchy body.panel .field.open { box-shadow: inset 0 0 0 1px var(--accent); }
html.omarchy .icon:hover { background: var(--om-sel); color: var(--accent); }
html.omarchy .text.primary { background: var(--accent); color: var(--accent-fg); }
/* a menu's row under the cursor or keys: the fill and the accent, like Walker's */
html.omarchy :is(.pop li.sel, .pop li:hover:not(.group), .row-menu .rm-item:not(:disabled):is(:hover, :focus)) { background: var(--om-sel); color: var(--accent); }
html.omarchy :is(.pop li.sel, .pop li:hover) :is(.v, .n) { color: inherit; }
/* Linux's close button: square like the rest */
html.omarchy .icon.winclose { background: transparent; }
html.omarchy .icon.winclose:hover { background: var(--red-soft); color: var(--red); }
html.omarchy ::selection { background: var(--om-sel); color: var(--accent); }