From 8443e763c7f564e25f0483431788166e6e042314 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Wed, 24 Aug 2022 11:03:11 +0200 Subject: [PATCH] Fix for #8693 - GUI: Layout of "Object Manipulation"-Panel is broken (Linux GTK3) --- src/slic3r/GUI/GUI_ObjectManipulation.cpp | 4 ++-- src/slic3r/GUI/OptionsGroup.hpp | 5 +++++ src/slic3r/GUI/Plater.cpp | 6 +----- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/slic3r/GUI/GUI_ObjectManipulation.cpp b/src/slic3r/GUI/GUI_ObjectManipulation.cpp index a538f2b33..061f86e76 100644 --- a/src/slic3r/GUI/GUI_ObjectManipulation.cpp +++ b/src/slic3r/GUI/GUI_ObjectManipulation.cpp @@ -257,9 +257,9 @@ ObjectManipulation::ObjectManipulation(wxWindow* parent) : // axis_name->SetForegroundColour(wxColour(axes_color_text[axis_idx])); sizer = new wxBoxSizer(wxHORIZONTAL); - // Under OSX we use font, smaller than default font, so + // Under OSX or Linux with GTK3 we use font, smaller than default font, so // there is a next trick for an equivalent layout of coordinates combobox and axes labels in they own sizers - if (wxOSX) + if (wxOSX || wxGTK3) sizer->SetMinSize(-1, m_word_local_combo->GetBestHeight(-1)); sizer->Add(axis_name, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, border); diff --git a/src/slic3r/GUI/OptionsGroup.hpp b/src/slic3r/GUI/OptionsGroup.hpp index f3efd0680..4faf9cd2f 100644 --- a/src/slic3r/GUI/OptionsGroup.hpp +++ b/src/slic3r/GUI/OptionsGroup.hpp @@ -18,6 +18,11 @@ #define wxOSX true #else #define wxOSX false +#endif +#ifdef __WXGTK3__ + #define wxGTK3 true +#else + #define wxGTK3 false #endif #define BORDER(a, b) ((wxOSX ? a : b)) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index c50b8f56b..69902571a 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -867,11 +867,7 @@ Sidebar::Sidebar(Plater *parent) if (p->mode_sizer) scrolled_sizer->Add(p->mode_sizer, 0, wxALIGN_CENTER_HORIZONTAL); -#ifdef __WXGTK3__ - int size_margin = wxLEFT | wxRIGHT; -#else - int size_margin = wxLEFT; -#endif // __WXGTK3__ + int size_margin = wxGTK3 ? wxLEFT | wxRIGHT : wxLEFT; is_msw ? scrolled_sizer->Add(p->presets_panel, 0, wxEXPAND | size_margin, margin_5) :