forked from Shinonome/dots-hyprland
stickypad: feedback for copy
This commit is contained in:
@@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user