Terminal: Improve link copy

* Show link if control key is pressed (without mouse move)
* Copy link on Control+Shift+Click
* Add Copy Link Action to Right click menu

Change-Id: Ide4ff4e77c03e015117c67f09c9d60dedd14dfcb
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
Marcus Tillmanns
2023-04-06 10:34:33 +02:00
parent db2c5f87b1
commit 388e516200
4 changed files with 61 additions and 22 deletions

View File

@@ -35,6 +35,7 @@ public:
void copyToClipboard();
void pasteFromClipboard();
void copyLinkToClipboard();
void clearSelection();
@@ -90,6 +91,7 @@ signals:
protected:
void paintEvent(QPaintEvent *event) override;
void keyPressEvent(QKeyEvent *event) override;
void keyReleaseEvent(QKeyEvent *event) override;
void resizeEvent(QResizeEvent *event) override;
void wheelEvent(QWheelEvent *event) override;
void focusInEvent(QFocusEvent *event) override;
@@ -148,7 +150,7 @@ protected:
std::optional<QTextLayout::FormatRange> selectionToFormatRange(
TerminalWidget::Selection selection, const QTextLayout &layout, int rowOffset) const;
void checkLinkAt(const QPoint &pos);
bool checkLinkAt(const QPoint &pos);
struct TextAndOffsets
{