From fb4c71b09a677d55aefdd24058ba5c3eeacd3618 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 10 Mar 2019 22:57:45 +0000 Subject: [PATCH] Try to stop the content list getting so small that buttons disappear. --- src/wx/content_panel.cc | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/wx/content_panel.cc b/src/wx/content_panel.cc index e6d4dbbb3..b1dfc16f4 100644 --- a/src/wx/content_panel.cc +++ b/src/wx/content_panel.cc @@ -62,6 +62,22 @@ using boost::weak_ptr; using boost::dynamic_pointer_cast; using boost::optional; +class LimitedSplitter : public wxSplitterWindow +{ +public: + LimitedSplitter (wxWindow* parent) + : wxSplitterWindow (parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3D | wxSP_LIVE_UPDATE) + { + + } + + bool OnSashPositionChange (int new_position) + { + /* Try to stop the top bit of the splitter getting so small that buttons disappear */ + return new_position > 220; + } +}; + ContentPanel::ContentPanel (wxNotebook* n, shared_ptr film, weak_ptr viewer) : _video_panel (0) , _audio_panel (0) @@ -77,7 +93,9 @@ ContentPanel::ContentPanel (wxNotebook* n, shared_ptr film, weak_ptr film, weak_ptrSplitHorizontally (top, _notebook, screen.height > 800 ? -600 : -150); _timing_panel = new TimingPanel (this, _film_viewer); -- 2.30.2