fix: get rid of duplicate scale events (#5404)

This commit is contained in:
nerix
2024-05-19 11:11:51 +02:00
committed by GitHub
parent 869562263f
commit 8689bdb481
9 changed files with 55 additions and 26 deletions
+14 -1
View File
@@ -593,6 +593,12 @@ void Notebook::showTabVisibilityInfoPopup()
void Notebook::refresh()
{
if (this->refreshPaused_)
{
this->refreshRequested_ = true;
return;
}
this->performLayout();
this->updateTabVisibility();
}
@@ -652,13 +658,20 @@ void Notebook::resizeAddButton()
this->addButton_->setFixedSize(h, h);
}
void Notebook::scaleChangedEvent(float)
void Notebook::scaleChangedEvent(float /*scale*/)
{
this->resizeAddButton();
this->refreshPaused_ = true;
this->refreshRequested_ = false;
for (auto &i : this->items_)
{
i.tab->updateSize();
}
this->refreshPaused_ = false;
if (this->refreshRequested_)
{
this->refresh();
}
}
void Notebook::resizeEvent(QResizeEvent *)