X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Fcontent_sub_panel.cc;fp=src%2Fwx%2Fcontent_sub_panel.cc;h=ac3a02ce95f65ce08f44871030e33703c2635ad2;hb=b62d21ac6da0d253fc5b477b7c5d867b37360994;hp=2fe104563eb16db5d0d35908649bcab1c8f4e50c;hpb=9549ecffd4b63e48a2a3f4c58033691a36eee111;p=dcpomatic.git diff --git a/src/wx/content_sub_panel.cc b/src/wx/content_sub_panel.cc index 2fe104563..ac3a02ce9 100644 --- a/src/wx/content_sub_panel.cc +++ b/src/wx/content_sub_panel.cc @@ -25,6 +25,7 @@ #include "lib/compose.hpp" #include "lib/log.h" #include +#include #include using std::list; @@ -39,8 +40,13 @@ ContentSubPanel::ContentSubPanel (ContentPanel* p, wxString name) { SetScrollRate (8, 8); SetSizer (_sizer); - /* This stops the notebook collapsing to near-zero size. The 600 is a guess. */ - SetMinSize (wxSize(-1, 600)); + + /* This is a hack to try and make the content notebook a sensible size; large on big displays but small + enough on small displays to leave space for the content area. + */ + wxDisplay display (wxDisplay::GetFromWindow(p->notebook())); + wxRect screen = display.GetClientArea(); + SetMinSize (wxSize(-1, screen.height > 800 ? 600 : 320)); _grid = new wxGridBagSizer (DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP); _sizer->Add (_grid, 0, wxALL, 8); @@ -48,7 +54,6 @@ ContentSubPanel::ContentSubPanel (ContentPanel* p, wxString name) _config_connection = Config::instance()->Changed.connect (boost::bind (&ContentSubPanel::config_changed, this, _1)); } - void ContentSubPanel::config_changed (Config::Property p) {