mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2025-11-13 21:42:52 -05:00
refactor: Change opening url in chat by mouse
This commit is contained in:
@ -29,26 +29,18 @@ TextEdit {
|
|||||||
selectionColor: palette.highlight
|
selectionColor: palette.highlight
|
||||||
color: palette.text
|
color: palette.text
|
||||||
|
|
||||||
|
onLinkActivated: (link) => Qt.openUrlExternally(link)
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
acceptedButtons: Qt.RightButton
|
acceptedButtons: Qt.RightButton
|
||||||
onClicked: contextMenu.open()
|
onClicked: contextMenu.open()
|
||||||
cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.IBeamCursor
|
cursorShape: root.hoveredLink ? Qt.PointingHandCursor : Qt.IBeamCursor
|
||||||
}
|
}
|
||||||
|
|
||||||
Platform.Menu {
|
Platform.Menu {
|
||||||
id: contextMenu
|
id: contextMenu
|
||||||
|
|
||||||
Platform.MenuItem {
|
|
||||||
text: qsTr("Open Link")
|
|
||||||
visible: root.hoveredLink.length > 0
|
|
||||||
onTriggered: Qt.openUrlExternally(root.hoveredLink)
|
|
||||||
}
|
|
||||||
|
|
||||||
Platform.MenuSeparator {
|
|
||||||
visible: root.hoveredLink.length > 0
|
|
||||||
}
|
|
||||||
|
|
||||||
Platform.MenuItem {
|
Platform.MenuItem {
|
||||||
text: qsTr("Copy")
|
text: qsTr("Copy")
|
||||||
enabled: root.selectedText.length > 0
|
enabled: root.selectedText.length > 0
|
||||||
|
|||||||
Reference in New Issue
Block a user