fix: Copy Shortcut Not Working In Reply Thread Popup (#4209)
This commit is contained in:
@@ -1121,11 +1121,6 @@ void Split::openSubPage()
|
||||
}
|
||||
}
|
||||
|
||||
void Split::copyToClipboard()
|
||||
{
|
||||
crossPlatformCopy(this->view_->getSelectedText());
|
||||
}
|
||||
|
||||
void Split::startWatching()
|
||||
{
|
||||
#ifdef USEWEBENGINE
|
||||
|
||||
@@ -168,7 +168,6 @@ public slots:
|
||||
void openBrowserPlayer();
|
||||
void openInStreamlink();
|
||||
void openWithCustomScheme();
|
||||
void copyToClipboard();
|
||||
void startWatching();
|
||||
void setFiltersDialog();
|
||||
void showSearch(bool singleChannel);
|
||||
|
||||
@@ -33,14 +33,16 @@
|
||||
namespace chatterino {
|
||||
|
||||
SplitInput::SplitInput(Split *_chatWidget, bool enableInlineReplying)
|
||||
: SplitInput(_chatWidget, _chatWidget, enableInlineReplying)
|
||||
: SplitInput(_chatWidget, _chatWidget, _chatWidget->view_,
|
||||
enableInlineReplying)
|
||||
{
|
||||
}
|
||||
|
||||
SplitInput::SplitInput(QWidget *parent, Split *_chatWidget,
|
||||
bool enableInlineReplying)
|
||||
ChannelView *_channelView, bool enableInlineReplying)
|
||||
: BaseWidget(parent)
|
||||
, split_(_chatWidget)
|
||||
, channelView_(_channelView)
|
||||
, enableInlineReplying_(enableInlineReplying)
|
||||
{
|
||||
this->installEventFilter(this);
|
||||
@@ -562,7 +564,7 @@ void SplitInput::addShortcuts()
|
||||
|
||||
if (copyFromSplit)
|
||||
{
|
||||
this->split_->copyToClipboard();
|
||||
this->channelView_->copySelectedText();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -641,9 +643,9 @@ void SplitInput::installKeyPressedEvent()
|
||||
if ((event->key() == Qt::Key_C || event->key() == Qt::Key_Insert) &&
|
||||
event->modifiers() == Qt::ControlModifier)
|
||||
{
|
||||
if (this->split_->view_->hasSelection())
|
||||
if (this->channelView_->hasSelection())
|
||||
{
|
||||
this->split_->copyToClipboard();
|
||||
this->channelView_->copySelectedText();
|
||||
event->accept();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ class InputCompletionPopup;
|
||||
class EffectLabel;
|
||||
class MessageThread;
|
||||
class ResizingTextEdit;
|
||||
class ChannelView;
|
||||
|
||||
// MessageOverflow is used for controlling how to guide the user into not
|
||||
// sending a message that will be discarded by Twitch
|
||||
@@ -42,7 +43,7 @@ class SplitInput : public BaseWidget
|
||||
|
||||
public:
|
||||
SplitInput(Split *_chatWidget, bool enableInlineReplying = true);
|
||||
SplitInput(QWidget *parent, Split *_chatWidget,
|
||||
SplitInput(QWidget *parent, Split *_chatWidget, ChannelView *_channelView,
|
||||
bool enableInlineReplying = true);
|
||||
|
||||
bool hasSelection() const;
|
||||
@@ -124,6 +125,7 @@ protected:
|
||||
bool shouldPreventInput(const QString &text) const;
|
||||
|
||||
Split *const split_;
|
||||
ChannelView *const channelView_;
|
||||
QObjectRef<EmotePopup> emotePopup_;
|
||||
QObjectRef<InputCompletionPopup> inputCompletionPopup_;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user