mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-05 21:15:38 -05:00
Fix clipboard theme and added total count
This commit is contained in:
@@ -9,42 +9,11 @@ import "../Common"
|
|||||||
PanelWindow {
|
PanelWindow {
|
||||||
id: clipboardHistory
|
id: clipboardHistory
|
||||||
|
|
||||||
property var theme
|
|
||||||
property bool isVisible: false
|
property bool isVisible: false
|
||||||
|
property int totalCount: 0
|
||||||
|
|
||||||
// Default theme fallback
|
// Use the global Theme singleton
|
||||||
property var defaultTheme: QtObject {
|
property var activeTheme: Theme
|
||||||
property color primary: "#D0BCFF"
|
|
||||||
property color background: "#10121E"
|
|
||||||
property color surfaceContainer: "#1D1B20"
|
|
||||||
property color surfaceText: "#E6E0E9"
|
|
||||||
property color surfaceVariant: "#49454F"
|
|
||||||
property color surfaceVariantText: "#CAC4D0"
|
|
||||||
property color outline: "#938F99"
|
|
||||||
property color error: "#F2B8B5"
|
|
||||||
property real cornerRadius: 12
|
|
||||||
property real cornerRadiusLarge: 16
|
|
||||||
property real cornerRadiusXLarge: 24
|
|
||||||
property real cornerRadiusSmall: 8
|
|
||||||
property real spacingXS: 4
|
|
||||||
property real spacingS: 8
|
|
||||||
property real spacingM: 12
|
|
||||||
property real spacingL: 16
|
|
||||||
property real spacingXL: 24
|
|
||||||
property real fontSizeLarge: 16
|
|
||||||
property real fontSizeMedium: 14
|
|
||||||
property real fontSizeSmall: 12
|
|
||||||
property real iconSize: 24
|
|
||||||
property real iconSizeLarge: 32
|
|
||||||
property string iconFont: "Material Symbols Rounded"
|
|
||||||
property int iconFontWeight: Font.Normal
|
|
||||||
property int shortDuration: 150
|
|
||||||
property int mediumDuration: 300
|
|
||||||
property int standardEasing: Easing.OutCubic
|
|
||||||
property int emphasizedEasing: Easing.OutQuart
|
|
||||||
}
|
|
||||||
|
|
||||||
property var activeTheme: theme || defaultTheme
|
|
||||||
|
|
||||||
// Window properties
|
// Window properties
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
@@ -85,6 +54,8 @@ PanelWindow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Update total count
|
||||||
|
clipboardHistory.totalCount = filteredClipboardModel.count
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggle() {
|
function toggle() {
|
||||||
@@ -221,7 +192,7 @@ PanelWindow {
|
|||||||
id: titleText
|
id: titleText
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
text: "Clipboard History"
|
text: "Clipboard History" + (clipboardHistory.totalCount > 0 ? ` (${clipboardHistory.totalCount})` : "")
|
||||||
font.pixelSize: activeTheme.fontSizeLarge + 4
|
font.pixelSize: activeTheme.fontSizeLarge + 4
|
||||||
font.weight: Font.Bold
|
font.weight: Font.Bold
|
||||||
color: activeTheme.surfaceText
|
color: activeTheme.surfaceText
|
||||||
@@ -239,7 +210,7 @@ PanelWindow {
|
|||||||
height: 32
|
height: 32
|
||||||
radius: activeTheme.cornerRadius
|
radius: activeTheme.cornerRadius
|
||||||
color: clearArea.containsMouse ? Qt.rgba(activeTheme.error.r, activeTheme.error.g, activeTheme.error.b, 0.12) : "transparent"
|
color: clearArea.containsMouse ? Qt.rgba(activeTheme.error.r, activeTheme.error.g, activeTheme.error.b, 0.12) : "transparent"
|
||||||
visible: clipboardModel.count > 0
|
visible: clipboardHistory.totalCount > 0
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
@@ -379,12 +350,30 @@ PanelWindow {
|
|||||||
|
|
||||||
property string entryType: getEntryType(model.entry)
|
property string entryType: getEntryType(model.entry)
|
||||||
property string entryPreview: getEntryPreview(model.entry)
|
property string entryPreview: getEntryPreview(model.entry)
|
||||||
|
property int entryIndex: index + 1
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: activeTheme.spacingM
|
anchors.margins: activeTheme.spacingM
|
||||||
spacing: activeTheme.spacingL
|
spacing: activeTheme.spacingL
|
||||||
|
|
||||||
|
// Index number
|
||||||
|
Rectangle {
|
||||||
|
width: 24
|
||||||
|
height: 24
|
||||||
|
radius: 12
|
||||||
|
color: Qt.rgba(activeTheme.primary.r, activeTheme.primary.g, activeTheme.primary.b, 0.2)
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
|
Text {
|
||||||
|
anchors.centerIn: parent
|
||||||
|
text: entryIndex.toString()
|
||||||
|
font.pixelSize: activeTheme.fontSizeSmall
|
||||||
|
font.weight: Font.Bold
|
||||||
|
color: activeTheme.primary
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Entry type icon
|
// Entry type icon
|
||||||
Rectangle {
|
Rectangle {
|
||||||
width: 36
|
width: 36
|
||||||
@@ -412,7 +401,7 @@ PanelWindow {
|
|||||||
Column {
|
Column {
|
||||||
id: contentColumn
|
id: contentColumn
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
width: parent.width - 100
|
width: parent.width - 140 // Adjusted for index number
|
||||||
spacing: activeTheme.spacingXS
|
spacing: activeTheme.spacingXS
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
@@ -524,7 +513,7 @@ PanelWindow {
|
|||||||
Column {
|
Column {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
spacing: activeTheme.spacingL
|
spacing: activeTheme.spacingL
|
||||||
visible: filteredClipboardModel.count === 0
|
visible: clipboardHistory.totalCount === 0
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
|||||||
Reference in New Issue
Block a user