Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuSanka <yusanka@gmail.com>2020-12-17 02:37:07 +0300
committerOleksandra Yushchenko <yusanka@gmail.com>2020-12-17 10:44:40 +0300
commit19b7827511db2a46911ec6567decd0a54beffa13 (patch)
treea5ee55da227e3f4e6321695663220b69f4dcb1aa
parent64e68f418b94e5f63226b78e553fc3e121ea9454 (diff)
Fix of #5103 and #4861 - ConfigWizard layout issues
-rw-r--r--src/slic3r/GUI/ConfigWizard.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/slic3r/GUI/ConfigWizard.cpp b/src/slic3r/GUI/ConfigWizard.cpp
index 00cf06e7d..f69826139 100644
--- a/src/slic3r/GUI/ConfigWizard.cpp
+++ b/src/slic3r/GUI/ConfigWizard.cpp
@@ -35,6 +35,11 @@
#include "slic3r/Config/Snapshot.hpp"
#include "slic3r/Utils/PresetUpdater.hpp"
+#if defined(__linux__) && defined(__WXGTK3__)
+#define wxLinux_gtk3 true
+#else
+#define wxLinux_gtk3 false
+#endif //defined(__linux__) && defined(__WXGTK3__)
namespace Slic3r {
namespace GUI {
@@ -409,7 +414,11 @@ ConfigWizardPage::ConfigWizardPage(ConfigWizard *parent, wxString title, wxStrin
SetSizer(sizer);
- this->Hide();
+ // There is strange layout on Linux with GTK3,
+ // see https://github.com/prusa3d/PrusaSlicer/issues/5103 and https://github.com/prusa3d/PrusaSlicer/issues/4861
+ // So, non-active pages will be hidden later, on wxEVT_SHOW, after completed Layout() for all pages
+ if (!wxLinux_gtk3)
+ this->Hide();
Bind(wxEVT_SIZE, [this](wxSizeEvent &event) {
this->Layout();
@@ -2642,6 +2651,20 @@ ConfigWizard::ConfigWizard(wxWindow *parent)
Layout();
});
+
+ if (wxLinux_gtk3)
+ this->Bind(wxEVT_SHOW, [this, vsizer](const wxShowEvent& e) {
+ ConfigWizardPage* active_page = p->index->active_page();
+ if (!active_page)
+ return;
+ for (auto page : p->all_pages)
+ if (page != active_page)
+ page->Hide();
+ // update best size for the dialog after hiding of the non-active pages
+ vsizer->SetSizeHints(this);
+ // set initial dialog size
+ p->init_dialog_size();
+ });
}
ConfigWizard::~ConfigWizard() {}