diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b91c73a..07fcc70b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ - Bugfix: Fixed a crash that could occur when eventsub was enabled and Chatterino was attached to a conhost on Windows that was later gone. (#6161) - Bugfix: Fixed a crash that could occur an eventsub connection's keepalive timer would run after the connection was dead, causing the keepalive timer to use-itself-after-free. (#6204) - Bugfix: Fixed a crash that could occur when an image started loading mid app shutdown. (#6213) +- Bugfix: Fixed notebook buttons (settings, account switcher, streamer mode) not performing a relayout when their visibility changed, causing a gap until resize. Linux / macOS only. (#6328) - Bugfix: Fixed some minor typos. (#6196) - Bugfix: Fixed inconsistent spaces in messages when using fractional scaling. (#6231, #6254) - Bugfix: Fixed eventsub message delete notifications not being affected by "Show deletions of single messages". (#6233) diff --git a/src/widgets/Notebook.cpp b/src/widgets/Notebook.cpp index f5835d35..e99ffc5f 100644 --- a/src/widgets/Notebook.cpp +++ b/src/widgets/Notebook.cpp @@ -1424,10 +1424,16 @@ void SplitNotebook::addCustomButtons() !getSettings()->hidePreferencesButton.getValue()); getSettings()->hidePreferencesButton.connect( - [settingsBtn](bool hide, auto) { - settingsBtn->setVisible(!hide); + [this, settingsBtn](bool hide) { + auto oldVisibility = settingsBtn->isVisible(); + auto newVisibility = !hide; + settingsBtn->setVisible(newVisibility); + if (oldVisibility != newVisibility) + { + this->performLayout(); + } }, - this->signalHolder_); + this->signalHolder_, false); } QObject::connect(settingsBtn, &Button::leftClicked, [this] { @@ -1444,10 +1450,16 @@ void SplitNotebook::addCustomButtons() userBtn->setVisible(!getSettings()->hideUserButton.getValue()); getSettings()->hideUserButton.connect( - [userBtn](bool hide, auto) { - userBtn->setVisible(!hide); + [this, userBtn](bool hide) { + auto oldVisibility = userBtn->isVisible(); + auto newVisibility = !hide; + userBtn->setVisible(newVisibility); + if (oldVisibility != newVisibility) + { + this->performLayout(); + } }, - this->signalHolder_); + this->signalHolder_, false); QObject::connect(userBtn, &Button::leftClicked, [this, userBtn] { getApp()->getWindows()->showAccountSelectPopup( @@ -1489,8 +1501,16 @@ void SplitNotebook::updateStreamerModeIcon() this->streamerModeIcon_->setPixmap( getResources().buttons.streamerModeEnabledDark); } - this->streamerModeIcon_->setVisible( - getApp()->getStreamerMode()->isEnabled()); + + auto oldVisibility = this->streamerModeIcon_->isVisible(); + auto newVisibility = getApp()->getStreamerMode()->isEnabled(); + + this->streamerModeIcon_->setVisible(newVisibility); + + if (oldVisibility != newVisibility) + { + this->performLayout(); + } } void SplitNotebook::themeChangedEvent() diff --git a/src/widgets/Notebook.hpp b/src/widgets/Notebook.hpp index 1b4ec7b0..04b4a76d 100644 --- a/src/widgets/Notebook.hpp +++ b/src/widgets/Notebook.hpp @@ -170,9 +170,9 @@ protected: **/ bool shouldShowTab(const NotebookTab *tab) const; -private: void performLayout(bool animate = false); +private: struct LayoutContext { int left = 0; int right = 0;