Revert part of "Startup optimizations (#5090)" (fix #5207)

This reverts part of commit b130601716.
This commit is contained in:
David Capello 2025-06-10 21:18:16 -03:00
parent 2b522e222b
commit 2be4dc1474
2 changed files with 1 additions and 12 deletions

View File

@ -180,6 +180,7 @@ DitheringSelector::DitheringSelector(Type type) : m_type(type)
m_extChanges = extensions.DitheringMatricesChange.connect([this] { regenerate(); });
setUseCustomWidget(true);
regenerate();
}
void DitheringSelector::onInitTheme(ui::InitThemeEvent& ev)
@ -189,16 +190,6 @@ void DitheringSelector::onInitTheme(ui::InitThemeEvent& ev)
setSizeHint(calcItemSizeHint(0));
}
void DitheringSelector::onVisible(bool visible)
{
if (visible && !m_initialized) {
// Only do the expensive regeneration when we're set as visible for the first time.
regenerate();
m_initialized = true;
}
ComboBox::onVisible(visible);
}
void DitheringSelector::setSelectedItemByName(const std::string& name)
{
int index = findItemIndex(name);

View File

@ -31,7 +31,6 @@ public:
protected:
void onInitTheme(ui::InitThemeEvent& ev) override;
void onVisible(bool visible) override;
private:
void regenerate(int selectedItemIndex = 0);
@ -39,7 +38,6 @@ private:
Type m_type;
obs::scoped_connection m_extChanges;
bool m_initialized = false;
};
} // namespace app