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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 29 additions and 2 deletions

View file

@ -11,6 +11,7 @@
- Bugfix: Fixed CTRL + C not working in reply thread popups. (#4209) - Bugfix: Fixed CTRL + C not working in reply thread popups. (#4209)
- Bugfix: Fixed message input showing as red after removing a message that was more than 500 characters. (#4204) - Bugfix: Fixed message input showing as red after removing a message that was more than 500 characters. (#4204)
- Bugfix: Fixed unnecessary saving of windows layout. (#4201) - Bugfix: Fixed unnecessary saving of windows layout. (#4201)
- Bugfix: Fixed Reply window missing selection clear behaviour between chat and input box. (#4218)
- Dev: Ignore `WM_SHOWWINDOW` hide events, causing fewer attempted rescales. (#4198) - Dev: Ignore `WM_SHOWWINDOW` hide events, causing fewer attempted rescales. (#4198)
## 2.4.0 ## 2.4.0

View file

@ -89,6 +89,22 @@ ReplyThreadPopup::ReplyThreadPopup(bool closeAutomatically, QWidget *parent,
this->updateInputUI(); this->updateInputUI();
})); }));
// clear SplitInput selection when selecting in ChannelView
this->ui_.threadView->selectionChanged.connect([this]() {
if (this->ui_.replyInput->hasSelection())
{
this->ui_.replyInput->clearSelection();
}
});
// clear ChannelView selection when selecting in SplitInput
this->ui_.replyInput->selectionChanged.connect([this]() {
if (this->ui_.threadView->hasSelection())
{
this->ui_.threadView->clearSelection();
}
});
layout->setSpacing(0); layout->setSpacing(0);
// provide draggable margin if frameless // provide draggable margin if frameless
auto marginPx = closeAutomatically ? 15 : 1; auto marginPx = closeAutomatically ? 15 : 1;

View file

@ -115,6 +115,7 @@ Split::Split(QWidget *parent)
}); });
this->updateInputPlaceholder(); this->updateInputPlaceholder();
// clear SplitInput selection when selecting in ChannelView
this->view_->selectionChanged.connect([this]() { this->view_->selectionChanged.connect([this]() {
if (this->input_->hasSelection()) 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]( this->view_->openChannelIn.connect([this](
QString twitchChannel, QString twitchChannel,
FromTwitchLinkOpenChannelIn openIn) { FromTwitchLinkOpenChannelIn openIn) {

View file

@ -155,12 +155,12 @@ void SplitInput::initLayout()
this->clearInput(); this->clearInput();
}); });
// clear channelview selection when selecting in the input // Forward selection change signal
QObject::connect(this->ui_.textEdit, &QTextEdit::copyAvailable, QObject::connect(this->ui_.textEdit, &QTextEdit::copyAvailable,
[this](bool available) { [this](bool available) {
if (available) if (available)
{ {
this->split_->view_->clearSelection(); this->selectionChanged.invoke();
} }
}); });

View file

@ -81,6 +81,7 @@ public:
bool isHidden() const; bool isHidden() const;
pajlada::Signals::Signal<const QString &> textChanged; pajlada::Signals::Signal<const QString &> textChanged;
pajlada::Signals::NoArgSignal selectionChanged;
protected: protected:
void scaleChangedEvent(float scale_) override; void scaleChangedEvent(float scale_) override;