From a6a368e68227edff3fa72ea499556bef85df9160 Mon Sep 17 00:00:00 2001 From: Thanatomanic <6567747+Thanatomanic@users.noreply.github.com> Date: Sat, 27 Feb 2021 08:03:36 +0100 Subject: [PATCH] Allow resizing of navigator window. Patch by @Lawrence37. Fixes #6052 --- rtgui/editorpanel.cc | 34 ++++++++++++++++------------------ rtgui/editorpanel.h | 2 +- rtgui/history.cc | 2 +- rtgui/navigator.cc | 4 ++-- 4 files changed, 20 insertions(+), 22 deletions(-) diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index 909b491f6..7553a7353 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -494,34 +494,32 @@ EditorPanel::EditorPanel (FilePanel* filePanel) // build left side panel leftbox = new Gtk::Paned (Gtk::ORIENTATION_VERTICAL); - // make a subbox to allow resizing of the histogram (if it's on the left) - leftsubbox = new Gtk::Box (Gtk::ORIENTATION_VERTICAL); - leftsubbox->set_size_request (230, 250); + // make a subpaned to allow resizing of the histogram (if it's on the left) + leftsubpaned = new Gtk::Paned(Gtk::ORIENTATION_VERTICAL); + leftsubpaned->set_size_request(230, 250); histogramPanel = nullptr; - profilep = Gtk::manage (new ProfilePanel ()); + profilep = Gtk::manage(new ProfilePanel()); ppframe = Gtk::manage(new Gtk::Frame()); ppframe->set_label_align(0.025, 0.5); ppframe->set_name ("ProfilePanel"); ppframe->add (*profilep); - ppframe->set_label (M ("PROFILEPANEL_LABEL")); - //leftsubbox->pack_start (*ppframe, Gtk::PACK_SHRINK, 4); + ppframe->set_label(M("PROFILEPANEL_LABEL")); + //leftsubpaned->pack_start (*ppframe, Gtk::PACK_SHRINK, 4); - navigator = Gtk::manage (new Navigator ()); - navigator->previewWindow->set_size_request (-1, 150 * RTScalable::getScale()); - leftsubbox->pack_start (*navigator, Gtk::PACK_SHRINK, 2); - - Gtk::Separator* historyseparator = Gtk::manage (new Gtk::Separator (Gtk::ORIENTATION_HORIZONTAL)); - leftsubbox->pack_start (*historyseparator, Gtk::PACK_SHRINK, 2); + navigator = Gtk::manage(new Navigator()); + navigator->previewWindow->set_size_request(-1, 150 * RTScalable::getScale()); + leftsubpaned->pack1(*navigator, false, false); - history = Gtk::manage (new History ()); - leftsubbox->pack_start (*history); + history = Gtk::manage(new History()); + leftsubpaned->pack2(*history, true, false); - leftsubbox->show_all (); + leftsubpaned->set_position(0); + leftsubpaned->show_all(); - leftbox->pack2 (*leftsubbox, true, true); - leftbox->show_all (); + leftbox->pack2(*leftsubpaned, true, true); + leftbox->show_all(); // build the middle of the screen Gtk::Box* editbox = Gtk::manage (new Gtk::Box (Gtk::ORIENTATION_VERTICAL)); @@ -905,7 +903,7 @@ EditorPanel::~EditorPanel () delete tpc; - delete leftsubbox; + delete leftsubpaned; delete leftbox; delete vsubboxright; delete vboxright; diff --git a/rtgui/editorpanel.h b/rtgui/editorpanel.h index e89689f0f..7675face5 100644 --- a/rtgui/editorpanel.h +++ b/rtgui/editorpanel.h @@ -224,7 +224,7 @@ private: Gtk::Image *iShowHideSidePanels_exit; Gtk::Image *iBeforeLockON, *iBeforeLockOFF; Gtk::Paned *leftbox; - Gtk::Box *leftsubbox; + Gtk::Paned *leftsubpaned; Gtk::Paned *vboxright; Gtk::Box *vsubboxright; diff --git a/rtgui/history.cc b/rtgui/history.cc index e30b3e8ce..dfc74af24 100644 --- a/rtgui/history.cc +++ b/rtgui/history.cc @@ -125,7 +125,7 @@ History::History (bool bookmarkSupport) : historyVPaned (nullptr), blistener (nu if (bookmarkSupport) { historyVPaned = Gtk::manage ( new Gtk::Paned (Gtk::ORIENTATION_VERTICAL) ); - historyVPaned->pack1 (*histFrame, true, true); + historyVPaned->pack1 (*histFrame, true, false); historyVPaned->pack2 (*bmFrame, false, false); pack_start (*historyVPaned); } else { diff --git a/rtgui/navigator.cc b/rtgui/navigator.cc index 4376162d7..42f605fa2 100644 --- a/rtgui/navigator.cc +++ b/rtgui/navigator.cc @@ -75,7 +75,7 @@ Navigator::Navigator() : set_name("Navigator"); Gtk::Box* mbox = Gtk::manage (new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); previewWindow = Gtk::manage (new PreviewWindow ()); - mbox->pack_start (*previewWindow, Gtk::PACK_SHRINK, 2); + mbox->pack_start (*previewWindow, Gtk::PACK_EXPAND_WIDGET, 2); dimension = Gtk::manage (new Gtk::Label ()); mbox->pack_start (*dimension, Gtk::PACK_SHRINK, 2); position = Gtk::manage (new Gtk::Label ()); @@ -242,7 +242,7 @@ Navigator::Navigator() : table0->set_column_homogeneous(true); // all cells will have equal width - mbox->pack_start (*table0, Gtk::PACK_EXPAND_WIDGET, 2); + mbox->pack_start (*table0, Gtk::PACK_SHRINK, 2); add (*mbox); setInvalid ();