forked from Shinonome/dots-hyprland
ai messages: bouncy action buttons
This commit is contained in:
@@ -168,7 +168,7 @@ Rectangle {
|
|||||||
MaterialSymbol {
|
MaterialSymbol {
|
||||||
id: notVisibleToModelText
|
id: notVisibleToModelText
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
iconSize: Appearance.font.pixelSize.larger
|
iconSize: Appearance.font.pixelSize.small
|
||||||
color: Appearance.colors.colSubtext
|
color: Appearance.colors.colSubtext
|
||||||
text: "visibility_off"
|
text: "visibility_off"
|
||||||
}
|
}
|
||||||
@@ -177,14 +177,26 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RowLayout {
|
ButtonGroup {
|
||||||
spacing: 5
|
spacing: 5
|
||||||
|
|
||||||
AiMessageControlButton {
|
AiMessageControlButton {
|
||||||
id: copyButton
|
id: copyButton
|
||||||
buttonIcon: "content_copy"
|
buttonIcon: activated ? "inventory" : "content_copy"
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
Hyprland.dispatch(`exec wl-copy '${StringUtils.shellSingleQuoteEscape(root.messageData.content)}'`)
|
Hyprland.dispatch(`exec wl-copy '${StringUtils.shellSingleQuoteEscape(root.messageData.content)}'`)
|
||||||
|
copyButton.activated = true
|
||||||
|
copyIconTimer.restart()
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
id: copyIconTimer
|
||||||
|
interval: 1500
|
||||||
|
repeat: false
|
||||||
|
onTriggered: {
|
||||||
|
copyButton.activated = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
StyledToolTip {
|
StyledToolTip {
|
||||||
content: qsTr("Copy")
|
content: qsTr("Copy")
|
||||||
|
|||||||
@@ -7,14 +7,13 @@ import QtQuick.Controls
|
|||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import Quickshell
|
import Quickshell
|
||||||
|
|
||||||
RippleButton {
|
GroupButton {
|
||||||
id: button
|
id: button
|
||||||
property string buttonIcon
|
property string buttonIcon
|
||||||
property bool activated: false
|
property bool activated: false
|
||||||
toggled: activated
|
toggled: activated
|
||||||
|
|
||||||
implicitHeight: 30
|
baseWidth: height
|
||||||
implicitWidth: 30
|
|
||||||
|
|
||||||
contentItem: MaterialSymbol {
|
contentItem: MaterialSymbol {
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
|||||||
Reference in New Issue
Block a user