From 189312624a6083b6d0497743aeaf50737110a668 Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Fri, 23 Aug 2019 09:27:15 +0200 Subject: [PATCH 1/2] Disable layers editing if enabled while switching to SLA printer --- src/slic3r/GUI/GLCanvas3D.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 67f30c6e4..3e668c4d8 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -3607,7 +3607,15 @@ bool GLCanvas3D::_init_main_toolbar() item.sprite_id = 10; item.left.toggable = true; item.left.action_callback = [this]() { if (m_canvas != nullptr) wxPostEvent(m_canvas, SimpleEvent(EVT_GLTOOLBAR_LAYERSEDITING)); }; - item.visibility_callback = [this]()->bool { return m_process->current_printer_technology() == ptFFF; }; + item.visibility_callback = [this]()->bool + { + bool res = m_process->current_printer_technology() == ptFFF; + // turns off if changing printer technology + if (!res && m_main_toolbar.is_item_visible("layersediting") && m_main_toolbar.is_item_pressed("layersediting")) + force_main_toolbar_left_action(get_main_toolbar_item_id("layersediting")); + + return res; + }; item.enabling_callback = []()->bool { return wxGetApp().plater()->can_layers_editing(); }; if (!m_main_toolbar.add_item(item)) return false; From 77d793c5404034be71a49a6026079929503deb5b Mon Sep 17 00:00:00 2001 From: YuSanka Date: Fri, 23 Aug 2019 09:43:38 +0200 Subject: [PATCH 2/2] KBShortcutsDialog is changed to ScrollWindow --- src/slic3r/GUI/KBShortcutsDialog.cpp | 15 +++++++++++++-- src/slic3r/GUI/KBShortcutsDialog.hpp | 6 +++--- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/slic3r/GUI/KBShortcutsDialog.cpp b/src/slic3r/GUI/KBShortcutsDialog.cpp index 08d46444c..25facdd34 100644 --- a/src/slic3r/GUI/KBShortcutsDialog.cpp +++ b/src/slic3r/GUI/KBShortcutsDialog.cpp @@ -9,6 +9,11 @@ namespace Slic3r { namespace GUI { +enum { + DLG_WIDTH = 90, + DLG_HEIGHT = 60 +}; + KBShortcutsDialog::KBShortcutsDialog() : DPIDialog(NULL, wxID_ANY, wxString(SLIC3R_APP_NAME) + " - " + _(L("Keyboard Shortcuts")), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) @@ -34,7 +39,11 @@ KBShortcutsDialog::KBShortcutsDialog() fill_shortcuts(); - auto panel = new wxPanel(this); + const int em = em_unit(); + const wxSize& size = wxSize(DLG_WIDTH * em, DLG_HEIGHT * em); + panel = new wxScrolledWindow(this, wxID_ANY, wxDefaultPosition, size); + panel->SetScrollbars(1, 20, 1, 2); + auto main_grid_sizer = new wxFlexGridSizer(2, 10, 10); panel->SetSizer(main_grid_sizer); main_sizer->Add(panel, 1, wxEXPAND | wxALL, 0); @@ -207,7 +216,9 @@ void KBShortcutsDialog::on_dpi_changed(const wxRect &suggested_rect) msw_buttons_rescale(this, em, { wxID_OK }); - const wxSize& size = wxSize(85 * em, 75 * em); + const wxSize& size = wxSize(DLG_WIDTH * em, DLG_HEIGHT * em); + + panel->SetMinSize(size); SetMinSize(size); Fit(); diff --git a/src/slic3r/GUI/KBShortcutsDialog.hpp b/src/slic3r/GUI/KBShortcutsDialog.hpp index 66fe7c399..2ba2664e8 100644 --- a/src/slic3r/GUI/KBShortcutsDialog.hpp +++ b/src/slic3r/GUI/KBShortcutsDialog.hpp @@ -23,10 +23,10 @@ class KBShortcutsDialog : public DPIDialog typedef std::vector< Shortcut > Shortcuts; typedef std::vector< std::pair> > ShortcutsVec; - wxString text_info {wxEmptyString}; + wxScrolledWindow* panel; - ShortcutsVec m_full_shortcuts; - ScalableBitmap m_logo_bmp; + ShortcutsVec m_full_shortcuts; + ScalableBitmap m_logo_bmp; std::vector m_head_bitmaps; public: