diff --git a/quickshell/Common/Theme.qml b/quickshell/Common/Theme.qml index 0b0befad..658c8afe 100644 --- a/quickshell/Common/Theme.qml +++ b/quickshell/Common/Theme.qml @@ -970,6 +970,7 @@ Singleton { readonly property int shorterDuration: (typeof SettingsData !== "undefined" && SettingsData.animationSpeed === SettingsData.AnimationSpeed.Custom) ? SettingsData.customAnimationDuration : currentDurations.shorter readonly property int shortDuration: (typeof SettingsData !== "undefined" && SettingsData.animationSpeed === SettingsData.AnimationSpeed.Custom) ? SettingsData.customAnimationDuration : currentDurations.short + readonly property bool snapListModelChanges: shortDuration <= 0 readonly property int mediumDuration: (typeof SettingsData !== "undefined" && SettingsData.animationSpeed === SettingsData.AnimationSpeed.Custom) ? SettingsData.customAnimationDuration : currentDurations.medium readonly property int longDuration: (typeof SettingsData !== "undefined" && SettingsData.animationSpeed === SettingsData.AnimationSpeed.Custom) ? SettingsData.customAnimationDuration : currentDurations.long readonly property int extraLongDuration: (typeof SettingsData !== "undefined" && SettingsData.animationSpeed === SettingsData.AnimationSpeed.Custom) ? SettingsData.customAnimationDuration : currentDurations.extraLong diff --git a/quickshell/Modals/Clipboard/ClipboardContent.qml b/quickshell/Modals/Clipboard/ClipboardContent.qml index 9c6ed8f4..8b174539 100644 --- a/quickshell/Modals/Clipboard/ClipboardContent.qml +++ b/quickshell/Modals/Clipboard/ClipboardContent.qml @@ -26,7 +26,8 @@ Item { ClipboardHeader { id: header width: parent.width - totalCount: modal.totalCount + recentsCount: modal.unpinnedEntries.length + savedCount: modal.pinnedEntries.length showKeyboardHints: modal.showKeyboardHints activeTab: modal.activeTab pinnedCount: modal.pinnedCount @@ -99,6 +100,20 @@ Item { pressDelay: 0 flickableDirection: Flickable.VerticalFlick + states: [ + State { + name: "snap" + when: Theme.snapListModelChanges + PropertyChanges { + target: clipboardListView + add: null + remove: null + displaced: null + move: null + } + } + ] + function ensureVisible(index) { if (index < 0 || index >= count) { return; @@ -159,6 +174,20 @@ Item { pressDelay: 0 flickableDirection: Flickable.VerticalFlick + states: [ + State { + name: "snap" + when: Theme.snapListModelChanges + PropertyChanges { + target: savedListView + add: null + remove: null + displaced: null + move: null + } + } + ] + function ensureVisible(index) { if (index < 0 || index >= count) { return; diff --git a/quickshell/Modals/Clipboard/ClipboardHeader.qml b/quickshell/Modals/Clipboard/ClipboardHeader.qml index 366695ae..d614c1ca 100644 --- a/quickshell/Modals/Clipboard/ClipboardHeader.qml +++ b/quickshell/Modals/Clipboard/ClipboardHeader.qml @@ -6,7 +6,8 @@ import qs.Modals.Clipboard Item { id: header - property int totalCount: 0 + property int recentsCount: 0 + property int savedCount: 0 property bool showKeyboardHints: false property string activeTab: "recents" property int pinnedCount: 0 @@ -31,7 +32,7 @@ Item { } StyledText { - text: I18n.tr("Clipboard History") + ` (${totalCount})` + text: (header.activeTab === "saved" ? I18n.tr("Clipboard Saved") : I18n.tr("Clipboard History")) + ` (${header.activeTab === "saved" ? header.savedCount : header.recentsCount})` font.pixelSize: Theme.fontSizeLarge color: Theme.surfaceText font.weight: Font.Medium @@ -48,6 +49,7 @@ Item { iconName: "push_pin" iconSize: Theme.iconSize - 4 iconColor: header.activeTab === "saved" ? Theme.primary : Theme.surfaceText + backgroundColor: header.activeTab === "saved" ? Theme.primarySelected : "transparent" visible: header.pinnedCount > 0 tooltipText: header.activeTab === "saved" ? I18n.tr("Recent") : I18n.tr("Saved") onClicked: tabChanged(header.activeTab === "saved" ? "recents" : "saved") diff --git a/quickshell/Modules/ProcessList/ProcessesView.qml b/quickshell/Modules/ProcessList/ProcessesView.qml index c175da4e..cd57a357 100644 --- a/quickshell/Modules/ProcessList/ProcessesView.qml +++ b/quickshell/Modules/ProcessList/ProcessesView.qml @@ -301,10 +301,19 @@ Item { clip: true spacing: 2 - add: null - remove: null - displaced: null - move: null + states: [ + State { + name: "snap" + when: Theme.snapListModelChanges + PropertyChanges { + target: processListView + add: null + remove: null + displaced: null + move: null + } + } + ] model: ScriptModel { values: root.cachedProcesses diff --git a/quickshell/Services/ClipboardService.qml b/quickshell/Services/ClipboardService.qml index c132b703..93296385 100644 --- a/quickshell/Services/ClipboardService.qml +++ b/quickshell/Services/ClipboardService.qml @@ -68,15 +68,17 @@ Singleton { clipboardEntries = filtered; unpinnedEntries = filtered.filter(e => !e.pinned); + pinnedEntries = filtered.filter(e => e.pinned); totalCount = clipboardEntries.length; - if (unpinnedEntries.length === 0) { + const activeCount = Math.max(unpinnedEntries.length, pinnedEntries.length); + if (activeCount === 0) { keyboardNavigationActive = false; selectedIndex = 0; return; } - if (selectedIndex >= unpinnedEntries.length) { - selectedIndex = unpinnedEntries.length - 1; + if (selectedIndex >= activeCount) { + selectedIndex = activeCount - 1; } }