Files
Panama/config/dot/quickshell/modules/settings/SwitchRow.qml
T
Gabriel Brown a23b42841a Own user accounts and sharing
Two of the panels this desktop still handed to GNOME Settings.

Users manages the account through accountsservice -- the same daemon
GNOME's panel drives, so a name or picture set here is what the login
screen and lock screen read. Name, picture, account type, password,
automatic login, and adding or removing other accounts. Every change is
authorized by polkit through the agent this session already runs; a
dismissed prompt is a normal outcome and says so.

A new password is read from the helper's stdin, hashed by openssl
reading its own stdin, and handed over D-Bus from inside that process.
It is never an argument: argv is world-readable through /proc, so a
password passed that way is published to every process on the machine.
Removing an account takes two presses and says it destroys their files;
the last administrator cannot be removed or demoted, because a machine
nobody can administer is not a state to offer.

Sharing reports what is actually true, including "the software for this
is not installed" -- the honest answer for Samba here, and the case the
panel it replaces shows as a switch that does nothing. Password sign-in
is reported from sshd's configuration rather than assumed: claiming
"keys only" when the file is silent would state a security property that
cannot be backed up.

The Control Center now draws the account's real picture and name. A
generic glyph sat there while a real avatar was already set, which made
the desktop look like it did not know whose it was.

Also here: the KDE Connect contract no longer requires a phone to be
awake. kdeconnectd drops its device objects for a phone it has not seen
recently while the pairing survives in its config, so demanding one
failed whenever the phone was off.

Claude-Session: https://claude.ai/code/session_01BRvzt4H8XXLPVH5MyYdk9L
2026-08-19 13:05:13 -04:00

51 lines
1.4 KiB
QML

// A toggle that is NOT schema-bound.
//
// ToggleRow reads and writes a preference key. Some switches govern system
// state instead -- an account flag, a systemd unit -- which lives outside
// Panama's settings file and is read back from the system that owns it.
import QtQuick
import qs.config
SettingRow {
id: root
property bool checked: false
property bool enabled: true
signal toggled(value: bool)
controlWidth: 54
Rectangle {
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
width: 44
height: 26
radius: height / 2
color: root.checked ? Theme.accent : Theme.alpha(Theme.fg, 0.14)
opacity: root.enabled ? 1 : 0.45
Rectangle {
x: root.checked ? parent.width - width - 3 : 3
anchors.verticalCenter: parent.verticalCenter
width: 20
height: 20
radius: height / 2
color: root.checked ? Theme.bgDark : Theme.fg
// Short and non-repeating: this animates only when someone acts.
Behavior on x {
NumberAnimation { duration: 120; easing.type: Easing.OutCubic }
}
}
MouseArea {
anchors.fill: parent
enabled: root.enabled
cursorShape: Qt.PointingHandCursor
onClicked: root.toggled(!root.checked)
}
}
}