[system/kup] plasmoid-qt6/contents/ui: Modernize applet UI

Nate Graham <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit bf6b21c034700e127854c6ad99161cf749eceb13 by Nate Graham, on behalf of Bharadwaj Raju.
Committed on 27/07/2026 at 14:03.
Pushed by ngraham into branch 'master'.

Modernize applet UI

Changes the applet view to use expandable list items like other Plasma
applets (c.f. Plasma Vault, for one), adds a standard placeholder
message item for the no-plans case, and changes the capitalization of
some button labels to be in line with KDE HIG (e.g. "Save backup" to
"Save Backup"), per https://develop.kde.org/hig/text_and_labels/

![Screenshot_20260722_204157](/uploads/b59b889ff802ce93cb8892f3e022ee94/Screenshot_20260722_204157.png){width=473 height=494}

This is part of https://invent.kde.org/kde-linux/kde-linux/-/work_items/666

M  +28   -64   plasmoid-qt6/contents/ui/FullRepresentation.qml
A  +63   -0    plasmoid-qt6/contents/ui/PlanItem.qml     [License: GPL(3+eV) GPL(v3.0)]

https://invent.kde.org/system/kup/-/commit/bf6b21c034700e127854c6ad99161cf749eceb13

diff --git a/plasmoid-qt6/contents/ui/FullRepresentation.qml b/plasmoid-qt6/contents/ui/FullRepresentation.qml
index 1f38816..754c067 100644
--- a/plasmoid-qt6/contents/ui/FullRepresentation.qml
+++ b/plasmoid-qt6/contents/ui/FullRepresentation.qml
@@ -4,6 +4,7 @@
 
 import QtQuick
 import QtQuick.Layouts
+import QtQuick.Controls as QQC2
 
 import org.kde.plasma.core as PlasmaCore
 import org.kde.plasma.components as PlasmaComponents
@@ -58,75 +59,38 @@ PlasmaComponents.Page {
 			visible: planCount == 0
 		}
 
-		ColumnLayout {
+		PlasmaComponents.ScrollView {
 			anchors.fill: parent
 
-			PlasmaComponents.ScrollView {
-				Layout.fillWidth: true
-				Layout.fillHeight: true
+			PlasmaComponents.ScrollBar.horizontal.policy: PlasmaComponents.ScrollBar.AlwaysOff
 
-				ListView {
-					model: planCount
-					delegate: planDelegate
-					boundsBehavior: Flickable.StopAtBounds
-					spacing: Kirigami.Units.smallSpacing
-				}
-			}
-		}
+			contentWidth: availableWidth - plansList.leftMargin - plansList.rightMargin
+			contentItem: ListView {
+				id: plansList
+				model: planCount
+				clip: true
+				currentIndex: -1
 
-		Component {
-			id: planDelegate
-
-			Column {
-				width: parent.width
-				spacing: Kirigami.Units.largeSpacing
-				RowLayout {
-					width: parent.width
-					Column {
-						Layout.fillWidth: true
-						Kirigami.Heading {
-							level: 3
-							text: getPlanStatus(index, "description")
-						}
-						Kirigami.Heading {
-							level: 4
-							text: getPlanStatus(index, "status heading")
-						}
-						PlasmaComponents.Label {
-							text: getPlanStatus(index, "status details")
-						}
-					}
-					Kirigami.Icon {
-						source: getPlanStatus(index, "icon name")
-						Layout.alignment: Qt.AlignRight | Qt.AlignTop
-						Layout.preferredWidth: Kirigami.Units.iconSizes.huge
-						Layout.preferredHeight: Kirigami.Units.iconSizes.huge
-					}
+				spacing: Kirigami.Units.smallSpacing
 
-				}
-				Flow {
-					width: parent.width
-					spacing: Kirigami.Units.largeSpacing
-					PlasmaComponents.Button {
-						text: i18nd("kup", "Save new backup")
-						visible: getPlanStatus(index, "destination available") &&
-									!getPlanStatus(index, "busy")
-						onClicked: startOperation(index, "save backup")
-					}
-					PlasmaComponents.Button {
-						text: i18nd("kup", "Prune old backups")
-						visible: getPlanStatus(index, "bup type") && getPlanStatus(index, "destination available")
-						onClicked: startOperation(index, "remove backups")
-					}
-					PlasmaComponents.Button {
-						text: i18nd("kup", "Show files")
-						visible: getPlanStatus(index, "destination available")
-						onClicked: startOperation(index, "show backup files")
-					}
-					PlasmaComponents.Button {
-						text: i18nd("kup", "Show log file")
-						visible: getPlanStatus(index, "log file exists")
-						onClicked: startOperation(index, "show log file")
+				highlight: PlasmaExtras.Highlight {}
+				highlightMoveDuration: Kirigami.Units.shortDuration
+				highlightResizeDuration: Kirigami.Units.shortDuration
+
+				delegate: PlanItem {}
+
+				PlasmaExtras.PlaceholderMessage {
+					visible: planCount == 0
+
+					anchors.centerIn: parent
+					width: parent.width - (Kirigami.Units.gridUnit * 4)
+
+					text: getCommonStatus("no plan reason", "")
+
+					helpfulAction: QQC2.Action {
+						text: i18nd("kup", "Configure Backup Plans…")
+						icon.name: "configure"
+						onTriggered: configureKup()
 					}
 				}
 			}
diff --git a/plasmoid-qt6/contents/ui/PlanItem.qml b/plasmoid-qt6/contents/ui/PlanItem.qml
new file mode 100644
index 0000000..321d222
--- /dev/null
+++ b/plasmoid-qt6/contents/ui/PlanItem.qml
@@ -0,0 +1,63 @@
+// SPDX-FileCopyrightText: 2026 Bharadwaj Raju <[email protected]>
+//
+// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
+
+import QtQuick
+import QtQuick.Controls as QQC2
+
+import org.kde.plasma.extras as PlasmaExtras
+import org.kde.plasma.plasmoid
+
+PlasmaExtras.ExpandableListItem {
+    required index
+
+    title: getPlanStatus(index, "description")
+    subtitle: {
+        // heading is nonempty when some action is being performed
+        const heading = getPlanStatus(index, "status heading");
+        const details = getPlanStatus(index, "status details");
+        return (heading !== "") ? heading : details;
+    }
+    subtitleCanWrap: true
+    icon: {
+        // icon name is empty for manual backups
+        const iconName = getPlanStatus(index, "icon name");
+        return (iconName !== "") ? iconName : "preferences-system-backup";
+    }
+    // TODO add an emblem when we have a better emblem icon in Breeze to represent syncing/working
+
+    QQC2.Action {
+        id: openFilesAction
+        enabled: getPlanStatus(index, "destination available")
+        icon.name: "document-open-folder-symbolic"
+        text: i18nd("kup", "Show Files")
+        onTriggered: startOperation(index, "show backup files")
+    }
+
+    QQC2.Action {
+        id: saveNewAction
+        enabled: getPlanStatus(index, "destination available") && !getPlanStatus(index, "busy")
+        icon.name: "document-save"
+        text: i18nd("kup", "Save Backup")
+        onTriggered: startOperation(index, "save backup")
+    }
+
+    QQC2.Action {
+        id: pruneAction
+        enabled: getPlanStatus(index, "bup type") && getPlanStatus(index, "destination available")
+        icon.name: "edit-clear-history"
+        text: i18nd("kup", "Prune Old Backups")
+        onTriggered: startOperation(index, "remove backups")
+    }
+
+    QQC2.Action {
+        id: openLogAction
+        enabled: getPlanStatus(index, "log file exists")
+        icon.name: "folder-log-symbolic"
+        text: i18nd("kup", "View Log")
+        onTriggered: startOperation(index, "show log file")
+    }
+
+    defaultActionButtonAction: openFilesAction.enabled ? openFilesAction : null
+    contextualActions: [saveNewAction, pruneAction, openLogAction]
+}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.