Fix selection clearing not working in Reply window (#4218)

Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
kornes
2022-12-07 18:21:04 +00:00
committed by GitHub
parent e68a3fcd30
commit a16d148dfd
5 changed files with 29 additions and 2 deletions
+9
View File
@@ -115,6 +115,7 @@ Split::Split(QWidget *parent)
});
this->updateInputPlaceholder();
// clear SplitInput selection when selecting in ChannelView
this->view_->selectionChanged.connect([this]() {
if (this->input_->hasSelection())
{
@@ -122,6 +123,14 @@ Split::Split(QWidget *parent)
}
});
// clear ChannelView selection when selecting in SplitInput
this->input_->selectionChanged.connect([this]() {
if (this->view_->hasSelection())
{
this->view_->clearSelection();
}
});
this->view_->openChannelIn.connect([this](
QString twitchChannel,
FromTwitchLinkOpenChannelIn openIn) {
+2 -2
View File
@@ -155,12 +155,12 @@ void SplitInput::initLayout()
this->clearInput();
});
// clear channelview selection when selecting in the input
// Forward selection change signal
QObject::connect(this->ui_.textEdit, &QTextEdit::copyAvailable,
[this](bool available) {
if (available)
{
this->split_->view_->clearSelection();
this->selectionChanged.invoke();
}
});
+1
View File
@@ -81,6 +81,7 @@ public:
bool isHidden() const;
pajlada::Signals::Signal<const QString &> textChanged;
pajlada::Signals::NoArgSignal selectionChanged;
protected:
void scaleChangedEvent(float scale_) override;