mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-25 15:47:25 +08:00
parent
64e68f418b
commit
19b7827511
@ -35,6 +35,11 @@
|
|||||||
#include "slic3r/Config/Snapshot.hpp"
|
#include "slic3r/Config/Snapshot.hpp"
|
||||||
#include "slic3r/Utils/PresetUpdater.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 Slic3r {
|
||||||
namespace GUI {
|
namespace GUI {
|
||||||
@ -409,6 +414,10 @@ ConfigWizardPage::ConfigWizardPage(ConfigWizard *parent, wxString title, wxStrin
|
|||||||
|
|
||||||
SetSizer(sizer);
|
SetSizer(sizer);
|
||||||
|
|
||||||
|
// 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();
|
this->Hide();
|
||||||
|
|
||||||
Bind(wxEVT_SIZE, [this](wxSizeEvent &event) {
|
Bind(wxEVT_SIZE, [this](wxSizeEvent &event) {
|
||||||
@ -2642,6 +2651,20 @@ ConfigWizard::ConfigWizard(wxWindow *parent)
|
|||||||
|
|
||||||
Layout();
|
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() {}
|
ConfigWizard::~ConfigWizard() {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user