Lead Appearance with light and dark, and stop pages listing whole datasets
Appearance was six cards deep and Light/Dark was the third of them, below the wallpaper grid and the entire lock screen -- so the control reached most often was the last one you got to. It is five tabs now, Theme first. The mock showed four; the page turned out to have eleven cards, so Titlebars and Windows became Windows, and Clock and vitals became Shell, rather than pretending four would hold them. Region, Date & Time and Displays each rendered a complete dataset as rows: every installed locale, the whole tz database, every mode the monitor advertises. The chooser was never the problem -- SearchPicker already existed and worked. It was simply rendered always-expanded, so the one line saying what is currently set sat under hundreds that were not. PickerRow collapses each behind its current value and closes again once something is picked. The avatar never appeared to change because accountsservice writes every picture to the same path, leaving the URL byte-identical while Qt served its cached image. cache:false was already set and could not have helped: an unchanged source is never re-read at all. avatarUrl now carries a revision fragment, bumped only when a write actually succeeds. Pictures are cropped before they are set, in the picture's own pixel coordinates so the result does not depend on the size it happened to be displayed at, and written out at 512x512 through GdkPixbuf -- already a dependency here, so nothing new is required. Snapshots listed nothing. The timeline and its Delete buttons existed the whole time, behind a row labelled "Browse...", a word that promises a file browser. The three most recent points are shown inline now, with the rest one press away. qmldir-registration-contract exists because an unregistered component is not a quiet problem: Quickshell fails the entire configuration on it, so the settings window dies and the bar and dock go with it. That happened twice while writing this, both times on a machine somebody was using. It is pure file inspection, so it runs before a change ever reaches the running shell. Claude-Session: https://claude.ai/code/session_01BRvzt4H8XXLPVH5MyYdk9L
This commit is contained in:
@@ -41,9 +41,22 @@ Singleton {
|
||||
|
||||
readonly property var others: root.users.filter(user => user.userName !== root.currentUser)
|
||||
|
||||
// Bumped once a picture has actually been set, and only then.
|
||||
//
|
||||
// accountsservice writes every avatar to the same path, so choosing a new
|
||||
// picture leaves iconFile byte-identical and the URL never changes. Qt keys
|
||||
// its image cache on that URL, so the old picture stayed on screen and the
|
||||
// page looked broken while the write had in fact succeeded. The fragment
|
||||
// moves the cache key without changing the file the URL resolves to.
|
||||
property int iconRevision: 0
|
||||
|
||||
// Set while a picture is being written, so the revision is bumped for a
|
||||
// genuine change rather than on every refresh that happens to pass through.
|
||||
property bool settingIcon: false
|
||||
|
||||
// The avatar, as a URL the shell can draw, or "" when none is set.
|
||||
readonly property string avatarUrl: root.me && String(root.me.iconFile ?? "") !== ""
|
||||
? "file://" + root.me.iconFile
|
||||
? "file://" + root.me.iconFile + "#v" + root.iconRevision
|
||||
: ""
|
||||
|
||||
function displayName(user: var): string {
|
||||
@@ -65,6 +78,11 @@ Singleton {
|
||||
root.currentUser = String(parsed.currentUser ?? "");
|
||||
root.administratorCount = Number(parsed.administratorCount ?? 0);
|
||||
root.lastError = String(parsed.error ?? "");
|
||||
if (root.settingIcon) {
|
||||
root.settingIcon = false;
|
||||
if (root.lastError === "")
|
||||
root.iconRevision += 1;
|
||||
}
|
||||
} catch (error) {
|
||||
root.lastError = "Could not read the account service's answer.";
|
||||
console.warn("Accounts: could not parse helper output:", error);
|
||||
@@ -85,9 +103,18 @@ Singleton {
|
||||
}
|
||||
|
||||
function setIcon(userName: string, path: string): void {
|
||||
root.settingIcon = true;
|
||||
root.run(["set-icon", userName, path]);
|
||||
}
|
||||
|
||||
// The same, from a square chosen in the picture's own pixels.
|
||||
function setIconCropped(userName: string, path: string,
|
||||
x: int, y: int, size: int): void {
|
||||
root.settingIcon = true;
|
||||
root.run(["set-icon", userName, path,
|
||||
String(Math.round(x)), String(Math.round(y)), String(Math.round(size))]);
|
||||
}
|
||||
|
||||
function setAccountType(userName: string, kind: string): void {
|
||||
root.run(["set-account-type", userName, kind]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user