diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-10-20 16:52:04 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-10-20 16:52:04 +0200 |
| commit | 15723e1ba0574d4c62458321e9b6d64236e7e429 (patch) | |
| tree | eddb4d1caa58d360875238ed6c9ef1dd9f09365e /src/wx/content_panel.cc | |
| parent | a28058f5e2f7e7bf3aa5af9e499bda630b7af7bc (diff) | |
Move contents of ContentPanel::first_shown into LimitedSplitter.
Diffstat (limited to 'src/wx/content_panel.cc')
| -rw-r--r-- | src/wx/content_panel.cc | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/src/wx/content_panel.cc b/src/wx/content_panel.cc index 2c5fea79b..0fd21ff86 100644 --- a/src/wx/content_panel.cc +++ b/src/wx/content_panel.cc @@ -154,17 +154,7 @@ ContentPanel::ContentPanel (wxNotebook* n, shared_ptr<Film> film, weak_ptr<FilmV void ContentPanel::first_shown () { - int const sn = wxDisplay::GetFromWindow(_splitter); - if (sn >= 0) { - wxRect const screen = wxDisplay(sn).GetClientArea(); - /* 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. - */ - _splitter->SplitHorizontally (_top_panel, _notebook, screen.height > 800 ? -600 : -150); - } else { - /* Fallback for when GetFromWindow fails for reasons that aren't clear */ - _splitter->SplitHorizontally (_top_panel, _notebook, -600); - } + _splitter->first_shown (_top_panel, _notebook); } @@ -809,3 +799,21 @@ ContentPanel::panels () const p.push_back (_timing_panel); return p; } + + +void +LimitedSplitter::first_shown (wxWindow* top, wxWindow* bottom) +{ + int const sn = wxDisplay::GetFromWindow(this); + if (sn >= 0) { + wxRect const screen = wxDisplay(sn).GetClientArea(); + /* 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. + */ + SplitHorizontally (top, bottom, screen.height > 800 ? -600 : -150); + } else { + /* Fallback for when GetFromWindow fails for reasons that aren't clear */ + SplitHorizontally (top, bottom, -600); + } + +} |
