gui: add copy button to call and tool blocks

This commit is contained in:
Levi Neely 2026-07-16 16:23:56 +02:00
parent 378ea83de7
commit 167e70531a
2 changed files with 64 additions and 0 deletions

View File

@ -931,6 +931,8 @@ ApplicationWindow {
Item {
implicitHeight: callLayout.implicitHeight + 12
HoverHandler { id: callHover }
Rectangle {
anchors.fill: parent
color: Qt.rgba(palette.text.r, palette.text.g, palette.text.b, 0.03)
@ -942,6 +944,20 @@ ApplicationWindow {
}
}
ToolButton {
anchors.top: parent.top
anchors.right: parent.right
anchors.margins: 4
icon.name: "edit-copy"
implicitWidth: 24
implicitHeight: 24
opacity: callHover.hovered ? 0.8 : 0
onClicked: chatModel.copyToClipboard(block.blockContent)
ToolTip.text: "Copy"
ToolTip.visible: hovered
Behavior on opacity { NumberAnimation { duration: 150 } }
}
ColumnLayout {
id: callLayout
x: 10
@ -975,6 +991,8 @@ ApplicationWindow {
Item {
implicitHeight: toolLayout.implicitHeight + 12
HoverHandler { id: toolHover }
Rectangle {
anchors.fill: parent
color: Qt.rgba(palette.text.r, palette.text.g, palette.text.b, 0.03)
@ -986,6 +1004,20 @@ ApplicationWindow {
}
}
ToolButton {
anchors.top: parent.top
anchors.right: parent.right
anchors.margins: 4
icon.name: "edit-copy"
implicitWidth: 24
implicitHeight: 24
opacity: toolHover.hovered ? 0.8 : 0
onClicked: chatModel.copyToClipboard(block.blockContent)
ToolTip.text: "Copy"
ToolTip.visible: hovered
Behavior on opacity { NumberAnimation { duration: 150 } }
}
ColumnLayout {
id: toolLayout
x: 10

View File

@ -936,6 +936,8 @@ ApplicationWindow {
Item {
implicitHeight: callLayout.implicitHeight + 12
HoverHandler { id: callHover }
Rectangle {
anchors.fill: parent
color: Qt.rgba(palette.text.r, palette.text.g, palette.text.b, 0.03)
@ -947,6 +949,20 @@ ApplicationWindow {
}
}
ToolButton {
anchors.top: parent.top
anchors.right: parent.right
anchors.margins: 4
icon.name: "edit-copy"
implicitWidth: 24
implicitHeight: 24
opacity: callHover.hovered ? 0.8 : 0
onClicked: chatModel.copyToClipboard(block.blockContent)
ToolTip.text: "Copy"
ToolTip.visible: hovered
Behavior on opacity { NumberAnimation { duration: 150 } }
}
ColumnLayout {
id: callLayout
x: 10
@ -980,6 +996,8 @@ ApplicationWindow {
Item {
implicitHeight: toolLayout.implicitHeight + 12
HoverHandler { id: toolHover }
Rectangle {
anchors.fill: parent
color: Qt.rgba(palette.text.r, palette.text.g, palette.text.b, 0.03)
@ -991,6 +1009,20 @@ ApplicationWindow {
}
}
ToolButton {
anchors.top: parent.top
anchors.right: parent.right
anchors.margins: 4
icon.name: "edit-copy"
implicitWidth: 24
implicitHeight: 24
opacity: toolHover.hovered ? 0.8 : 0
onClicked: chatModel.copyToClipboard(block.blockContent)
ToolTip.text: "Copy"
ToolTip.visible: hovered
Behavior on opacity { NumberAnimation { duration: 150 } }
}
ColumnLayout {
id: toolLayout
x: 10