fix: Copy Shortcut Not Working In Reply Thread Popup (#4209)

This commit is contained in:
nerix
2022-12-03 14:02:39 +01:00
committed by GitHub
parent 6ee7ef8cab
commit 8d4ee72478
8 changed files with 31 additions and 14 deletions
+10 -1
View File
@@ -166,9 +166,13 @@ ChannelView::ChannelView(BaseWidget *parent, Split *split, Context context,
this->updatePauses();
});
// This shortcut is not used in splits, it's used in views that
// don't have a SplitInput like the SearchPopup or EmotePopup.
// See SplitInput::installKeyPressedEvent for the copy event
// from views with a SplitInput.
auto shortcut = new QShortcut(QKeySequence::StandardKey::Copy, this);
QObject::connect(shortcut, &QShortcut::activated, [this] {
crossPlatformCopy(this->getSelectedText());
this->copySelectedText();
});
this->clickTimer_ = new QTimer(this);
@@ -592,6 +596,11 @@ void ChannelView::clearSelection()
queueLayout();
}
void ChannelView::copySelectedText()
{
crossPlatformCopy(this->getSelectedText());
}
void ChannelView::setEnableScrollingToBottom(bool value)
{
this->enableScrollingToBottom_ = value;