diff --git a/kde/CMakeLists.txt b/kde/CMakeLists.txt index 22cba01..b702f19 100644 --- a/kde/CMakeLists.txt +++ b/kde/CMakeLists.txt @@ -151,6 +151,8 @@ qt_add_resources(ollie-gui "gui" gui/ChatBlockDelegate.qml gui/SessionTree.qml gui/ChatPane.qml + gui/TextSelection.js + gui/ollie.svg ) # --- Install --- diff --git a/kde/gui/ChatPane.qml b/kde/gui/ChatPane.qml index f2df0f8..cb9a0fa 100644 --- a/kde/gui/ChatPane.qml +++ b/kde/gui/ChatPane.qml @@ -488,8 +488,10 @@ Item { onDoubleClicked: function(mouse) { if (mouse.button === Qt.LeftButton) { - if (!TextSelection.selectBracketPair(promptInput, mouse.x, mouse.y)) { - TextSelection.selectWordAt(promptInput, mouse.x, mouse.y) + // Map coordinates from chordArea to promptInput + var mappedPos = chordArea.mapToItem(promptInput, mouse.x, mouse.y) + if (!TextSelection.selectBracketPair(promptInput, mappedPos.x, mappedPos.y)) { + TextSelection.selectWordAt(promptInput, mappedPos.x, mappedPos.y) } mouse.accepted = true } @@ -543,7 +545,8 @@ Item { if (sel && sel.trim() !== "") { plumber.plumb(sel.trim(), sessionCwd()) } else { - var pos = promptInput.positionAt(mouse.x, mouse.y) + var mappedPos = chordArea.mapToItem(promptInput, mouse.x, mouse.y) + var pos = promptInput.positionAt(mappedPos.x, mappedPos.y) var word = wordAtCursor(promptInput, pos) if (word) plumber.plumb(word, sessionCwd()) }