Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

Refactor layout handling in export popups

Abel You0c7592880cdb
diff --git a/toonz/sources/toonz/exportalllevelspopup.cpp b/toonz/sources/toonz/exportalllevelspopup.cpp
index 43b08ec51..4bb271d7a 100644
--- a/toonz/sources/toonz/exportalllevelspopup.cpp
+++ b/toonz/sources/toonz/exportalllevelspopup.cpp
@@ -139,15 +139,10 @@ ExportAllLevelsPopup::ExportAllLevelsPopup(){
m_skipButton->setDisabled(true);
// Layout
- QLayout *fileFormatLayout =
- layout()
- ->itemAt(2)
- ->layout()
- ->itemAt(2)
- ->widget()
- ->layout();
- fileFormatLayout->addWidget(m_exportAll);
- fileFormatLayout->addWidget(m_skipButton);
+ QHBoxLayout *bottomLay = layout()->findChild<QHBoxLayout *>("bottomLay");
+ int count = bottomLay->count();
+ bottomLay->insertWidget(count - 1, m_exportAll);
+ bottomLay->insertWidget(count, m_skipButton);
// Establish connections
bool ret = true;
diff --git a/toonz/sources/toonz/exportlevelpopup.cpp b/toonz/sources/toonz/exportlevelpopup.cpp
index 217ef50f6..82b5978bd 100644
--- a/toonz/sources/toonz/exportlevelpopup.cpp
+++ b/toonz/sources/toonz/exportlevelpopup.cpp
@@ -299,6 +299,7 @@ ExportLevelPopup::ExportLevelPopup()
//-------------- Buttons Toolbar ---------------------
QHBoxLayout *bottomLay = new QHBoxLayout();
+ bottomLay->setObjectName("bottomLay");
bottomLay->setMargin(5);
bottomLay->setSpacing(3);
{