From 77d793c5404034be71a49a6026079929503deb5b Mon Sep 17 00:00:00 2001 From: YuSanka Date: Fri, 23 Aug 2019 09:43:38 +0200 Subject: [PATCH] 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 08d46444c4..25facdd340 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 66fe7c399b..2ba2664e8a 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: