mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-06-08 12:13:31 -04:00
389fffaf64
* Fix gaps and overlaps when filtering clipboard history * feat(Clipboard-Bar-Hist): Add search/filter to saved clipboard entries as well. Change title on toggle between recent/saved. * keep Pinned/Saved icon highlighted when selected * add back filter animations * Implement snap state for list views based on animation settings --------- Co-authored-by: purian23 <purian23@gmail.com>
82 lines
2.5 KiB
QML
82 lines
2.5 KiB
QML
import QtQuick
|
|
import qs.Common
|
|
import qs.Widgets
|
|
import qs.Modals.Clipboard
|
|
|
|
Item {
|
|
id: header
|
|
|
|
property int recentsCount: 0
|
|
property int savedCount: 0
|
|
property bool showKeyboardHints: false
|
|
property string activeTab: "recents"
|
|
property int pinnedCount: 0
|
|
|
|
signal keyboardHintsToggled
|
|
signal clearAllClicked
|
|
signal closeClicked
|
|
signal tabChanged(string tabName)
|
|
|
|
height: ClipboardConstants.headerHeight
|
|
|
|
Row {
|
|
anchors.left: parent.left
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
spacing: Theme.spacingM
|
|
|
|
DankIcon {
|
|
name: "content_paste"
|
|
size: Theme.iconSize
|
|
color: Theme.primary
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
}
|
|
|
|
StyledText {
|
|
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
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
}
|
|
}
|
|
|
|
Row {
|
|
anchors.right: parent.right
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
spacing: Theme.spacingS
|
|
|
|
DankActionButton {
|
|
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")
|
|
}
|
|
|
|
DankActionButton {
|
|
iconName: "info"
|
|
iconSize: Theme.iconSize - 4
|
|
iconColor: showKeyboardHints ? Theme.primary : Theme.surfaceText
|
|
tooltipText: I18n.tr("Keyboard Shortcuts")
|
|
onClicked: keyboardHintsToggled()
|
|
}
|
|
|
|
DankActionButton {
|
|
iconName: "delete_sweep"
|
|
iconSize: Theme.iconSize
|
|
iconColor: Theme.surfaceText
|
|
tooltipText: I18n.tr("Clear All")
|
|
onClicked: clearAllClicked()
|
|
}
|
|
|
|
DankActionButton {
|
|
iconName: "close"
|
|
iconSize: Theme.iconSize - 4
|
|
iconColor: Theme.surfaceText
|
|
onClicked: closeClicked()
|
|
}
|
|
}
|
|
}
|