summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-01-09 13:02:07 +0000
committerCarl Hetherington <cth@carlh.net>2019-01-09 13:02:07 +0000
commitb62d21ac6da0d253fc5b477b7c5d867b37360994 (patch)
tree01133c1e8dbb2e2118f1c05547a0743c511ef956 /src
parent9549ecffd4b63e48a2a3f4c58033691a36eee111 (diff)
More LHS sizing hacks.
Diffstat (limited to 'src')
-rw-r--r--src/wx/content_sub_panel.cc11
1 files 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 <wx/notebook.h>
+#include <wx/display.h>
#include <boost/foreach.hpp>
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)
{