fix: relayout notebook if any custom buttons change (#6328)
This commit is contained in:
@@ -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 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 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 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 some minor typos. (#6196)
|
||||||
- Bugfix: Fixed inconsistent spaces in messages when using fractional scaling. (#6231, #6254)
|
- 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)
|
- Bugfix: Fixed eventsub message delete notifications not being affected by "Show deletions of single messages". (#6233)
|
||||||
|
|||||||
@@ -1424,10 +1424,16 @@ void SplitNotebook::addCustomButtons()
|
|||||||
!getSettings()->hidePreferencesButton.getValue());
|
!getSettings()->hidePreferencesButton.getValue());
|
||||||
|
|
||||||
getSettings()->hidePreferencesButton.connect(
|
getSettings()->hidePreferencesButton.connect(
|
||||||
[settingsBtn](bool hide, auto) {
|
[this, settingsBtn](bool hide) {
|
||||||
settingsBtn->setVisible(!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] {
|
QObject::connect(settingsBtn, &Button::leftClicked, [this] {
|
||||||
@@ -1444,10 +1450,16 @@ void SplitNotebook::addCustomButtons()
|
|||||||
|
|
||||||
userBtn->setVisible(!getSettings()->hideUserButton.getValue());
|
userBtn->setVisible(!getSettings()->hideUserButton.getValue());
|
||||||
getSettings()->hideUserButton.connect(
|
getSettings()->hideUserButton.connect(
|
||||||
[userBtn](bool hide, auto) {
|
[this, userBtn](bool hide) {
|
||||||
userBtn->setVisible(!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] {
|
QObject::connect(userBtn, &Button::leftClicked, [this, userBtn] {
|
||||||
getApp()->getWindows()->showAccountSelectPopup(
|
getApp()->getWindows()->showAccountSelectPopup(
|
||||||
@@ -1489,8 +1501,16 @@ void SplitNotebook::updateStreamerModeIcon()
|
|||||||
this->streamerModeIcon_->setPixmap(
|
this->streamerModeIcon_->setPixmap(
|
||||||
getResources().buttons.streamerModeEnabledDark);
|
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()
|
void SplitNotebook::themeChangedEvent()
|
||||||
|
|||||||
@@ -170,9 +170,9 @@ protected:
|
|||||||
**/
|
**/
|
||||||
bool shouldShowTab(const NotebookTab *tab) const;
|
bool shouldShowTab(const NotebookTab *tab) const;
|
||||||
|
|
||||||
private:
|
|
||||||
void performLayout(bool animate = false);
|
void performLayout(bool animate = false);
|
||||||
|
|
||||||
|
private:
|
||||||
struct LayoutContext {
|
struct LayoutContext {
|
||||||
int left = 0;
|
int left = 0;
|
||||||
int right = 0;
|
int right = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user