fix: Replace to custom tooltip

This commit is contained in:
Petr Mironychev
2026-05-27 19:23:28 +02:00
parent 8d3313d16b
commit 725de4a2c3
6 changed files with 164 additions and 90 deletions

View File

@@ -124,9 +124,6 @@ ChatRootView {
icon.source: (typeof _chatview !== 'undefined') icon.source: (typeof _chatview !== 'undefined')
? "qrc:/qt/qml/ChatView/icons/open-in-editor.svg" ? "qrc:/qt/qml/ChatView/icons/open-in-editor.svg"
: "qrc:/qt/qml/ChatView/icons/open-in-window.svg" : "qrc:/qt/qml/ChatView/icons/open-in-window.svg"
ToolTip.text: (typeof _chatview !== 'undefined')
? qsTr("Move this chat to an editor tab")
: qsTr("Move this chat to a separate window")
onClicked: { onClicked: {
if (typeof _chatview !== 'undefined') if (typeof _chatview !== 'undefined')
root.relocateToSplit() root.relocateToSplit()
@@ -134,6 +131,9 @@ ChatRootView {
root.relocateToWindow() root.relocateToWindow()
} }
} }
relocateTooltip.text: (typeof _chatview !== 'undefined')
? qsTr("Move this chat to an editor tab")
: qsTr("Move this chat to a separate window")
toolsButton { toolsButton {
checked: root.useTools checked: root.useTools
onCheckedChanged: { onCheckedChanged: {
@@ -561,7 +561,7 @@ ChatRootView {
sendButton.icon.source: !root.isRequestInProgress ? "qrc:/qt/qml/ChatView/icons/chat-icon.svg" sendButton.icon.source: !root.isRequestInProgress ? "qrc:/qt/qml/ChatView/icons/chat-icon.svg"
: "qrc:/qt/qml/ChatView/icons/chat-pause-icon.svg" : "qrc:/qt/qml/ChatView/icons/chat-pause-icon.svg"
sendButton.text: !root.isRequestInProgress ? qsTr("Send") : qsTr("Stop") sendButton.text: !root.isRequestInProgress ? qsTr("Send") : qsTr("Stop")
sendButton.ToolTip.text: !root.isRequestInProgress ? qsTr("Send message to LLM %1").arg(Qt.platform.os === "osx" ? "Cmd+Return" : "Ctrl+Return") sendButtonTooltip.text: !root.isRequestInProgress ? qsTr("Send message to LLM %1").arg(Qt.platform.os === "osx" ? "Cmd+Return" : "Ctrl+Return")
: qsTr("Stop") : qsTr("Stop")
compressButton.onClicked: compressConfirmDialog.open() compressButton.onClicked: compressConfirmDialog.open()
cancelCompressButton.onClicked: root.cancelCompression() cancelCompressButton.onClicked: root.cancelCompression()

View File

@@ -260,9 +260,11 @@ Rectangle {
hoverEnabled: true hoverEnabled: true
onClicked: root.openInEditor(editData.edit_id) onClicked: root.openInEditor(editData.edit_id)
ToolTip.visible: hovered QoAToolTip {
ToolTip.text: qsTr("Open file in editor and navigate to changes") visible: parent.hovered
ToolTip.delay: 500 delay: 500
text: qsTr("Open file in editor and navigate to changes")
}
} }
QoAButton { QoAButton {

View File

@@ -19,6 +19,7 @@ Rectangle {
property alias cancelCompressButton: cancelCompressButtonId property alias cancelCompressButton: cancelCompressButtonId
property bool isCompressing: false property bool isCompressing: false
property alias sendButtonTooltip: sendButtonTooltipId
color: palette.window.hslLightness > 0.5 ? color: palette.window.hslLightness > 0.5 ?
Qt.darker(palette.window, 1.1) : Qt.darker(palette.window, 1.1) :
@@ -45,9 +46,12 @@ Rectangle {
height: 15 height: 15
width: 8 width: 8
} }
ToolTip.visible: hovered
ToolTip.delay: 250 QoAToolTip {
ToolTip.text: qsTr("Attach file to message") visible: attachFilesId.hovered
delay: 250
text: qsTr("Attach file to message")
}
} }
QoAButton { QoAButton {
@@ -58,9 +62,12 @@ Rectangle {
height: 15 height: 15
width: 15 width: 15
} }
ToolTip.visible: hovered
ToolTip.delay: 250 QoAToolTip {
ToolTip.text: qsTr("Attach image to message") visible: attachImagesId.hovered
delay: 250
text: qsTr("Attach image to message")
}
} }
QoAButton { QoAButton {
@@ -71,9 +78,12 @@ Rectangle {
height: 15 height: 15
width: 8 width: 8
} }
ToolTip.visible: hovered
ToolTip.delay: 250 QoAToolTip {
ToolTip.text: qsTr("Link file to context") visible: linkFilesId.hovered
delay: 250
text: qsTr("Link file to context")
}
} }
CheckBox { CheckBox {
@@ -81,8 +91,10 @@ Rectangle {
text: qsTr("Sync open files") text: qsTr("Sync open files")
ToolTip.visible: syncOpenFilesId.hovered QoAToolTip {
ToolTip.text: qsTr("Automatically synchronize currently opened files with the model context") visible: syncOpenFilesId.hovered
text: qsTr("Automatically synchronize currently opened files with the model context")
}
} }
Item { Item {
@@ -117,9 +129,11 @@ Rectangle {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
text: qsTr("Cancel") text: qsTr("Cancel")
ToolTip.visible: hovered QoAToolTip {
ToolTip.delay: 250 visible: cancelCompressButtonId.hovered
ToolTip.text: qsTr("Cancel compression") delay: 250
text: qsTr("Cancel compression")
}
} }
} }
@@ -134,9 +148,12 @@ Rectangle {
height: 15 height: 15
width: 15 width: 15
} }
ToolTip.visible: hovered
ToolTip.delay: 250 QoAToolTip {
ToolTip.text: qsTr("Compress chat (create summarized copy using LLM)") visible: compressButtonId.hovered
delay: 250
text: qsTr("Compress chat (create summarized copy using LLM)")
}
} }
QoAButton { QoAButton {
@@ -146,8 +163,13 @@ Rectangle {
height: 15 height: 15
width: 15 width: 15
} }
ToolTip.visible: hovered
ToolTip.delay: 250 QoAToolTip {
id: sendButtonTooltipId
visible: sendButtonId.hovered
delay: 250
}
} }
} }
} }

View File

@@ -118,11 +118,13 @@ Rectangle {
? qsTr("Apply All (%1)").arg(root.pendingEdits + root.rejectedEdits) ? qsTr("Apply All (%1)").arg(root.pendingEdits + root.rejectedEdits)
: qsTr("Reapply All (%1)").arg(root.rejectedEdits) : qsTr("Reapply All (%1)").arg(root.rejectedEdits)
ToolTip.visible: hovered QoAToolTip {
ToolTip.delay: 250 visible: applyAllButton.hovered
ToolTip.text: root.hasPendingEdits delay: 250
text: root.hasPendingEdits
? qsTr("Apply all pending and rejected edits in this message") ? qsTr("Apply all pending and rejected edits in this message")
: qsTr("Reapply all rejected edits in this message") : qsTr("Reapply all rejected edits in this message")
}
onClicked: root.applyAllClicked() onClicked: root.applyAllClicked()
} }
@@ -134,9 +136,11 @@ Rectangle {
enabled: root.hasAppliedEdits enabled: root.hasAppliedEdits
text: qsTr("Undo All (%1)").arg(root.appliedEdits) text: qsTr("Undo All (%1)").arg(root.appliedEdits)
ToolTip.visible: hovered QoAToolTip {
ToolTip.delay: 250 visible: undoAllButton.hovered
ToolTip.text: qsTr("Undo all applied edits in this message") delay: 250
text: qsTr("Undo all applied edits in this message")
}
onClicked: root.undoAllClicked() onClicked: root.undoAllClicked()
} }

View File

@@ -27,6 +27,7 @@ Rectangle {
property alias settingsButton: settingsButtonId property alias settingsButton: settingsButtonId
property alias configSelector: configSelectorId property alias configSelector: configSelectorId
property alias roleSelector: roleSelector property alias roleSelector: roleSelector
property alias relocateTooltip: relocateTooltipId
color: palette.window.hslLightness > 0.5 ? color: palette.window.hslLightness > 0.5 ?
Qt.darker(palette.window, 1.1) : Qt.darker(palette.window, 1.1) :
@@ -59,11 +60,14 @@ Rectangle {
height: 15 height: 15
width: 15 width: 15
} }
ToolTip.visible: hovered
ToolTip.delay: 250 QoAToolTip {
ToolTip.text: checked ? qsTr("Unpin chat window") visible: pinButtonId.hovered
delay: 250
text: pinButtonId.checked ? qsTr("Unpin chat window")
: qsTr("Pin chat window to the top") : qsTr("Pin chat window to the top")
} }
}
QoAButton { QoAButton {
id: relocateButtonId id: relocateButtonId
@@ -76,8 +80,13 @@ Rectangle {
height: 15 height: 15
width: 15 width: 15
} }
ToolTip.visible: hovered
ToolTip.delay: 250 QoAToolTip {
id: relocateTooltipId
visible: relocateButtonId.hovered
delay: 250
}
} }
QoASeparator { QoASeparator {
@@ -92,9 +101,12 @@ Rectangle {
height: 15 height: 15
width: 8 width: 8
} }
ToolTip.visible: hovered
ToolTip.delay: 250 QoAToolTip {
ToolTip.text: qsTr("Clean chat") visible: clearButtonId.hovered
delay: 250
text: qsTr("Clean chat")
}
} }
QoASeparator { QoASeparator {
@@ -112,9 +124,12 @@ Rectangle {
height: 15 height: 15
width: 15 width: 15
} }
ToolTip.visible: hovered
ToolTip.delay: 250 QoAToolTip {
ToolTip.text: qsTr("Open new chat in a new tab") visible: newChatButtonId.hovered
delay: 250
text: qsTr("Open new chat in a new tab")
}
} }
QoAComboBox { QoAComboBox {
@@ -125,9 +140,11 @@ Rectangle {
model: [] model: []
currentIndex: 0 currentIndex: 0
ToolTip.visible: hovered QoAToolTip {
ToolTip.delay: 250 visible: configSelectorId.hovered
ToolTip.text: qsTr("Switch saved AI configuration") delay: 250
text: qsTr("Switch saved AI configuration")
}
} }
QoAComboBox { QoAComboBox {
@@ -138,9 +155,11 @@ Rectangle {
model: [] model: []
currentIndex: 0 currentIndex: 0
ToolTip.visible: hovered QoAToolTip {
ToolTip.delay: 250 visible: roleSelector.hovered
ToolTip.text: qsTr("Switch agent role (different system prompts)") delay: 250
text: qsTr("Switch agent role (different system prompts)")
}
} }
} }
@@ -163,17 +182,19 @@ Rectangle {
width: 15 width: 15
} }
ToolTip.visible: hovered QoAToolTip {
ToolTip.delay: 250 visible: toolsButtonId.hovered
ToolTip.text: { delay: 250
text: {
if (!toolsButtonId.enabled) { if (!toolsButtonId.enabled) {
return qsTr("Tools are disabled in General Settings") return qsTr("Tools are disabled in General Settings")
} }
return checked return toolsButtonId.checked
? qsTr("Tools enabled: AI can use tools to read files, search project, and build code") ? qsTr("Tools enabled: AI can use tools to read files, search project, and build code")
: qsTr("Tools disabled: Simple conversation without tool access") : qsTr("Tools disabled: Simple conversation without tool access")
} }
} }
}
QoAButton { QoAButton {
id: thinkingModeId id: thinkingModeId
@@ -191,12 +212,15 @@ Rectangle {
width: 15 width: 15
} }
ToolTip.visible: hovered QoAToolTip {
ToolTip.delay: 250 visible: thinkingModeId.hovered
ToolTip.text: enabled ? (checked ? qsTr("Thinking Mode enabled (Check model list support it)") delay: 250
text: thinkingModeId.enabled
? (thinkingModeId.checked ? qsTr("Thinking Mode enabled (Check model list support it)")
: qsTr("Thinking Mode disabled")) : qsTr("Thinking Mode disabled"))
: qsTr("Thinking Mode is not available for this provider") : qsTr("Thinking Mode is not available for this provider")
} }
}
QoAButton { QoAButton {
id: settingsButtonId id: settingsButtonId
@@ -210,9 +234,11 @@ Rectangle {
width: 15 width: 15
} }
ToolTip.visible: hovered QoAToolTip {
ToolTip.delay: 250 visible: settingsButtonId.hovered
ToolTip.text: qsTr("Open Chat Assistant Settings") delay: 250
text: qsTr("Open Chat Assistant Settings")
}
} }
QoASeparator { QoASeparator {
@@ -238,9 +264,11 @@ Rectangle {
anchors.fill: parent anchors.fill: parent
hoverEnabled: true hoverEnabled: true
ToolTip.visible: containsMouse QoAToolTip {
ToolTip.delay: 500 visible: parent.containsMouse && recentPathId.text.length > 0
ToolTip.text: recentPathId.text text: recentPathId.text
delay: 500
}
} }
} }
} }
@@ -261,9 +289,12 @@ Rectangle {
height: 15 height: 15
width: 8 width: 8
} }
ToolTip.visible: hovered
ToolTip.delay: 250 QoAToolTip {
ToolTip.text: qsTr("Save chat to *.json file") visible: saveButtonId.hovered
delay: 250
text: qsTr("Save chat to *.json file")
}
} }
QoAButton { QoAButton {
@@ -274,9 +305,12 @@ Rectangle {
height: 15 height: 15
width: 8 width: 8
} }
ToolTip.visible: hovered
ToolTip.delay: 250 QoAToolTip {
ToolTip.text: qsTr("Load chat from *.json file") visible: loadButtonId.hovered
delay: 250
text: qsTr("Load chat from *.json file")
}
} }
QoAButton { QoAButton {
@@ -287,9 +321,12 @@ Rectangle {
height: 15 height: 15
width: 15 width: 15
} }
ToolTip.visible: hovered
ToolTip.delay: 250 QoAToolTip {
ToolTip.text: qsTr("Show in system") visible: openChatHistoryId.hovered
delay: 250
text: qsTr("Show in system")
}
} }
QoASeparator {} QoASeparator {}
@@ -304,9 +341,11 @@ Rectangle {
width: 15 width: 15
} }
ToolTip.visible: hovered QoAToolTip {
ToolTip.delay: 250 visible: contextButtonId.hovered
ToolTip.text: qsTr("View chat context (system prompt, role, rules)") delay: 250
text: qsTr("View chat context (system prompt, role, rules)")
}
} }
Badge { Badge {

View File

@@ -2,6 +2,7 @@
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
import QtQuick import QtQuick
import QtQuick.Controls
Rectangle { Rectangle {
id: root id: root
@@ -9,6 +10,12 @@ Rectangle {
property alias text: badgeText.text property alias text: badgeText.text
property alias hovered: mouse.hovered property alias hovered: mouse.hovered
QoAToolTip {
visible: root.hovered && root.ToolTip.text.length > 0
text: root.ToolTip.text
delay: root.ToolTip.delay
}
implicitWidth: badgeText.implicitWidth + root.radius implicitWidth: badgeText.implicitWidth + root.radius
implicitHeight: badgeText.implicitHeight + 6 implicitHeight: badgeText.implicitHeight + 6
color: palette.button color: palette.button