fix: notebook custom button resizing/layout (#6453)

This commit is contained in:
pajlada
2025-09-07 15:50:09 +02:00
committed by GitHub
parent cd802e9300
commit c51fdd2a0e
3 changed files with 9 additions and 6 deletions
+1 -1
View File
@@ -4,7 +4,7 @@
- Bugfix: Fixed crashes that could occur when Lua functions errored with values other than strings. (#6441) - Bugfix: Fixed crashes that could occur when Lua functions errored with values other than strings. (#6441)
- Bugfix: Fixed zero-width global BTTV emotes not showing in the `:~` completions. (#6440) - Bugfix: Fixed zero-width global BTTV emotes not showing in the `:~` completions. (#6440)
- Bugfix: Fixed an issue where the update button would be unclickable on macOS and Linux. (#6447) - Bugfix: Fixed an issue where the update button would be unclickable on macOS and Linux. (#6447, #6453)
- Bugfix: Fixed flickering tooltips on Wayland when the mouse cursor is over them. (#6451) - Bugfix: Fixed flickering tooltips on Wayland when the mouse cursor is over them. (#6451)
## 2.5.4-beta.1 ## 2.5.4-beta.1
+8 -4
View File
@@ -801,7 +801,9 @@ void Notebook::performHorizontalLayout(const LayoutContext &ctx, bool animated)
// set size of custom buttons (settings, user, ...) // set size of custom buttons (settings, user, ...)
for (auto *btn : this->customButtons_) for (auto *btn : this->customButtons_)
{ {
if (!btn->isVisible()) // We use isHidden here since the layout can happen when the button has
// been added but before it's shown
if (btn->isHidden())
{ {
continue; continue;
} }
@@ -925,7 +927,7 @@ void Notebook::performVerticalLayout(const LayoutContext &ctx, bool animated)
btnIt != this->customButtons_.rend(); ++btnIt) btnIt != this->customButtons_.rend(); ++btnIt)
{ {
auto *btn = *btnIt; auto *btn = *btnIt;
if (!btn->isVisible()) if (btn->isHidden())
{ {
continue; continue;
} }
@@ -945,7 +947,7 @@ void Notebook::performVerticalLayout(const LayoutContext &ctx, bool animated)
// set size of custom buttons (settings, user, ...) // set size of custom buttons (settings, user, ...)
for (auto *btn : this->customButtons_) for (auto *btn : this->customButtons_)
{ {
if (!btn->isVisible()) if (btn->isHidden())
{ {
continue; continue;
} }
@@ -1203,7 +1205,7 @@ size_t Notebook::visibleButtonCount() const
size_t i = 0; size_t i = 0;
for (auto *btn : this->customButtons_) for (auto *btn : this->customButtons_)
{ {
if (btn->isVisible()) if (!btn->isHidden())
{ {
++i; ++i;
} }
@@ -1508,6 +1510,8 @@ void SplitNotebook::addCustomButtons()
QObject::connect(getApp()->getStreamerMode(), &IStreamerMode::changed, this, QObject::connect(getApp()->getStreamerMode(), &IStreamerMode::changed, this,
&SplitNotebook::updateStreamerModeIcon); &SplitNotebook::updateStreamerModeIcon);
this->updateStreamerModeIcon(); this->updateStreamerModeIcon();
this->performLayout(false);
} }
void SplitNotebook::updateStreamerModeIcon() void SplitNotebook::updateStreamerModeIcon()
-1
View File
@@ -138,7 +138,6 @@ protected:
{ {
auto *btn = new T(std::forward<decltype(args)>(args)..., this); auto *btn = new T(std::forward<decltype(args)>(args)..., this);
this->customButtons_.push_back(btn); this->customButtons_.push_back(btn);
this->performLayout();
return btn; return btn;
} }