stickypad: feedback for copy

This commit is contained in:
end-4
2025-11-14 11:46:21 +01:00
parent c16cff52b8
commit 4ea48d60f8
@@ -191,6 +191,7 @@ OverlayBackground {
readonly property real lineHeight: Math.min(Math.max(modelData.height, Appearance.font.pixelSize.normal + 6), 40) readonly property real lineHeight: Math.min(Math.max(modelData.height, Appearance.font.pixelSize.normal + 6), 40)
readonly property real iconSizeLocal: Appearance.font.pixelSize.normal readonly property real iconSizeLocal: Appearance.font.pixelSize.normal
readonly property real hitPadding: 6 readonly property real hitPadding: 6
property bool justCopied: false
implicitHeight: lineHeight implicitHeight: lineHeight
implicitWidth: lineHeight implicitWidth: lineHeight
@@ -199,8 +200,18 @@ OverlayBackground {
x: Math.max(stickypadInput.width - width - 16, 0) x: Math.max(stickypadInput.width - width - 16, 0)
z: 5 z: 5
Timer {
id: resetState
interval: 700
onTriggered: {
copyButton.justCopied = false;
}
}
onClicked: { onClicked: {
Quickshell.clipboardText = copyButton.modelData.content; Quickshell.clipboardText = copyButton.modelData.content;
justCopied = true;
resetState.start();
} }
contentItem: Item { contentItem: Item {
@@ -208,7 +219,7 @@ OverlayBackground {
MaterialSymbol { MaterialSymbol {
id: iconItem id: iconItem
anchors.centerIn: parent anchors.centerIn: parent
text: "content_copy" text: copyButton.justCopied ? "check" : "content_copy"
iconSize: copyButton.iconSizeLocal iconSize: copyButton.iconSizeLocal
color: Appearance.colors.colOnLayer1 color: Appearance.colors.colOnLayer1
} }