Close the sweep's last blind spot, and stop shortcuts silently colliding
gapsIn and gapsOut were the only two compositor settings the write sweep had never verified: Hyprland answers for them in CSS shorthand, "5 5 5 5", and the sweep had no way to compare that. The preference behind each is a single int that Hyprland expands to four sides, so a uniform reading compares exactly. A non-uniform one is not something the preference can express, and is skipped rather than collapsed to a number it never wrote. 63 of 63 verified live now, none skipped. Wallpaper thumbnails are cached. The report that five of them sat at "Loading…" was a screenshot taken 1.1 seconds after the page opened -- decoding one of these at tile size takes between 1.2 and 2.6 seconds and about ten start at once, which the code already said. Measuring it did turn up something real though: without a cache, scrolling back up pays that decode again for every tile. The tradeoff is a wallpaper replaced in place showing a stale thumbnail until restart, which is worth it for a directory of files that are added rather than edited. A chord already in use is now named rather than taken: "Super+Q is already Terminal". Two actions on one chord means whichever Hyprland reads last wins, which is not a thing to find out later by pressing it. Rebinding a shortcut to the chord it already holds is correctly not a conflict. Also: Open Appearance lands on the Windows tab now that the page has tabs, Storage points at reclaimable container space, and a dock row shows its desktop id only when two pinned applications share a name -- it is developer text, and repeating it under fifteen recognisable names made the list harder to scan. Written down because it cost the shell: QML has no default parameter values, and `function openSettings(page: string, section: string = "")` fails the entire configuration rather than the one function -- so the bar and dock went with it, and 43 contracts failed at once pointing at the same line. qmllint --bare passes that, which is why the usual check before touching the running shell did not catch it. openSettingsSection exists as a separate function for that reason. Claude-Session: https://claude.ai/code/session_01BRvzt4H8XXLPVH5MyYdk9L
This commit is contained in:
@@ -332,6 +332,21 @@ Singleton {
|
||||
readonly property var groupOrder: ["Focus", "Move & split", "Size", "Window state",
|
||||
"Workspaces", "Applications & shell", "Media & hardware keys"]
|
||||
|
||||
// The action already bound to a chord, or "" if it is free. Compared on the
|
||||
// form keybinds.lua writes rather than the prettified display form, because
|
||||
// that is what a rebind is keyed by -- "SUPER + Q" and "Super+Q" are the
|
||||
// same binding and must not read as two.
|
||||
function boundTo(luaChord: string, exceptLuaChord: string): string {
|
||||
const wanted = String(luaChord).replace(/\s+/g, "").toLowerCase();
|
||||
const skip = String(exceptLuaChord).replace(/\s+/g, "").toLowerCase();
|
||||
for (const bind of root.binds) {
|
||||
const candidate = String(bind.luaChord).replace(/\s+/g, "").toLowerCase();
|
||||
if (candidate === wanted && candidate !== skip)
|
||||
return String(bind.description);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
function grouped(): var {
|
||||
const buckets = {};
|
||||
for (const bind of root.binds) {
|
||||
|
||||
@@ -91,7 +91,31 @@ Singleton {
|
||||
root.activeOverlay = "";
|
||||
}
|
||||
|
||||
// A section within the page, for pages that have tabs. Consumed once by the
|
||||
// page and cleared, rather than bound to -- a binding would pin the tab and
|
||||
// stop anyone changing it by hand once they arrived.
|
||||
property string settingsSection: ""
|
||||
|
||||
function takeSettingsSection(): string {
|
||||
const section = root.settingsSection;
|
||||
root.settingsSection = "";
|
||||
return section;
|
||||
}
|
||||
|
||||
function openSettings(page: string): void {
|
||||
root.settingsSection = "";
|
||||
root.showSettings(page);
|
||||
}
|
||||
|
||||
// Opening straight to a tab within a page. A separate function rather than a
|
||||
// default argument: QML has no default parameter values, and writing one
|
||||
// fails the whole configuration -- which takes the shell down with it.
|
||||
function openSettingsSection(page: string, section: string): void {
|
||||
root.settingsSection = section;
|
||||
root.showSettings(page);
|
||||
}
|
||||
|
||||
function showSettings(page: string): void {
|
||||
const allowed = ["home", "appearance", "displays", "connectivity", "home-phone", "desktop", "sound", "gaming", "notifications", "screen-intelligence", "shortcuts", "mouse", "privacy", "region", "accounts", "accessibility", "power", "datetime", "applications", "updates", "storage", "snapshots", "users", "sharing", "firewall", "printers", "containers", "services", "about"];
|
||||
root.settingsPage = allowed.indexOf(page) >= 0 ? page : "home";
|
||||
DesktopPreferences.set("lastPage", root.settingsPage);
|
||||
|
||||
Reference in New Issue
Block a user