fix: relayout notebook if any custom buttons change (#6328)

This commit is contained in:
pajlada
2025-07-12 15:52:41 +02:00
committed by GitHub
parent 627b6d806e
commit f2b438ab24
3 changed files with 30 additions and 9 deletions
+1
View File
@@ -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)
+28 -8
View File
@@ -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()
+1 -1
View File
@@ -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;