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
90 lines
2.5 KiB
QML
90 lines
2.5 KiB
QML
// Page-level tabs, for a page that is genuinely several subjects.
|
|
//
|
|
// SettingsTabs {
|
|
// tabs: [{ value: "theme", label: "Theme" }, …]
|
|
// current: root.tab
|
|
// onSelected: value => root.tab = value
|
|
// }
|
|
//
|
|
// Only for pages long enough that scrolling hides the control someone came for.
|
|
// Appearance was six cards deep, so light and dark -- the thing reached most --
|
|
// sat below a wallpaper grid and an entire lock screen. Tabs are not a way to
|
|
// make a short page look organised; they are for when the page is long enough
|
|
// that the order stops being a suggestion and starts being a burial.
|
|
|
|
import QtQuick
|
|
import qs.config
|
|
|
|
Item {
|
|
id: root
|
|
|
|
// [{ value, label }]
|
|
property var tabs: []
|
|
property string current: ""
|
|
|
|
signal selected(string value)
|
|
|
|
width: parent ? parent.width : 620
|
|
implicitHeight: 40
|
|
|
|
Row {
|
|
id: strip
|
|
anchors.left: parent.left
|
|
anchors.bottom: parent.bottom
|
|
spacing: 2
|
|
|
|
Repeater {
|
|
model: root.tabs
|
|
|
|
delegate: Item {
|
|
id: tab
|
|
|
|
required property var modelData
|
|
|
|
readonly property bool active: String(tab.modelData.value) === root.current
|
|
|
|
implicitWidth: caption.implicitWidth + 30
|
|
implicitHeight: 38
|
|
|
|
Text {
|
|
id: caption
|
|
anchors.centerIn: parent
|
|
text: String(tab.modelData.label ?? "")
|
|
color: tab.active ? Theme.fg : (hover.hovered ? Theme.fgDim : Theme.fgMuted)
|
|
font.family: Theme.fontFamily
|
|
font.pixelSize: Theme.fontSize
|
|
font.weight: tab.active ? Font.DemiBold : Font.Medium
|
|
}
|
|
|
|
Rectangle {
|
|
anchors.left: parent.left
|
|
anchors.right: parent.right
|
|
anchors.bottom: parent.bottom
|
|
height: 2
|
|
radius: 1
|
|
visible: tab.active
|
|
color: Theme.accent
|
|
}
|
|
|
|
HoverHandler {
|
|
id: hover
|
|
cursorShape: Qt.PointingHandCursor
|
|
}
|
|
|
|
TapHandler {
|
|
onTapped: root.selected(String(tab.modelData.value))
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
Rectangle {
|
|
anchors.left: parent.left
|
|
anchors.right: parent.right
|
|
anchors.bottom: parent.bottom
|
|
height: 1
|
|
color: Theme.alpha(Theme.fg, 0.08)
|
|
z: -1
|
|
}
|
|
}
|