diff --git a/ChatView/CMakeLists.txt b/ChatView/CMakeLists.txt index 4c4b78a..6f0ab14 100644 --- a/ChatView/CMakeLists.txt +++ b/ChatView/CMakeLists.txt @@ -58,6 +58,7 @@ qt_add_qml_module(QodeAssistChatView icons/tools-icon-off.svg icons/settings-icon.svg icons/compress-icon.svg + icons/open-in-code.svg SOURCES ChatWidget.hpp ChatWidget.cpp diff --git a/ChatView/icons/open-in-code.svg b/ChatView/icons/open-in-code.svg new file mode 100644 index 0000000..d7dd273 --- /dev/null +++ b/ChatView/icons/open-in-code.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/ChatView/qml/chatparts/FileEditBlock.qml b/ChatView/qml/chatparts/FileEditBlock.qml index 1167c2a..cb57790 100644 --- a/ChatView/qml/chatparts/FileEditBlock.qml +++ b/ChatView/qml/chatparts/FileEditBlock.qml @@ -193,9 +193,24 @@ Rectangle { color: root.statusColor } + QoAButton { + icon { + source: "qrc:/qt/qml/ChatView/icons/open-in-code.svg" + height: 15 + width: 15 + } + hoverEnabled: true + onClicked: root.openInEditor(editData.edit_id) + + QoAToolTip { + visible: parent.hovered + delay: 500 + text: qsTr("Open file in editor and navigate to changes") + } + } + Text { id: headerText - Layout.fillWidth: true text: { var modeText = root.oldContent.length > 0 ? qsTr("Replace") : qsTr("Append") if (root.oldContent.length > 0) { @@ -223,6 +238,19 @@ Rectangle { color: palette.mid } + Item { Layout.fillWidth: true } + } + + RowLayout { + id: actionButtons + + anchors { + right: parent.right + rightMargin: 5 + verticalCenter: parent.verticalCenter + } + spacing: 6 + Rectangle { visible: !root.isPending Layout.preferredWidth: badgeText.width + 12 @@ -239,33 +267,6 @@ Rectangle { color: root.isArchived ? Qt.rgba(0.6, 0.6, 0.6, 1.0) : palette.text } } - } - - Row { - id: actionButtons - - anchors { - right: parent.right - rightMargin: 5 - verticalCenter: parent.verticalCenter - } - spacing: 6 - - QoAButton { - icon { - source: "qrc:/qt/qml/ChatView/icons/open-in-editor.svg" - height: 15 - width: 15 - } - hoverEnabled: true - onClicked: root.openInEditor(editData.edit_id) - - QoAToolTip { - visible: parent.hovered - delay: 500 - text: qsTr("Open file in editor and navigate to changes") - } - } QoAButton { icon {