gui: add copy button to call and tool blocks
This commit is contained in:
parent
378ea83de7
commit
167e70531a
|
|
@ -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
|
||||
|
|
|
|||
32
gui/main.qml
32
gui/main.qml
|
|
@ -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
|
||||
|
|
|
|||
Reference in New Issue