From b62d21ac6da0d253fc5b477b7c5d867b37360994 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 9 Jan 2019 13:02:07 +0000 Subject: [PATCH] More LHS sizing hacks. --- src/wx/content_sub_panel.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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) { -- 2.30.2