Halve Style.gapsOut relative to Hyprland's general:gaps_out
The Hyprland gaps_out value (10px out of the box) reads well as a window-to-window gap but felt cavernous when used as the screen-edge margin for panels and notifications. Halve it at the source — panels that anchor via PopupCard.margin, the launcher / clipboard / emojis / polkit / menu / settings card-width clamps, and the notification popup margins all read Style.gapsOut, so one tweak moves them in lockstep. Revert the per-call /2 in the notifications service, since Style.gapsOut now already encodes the smaller value.
This commit is contained in:
@@ -8,10 +8,13 @@ import Quickshell.Io
|
||||
// rounding, gap to screen edges, state affordances, spacing, typography
|
||||
// scale, and bar dimensions.
|
||||
//
|
||||
// `cornerRadius` mirrors Hyprland's `decoration:rounding`, and `gapsOut`
|
||||
// mirrors `general:gaps_out`. Themes and user Hyprland config own those
|
||||
// values; the shell picks them up by re-running `hyprctl getoption` on
|
||||
// startup and after theme IPC applies a theme.
|
||||
// `cornerRadius` mirrors Hyprland's `decoration:rounding`. `gapsOut` is
|
||||
// half of Hyprland's `general:gaps_out` — Hyprland's value works well as
|
||||
// a window-to-window gap but feels too cavernous when used as the
|
||||
// distance from a panel/notification to the screen edge, so the shell
|
||||
// halves it. Themes and user Hyprland config own those values; the
|
||||
// shell picks them up by re-running `hyprctl getoption` on startup and
|
||||
// after theme IPC applies a theme.
|
||||
//
|
||||
// Typography, spacing, and bar size come from theme/shell.toml.
|
||||
// `[font] base-size` is the rem root; every `Style.font.<token>` derives
|
||||
@@ -24,7 +27,7 @@ QtObject {
|
||||
id: root
|
||||
|
||||
property int cornerRadius: 0
|
||||
property int gapsOut: 10
|
||||
property int gapsOut: 5
|
||||
|
||||
// ---------------------------------------------------------- state tokens
|
||||
//
|
||||
@@ -349,7 +352,7 @@ QtObject {
|
||||
var css = String(json.css || "")
|
||||
var parts = css.match(/-?\d+(?:\.\d+)?/g) || []
|
||||
var n = parts.length > 0 ? Number(parts[0]) : Number(json.int)
|
||||
if (isFinite(n) && n >= 0) gapsOut = Math.round(n)
|
||||
if (isFinite(n) && n >= 0) gapsOut = Math.max(0, Math.round(n / 2))
|
||||
} catch (e) {
|
||||
// hyprctl missing / Hyprland not running — leave the previous value.
|
||||
}
|
||||
|
||||
@@ -802,10 +802,10 @@ Item {
|
||||
right: service.barPosition !== "left"
|
||||
}
|
||||
margins {
|
||||
top: service.barPosition === "top" ? service.liveBarSize + Math.round(Style.gapsOut / 2) : Math.round(Style.gapsOut / 2)
|
||||
bottom: service.barPosition === "bottom" ? service.barClearance : Style.gapsOut
|
||||
left: service.barPosition === "left" ? service.barClearance : Style.gapsOut
|
||||
right: service.barPosition === "right" ? service.barClearance : Math.round(Style.gapsOut / 2)
|
||||
top: service.barPosition === "top" ? service.barClearance : Style.gapsOut
|
||||
bottom: service.barPosition === "bottom" ? service.barClearance : Style.gapsOut
|
||||
left: service.barPosition === "left" ? service.barClearance : Style.gapsOut
|
||||
right: service.barPosition === "right" ? service.barClearance : Style.gapsOut
|
||||
}
|
||||
|
||||
implicitWidth: popupColumn.implicitWidth
|
||||
|
||||
Reference in New Issue
Block a user