From 8b6ac0d9d8cfb0872755cca2548fff33a21126da Mon Sep 17 00:00:00 2001 From: Hombre Date: Sun, 13 Mar 2016 15:02:03 +0100 Subject: [PATCH 1/2] Fix #3193: the curve edit axis are now flowing automatically upon resize of the Tool panel. --- rtgui/coordinateadjuster.cc | 15 +++++++++++---- rtgui/coordinateadjuster.h | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/rtgui/coordinateadjuster.cc b/rtgui/coordinateadjuster.cc index 3a06409bf..4d08daeae 100644 --- a/rtgui/coordinateadjuster.cc +++ b/rtgui/coordinateadjuster.cc @@ -122,8 +122,6 @@ void CoordinateAdjuster::createWidgets(const std::vector &axis) axisAdjusters.resize(axis.size()); - set_spacing(3); - AxisAdjuster *currAdjuster = NULL; for (unsigned int i = 0; i < count; ++i) { @@ -133,8 +131,17 @@ void CoordinateAdjuster::createWidgets(const std::vector &axis) currAdjuster->rangeLowerBound = currAxis->rangeLowerBound; currAdjuster->rangeUpperBound = currAxis->rangeUpperBound; - pack_start(*(currAdjuster->label), Gtk::PACK_SHRINK, 0); - pack_start(*(currAdjuster->spinButton), Gtk::PACK_SHRINK, 0); + Gtk::Grid *box = Gtk::manage (new Gtk::Grid()); + box->set_orientation(Gtk::ORIENTATION_HORIZONTAL); + box->set_column_spacing(3); + + setExpandAlignProperties(currAdjuster->label, true, false, Gtk::ALIGN_START, Gtk::ALIGN_CENTER); + setExpandAlignProperties(currAdjuster->spinButton, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER); + + box->attach_next_to(*(currAdjuster->spinButton), Gtk::POS_LEFT, 1, 1); + box->attach_next_to(*(currAdjuster->label), Gtk::POS_LEFT, 1, 1); + + add(*box); } } diff --git a/rtgui/coordinateadjuster.h b/rtgui/coordinateadjuster.h index 8f00f8ae7..7edba5392 100644 --- a/rtgui/coordinateadjuster.h +++ b/rtgui/coordinateadjuster.h @@ -70,7 +70,7 @@ public: * * The position of the Axis in the vector will be used in the communication between the Adjuster and the Provider to identify the Axis */ -class CoordinateAdjuster : public Gtk::HBox +class CoordinateAdjuster : public Gtk::FlowBox { public: From e4259ae4b47ae527618d589ff41b0eef8184b398 Mon Sep 17 00:00:00 2001 From: Hombre Date: Mon, 14 Mar 2016 00:03:08 +0100 Subject: [PATCH 2/2] Expand spin buttons to avoid gap. --- rtgui/coordinateadjuster.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rtgui/coordinateadjuster.cc b/rtgui/coordinateadjuster.cc index 4d08daeae..c2d92f995 100644 --- a/rtgui/coordinateadjuster.cc +++ b/rtgui/coordinateadjuster.cc @@ -135,8 +135,8 @@ void CoordinateAdjuster::createWidgets(const std::vector &axis) box->set_orientation(Gtk::ORIENTATION_HORIZONTAL); box->set_column_spacing(3); - setExpandAlignProperties(currAdjuster->label, true, false, Gtk::ALIGN_START, Gtk::ALIGN_CENTER); - setExpandAlignProperties(currAdjuster->spinButton, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER); + setExpandAlignProperties(currAdjuster->label, false, false, Gtk::ALIGN_START, Gtk::ALIGN_CENTER); + setExpandAlignProperties(currAdjuster->spinButton, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER); box->attach_next_to(*(currAdjuster->spinButton), Gtk::POS_LEFT, 1, 1); box->attach_next_to(*(currAdjuster->label), Gtk::POS_LEFT, 1, 1);