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>2019-01-11 14:47:40 +0300
committerYuSanka <yusanka@gmail.com>2019-01-11 14:47:40 +0300
commit04c0b59bc65b1984988b2322ffc2b477ea69cf03 (patch)
treea177866e48dbf85c8c0845831b507232ab13111e
parent1e21388fe9f40589009062a1ef8e3b3d6bab4698 (diff)
Fixed wrong ModeButtons layout on settings tabs under OSX
-rw-r--r--src/slic3r/GUI/Tab.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp
index 4daaf5d63..05852097b 100644
--- a/src/slic3r/GUI/Tab.cpp
+++ b/src/slic3r/GUI/Tab.cpp
@@ -172,8 +172,8 @@ void Tab::create_preset_tab()
m_mode_sizer = new PrusaModeSizer(panel);
m_hsizer = new wxBoxSizer(wxHORIZONTAL);
- sizer->Add(m_hsizer, 0, wxBOTTOM, 3);
- m_hsizer->Add(m_presets_choice, 1, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, 3);
+ sizer->Add(m_hsizer, 0, wxEXPAND | wxBOTTOM, 3);
+ m_hsizer->Add(m_presets_choice, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, 3);
m_hsizer->AddSpacer(4);
m_hsizer->Add(m_btn_save_preset, 0, wxALIGN_CENTER_VERTICAL);
m_hsizer->AddSpacer(4);
@@ -185,8 +185,12 @@ void Tab::create_preset_tab()
m_hsizer->Add(m_undo_btn, 0, wxALIGN_CENTER_VERTICAL);
m_hsizer->AddSpacer(32);
m_hsizer->Add(m_question_btn, 0, wxALIGN_CENTER_VERTICAL);
- m_hsizer->AddStretchSpacer(32);
- m_hsizer->Add(m_mode_sizer, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
+ // m_hsizer->AddStretchSpacer(32);
+ // StretchSpacer has a strange behavior under OSX, so
+ // There is used just additional sizer for m_mode_sizer with right alignment
+ auto mode_sizer = new wxBoxSizer(wxVERTICAL);
+ mode_sizer->Add(m_mode_sizer, 1, wxALIGN_RIGHT);
+ m_hsizer->Add(mode_sizer, 1, wxALIGN_CENTER_VERTICAL | wxRIGHT, wxOSX ? 15 : 5);
//Horizontal sizer to hold the tree and the selected page.
m_hsizer = new wxBoxSizer(wxHORIZONTAL);
@@ -681,18 +685,16 @@ void Tab::update_visibility()
page->update_visibility(mode);
update_page_tree_visibility();
- m_hsizer->Layout();
- Refresh();
+ // update mode for ModeSizer
+ m_mode_sizer->SetMode(mode);
+ Layout();
Thaw();
// to update tree items color
wxTheApp->CallAfter([this]() {
update_changed_tree_ui();
});
-
- // update mode for ModeSizer
- m_mode_sizer->SetMode(mode);
}
Field* Tab::get_field(const t_config_option_key& opt_key, int opt_index/* = -1*/) const