mirror of https://github.com/aseprite/aseprite.git
This reverts part of commit b130601716
.
This commit is contained in:
parent
2b522e222b
commit
2be4dc1474
|
@ -180,6 +180,7 @@ DitheringSelector::DitheringSelector(Type type) : m_type(type)
|
||||||
m_extChanges = extensions.DitheringMatricesChange.connect([this] { regenerate(); });
|
m_extChanges = extensions.DitheringMatricesChange.connect([this] { regenerate(); });
|
||||||
|
|
||||||
setUseCustomWidget(true);
|
setUseCustomWidget(true);
|
||||||
|
regenerate();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DitheringSelector::onInitTheme(ui::InitThemeEvent& ev)
|
void DitheringSelector::onInitTheme(ui::InitThemeEvent& ev)
|
||||||
|
@ -189,16 +190,6 @@ void DitheringSelector::onInitTheme(ui::InitThemeEvent& ev)
|
||||||
setSizeHint(calcItemSizeHint(0));
|
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)
|
void DitheringSelector::setSelectedItemByName(const std::string& name)
|
||||||
{
|
{
|
||||||
int index = findItemIndex(name);
|
int index = findItemIndex(name);
|
||||||
|
|
|
@ -31,7 +31,6 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void onInitTheme(ui::InitThemeEvent& ev) override;
|
void onInitTheme(ui::InitThemeEvent& ev) override;
|
||||||
void onVisible(bool visible) override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void regenerate(int selectedItemIndex = 0);
|
void regenerate(int selectedItemIndex = 0);
|
||||||
|
@ -39,7 +38,6 @@ private:
|
||||||
|
|
||||||
Type m_type;
|
Type m_type;
|
||||||
obs::scoped_connection m_extChanges;
|
obs::scoped_connection m_extChanges;
|
||||||
bool m_initialized = false;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace app
|
} // namespace app
|
||||||
|
|
Loading…
Reference in New Issue