Improve panel resizing performance

By avoiding calculating bounds for HIDDEN panel's children.
This commit is contained in:
martincapello 2025-05-13 14:51:16 -03:00 committed by David Capello
parent 1519589184
commit afbd28b3b4
2 changed files with 4 additions and 2 deletions

View File

@ -696,7 +696,6 @@ public:
onChangeBgScope(); onChangeBgScope();
onChangeGridScope(); onChangeGridScope();
sectionListbox()->selectIndex(m_curSection);
// Aseprite format preferences // Aseprite format preferences
celFormat()->setSelectedItemIndex(int(m_pref.asepriteFormat.celFormat())); celFormat()->setSelectedItemIndex(int(m_pref.asepriteFormat.celFormat()));
@ -1046,6 +1045,9 @@ public:
return true; return true;
} }
protected:
void onOpen(Event& evt) override { sectionListbox()->selectIndex(m_curSection); }
private: private:
void onInitTheme(InitThemeEvent& ev) override void onInitTheme(InitThemeEvent& ev) override
{ {

View File

@ -55,7 +55,7 @@ void Panel::onResize(ResizeEvent& ev)
// Set all the children to the same "cpos" // Set all the children to the same "cpos"
gfx::Rect cpos = childrenBounds(); gfx::Rect cpos = childrenBounds();
for (auto child : children()) { for (auto child : children()) {
if (!child->isDecorative()) if (!child->isDecorative() && child->isVisible())
child->setBounds(cpos); child->setBounds(cpos);
} }
} }