summaryrefslogtreecommitdiffstats
path: root/src/ui/widget
diff options
context:
space:
mode:
authorAlexander Valavanis <valavanisalex@gmail.com>2017-07-06 19:05:52 +0000
committerAlexander Valavanis <valavanisalex@gmail.com>2017-07-06 19:05:52 +0000
commitb676ea2474b68e17c83dc33ebde3bc36b106c661 (patch)
treeb03b6c5f5bcbefb48a7e882f6c97894f63821d9a /src/ui/widget
parentGtkmm deprecation fixes (diff)
downloadinkscape-b676ea2474b68e17c83dc33ebde3bc36b106c661.tar.gz
inkscape-b676ea2474b68e17c83dc33ebde3bc36b106c661.zip
Gtkmm deprecation fixes
Diffstat (limited to 'src/ui/widget')
-rw-r--r--src/ui/widget/anchor-selector.cpp4
-rw-r--r--src/ui/widget/anchor-selector.h4
-rw-r--r--src/ui/widget/object-composite-settings.h1
-rw-r--r--src/ui/widget/preferences-widget.cpp72
4 files changed, 37 insertions, 44 deletions
diff --git a/src/ui/widget/anchor-selector.cpp b/src/ui/widget/anchor-selector.cpp
index ddc25775d..52768b7f1 100644
--- a/src/ui/widget/anchor-selector.cpp
+++ b/src/ui/widget/anchor-selector.cpp
@@ -28,9 +28,9 @@ void AnchorSelector::setupButton(const Glib::ustring& icon, Gtk::ToggleButton& b
}
AnchorSelector::AnchorSelector()
- : Gtk::Alignment(0.5, 0, 0, 0),
- _container()
+ : _container()
{
+ set_halign(Gtk::ALIGN_CENTER);
setupButton(INKSCAPE_ICON("boundingbox_top_left"), _buttons[0]);
setupButton(INKSCAPE_ICON("boundingbox_top"), _buttons[1]);
setupButton(INKSCAPE_ICON("boundingbox_top_right"), _buttons[2]);
diff --git a/src/ui/widget/anchor-selector.h b/src/ui/widget/anchor-selector.h
index 96331fae3..e756e9aa0 100644
--- a/src/ui/widget/anchor-selector.h
+++ b/src/ui/widget/anchor-selector.h
@@ -14,7 +14,7 @@
#include "config.h"
#endif
-#include <gtkmm/alignment.h>
+#include <gtkmm/bin.h>
#include <gtkmm/togglebutton.h>
#include <gtkmm/grid.h>
@@ -22,7 +22,7 @@ namespace Inkscape {
namespace UI {
namespace Widget {
-class AnchorSelector : public Gtk::Alignment
+class AnchorSelector : public Gtk::Bin
{
private:
Gtk::ToggleButton _buttons[9];
diff --git a/src/ui/widget/object-composite-settings.h b/src/ui/widget/object-composite-settings.h
index ae16564e1..d7525093f 100644
--- a/src/ui/widget/object-composite-settings.h
+++ b/src/ui/widget/object-composite-settings.h
@@ -12,7 +12,6 @@
*/
#include <gtkmm/box.h>
-#include <gtkmm/alignment.h>
#include <gtkmm/adjustment.h>
#include <gtkmm/label.h>
#include <gtkmm/scale.h>
diff --git a/src/ui/widget/preferences-widget.cpp b/src/ui/widget/preferences-widget.cpp
index b2cebcaa6..2981316c0 100644
--- a/src/ui/widget/preferences-widget.cpp
+++ b/src/ui/widget/preferences-widget.cpp
@@ -16,7 +16,6 @@
#include <gtkmm/box.h>
#include <gtkmm/frame.h>
-#include <gtkmm/alignment.h>
#include <gtkmm/scale.h>
#include <gtkmm/table.h>
@@ -77,9 +76,7 @@ void DialogPage::add_line(bool indent,
if (tip != "")
widget.set_tooltip_text (tip);
- Gtk::Alignment* label_alignment = Gtk::manage(new Gtk::Alignment());
-
- Gtk::HBox* hb = Gtk::manage(new Gtk::HBox());
+ auto hb = Gtk::manage(new Gtk::Box());
hb->set_spacing(12);
hb->pack_start(widget, expand_widget, expand_widget);
@@ -87,11 +84,7 @@ void DialogPage::add_line(bool indent,
if (other_widget)
hb->pack_start(*other_widget, expand_widget, expand_widget);
- // Pack the widget into an alignment container so that it can
- // be indented if desired
- Gtk::Alignment* w_alignment = Gtk::manage(new Gtk::Alignment());
- w_alignment->add(*hb);
- w_alignment->set_valign(Gtk::ALIGN_CENTER);
+ hb->set_valign(Gtk::ALIGN_CENTER);
// Add a label in the first column if provided
if (label != "")
@@ -100,30 +93,36 @@ void DialogPage::add_line(bool indent,
Gtk::ALIGN_CENTER, true));
label_widget->set_mnemonic_widget(widget);
- // Pack the label into an alignment container so that we can indent it
- // if necessary
- label_alignment->add(*label_widget);
-
- if (indent)
- label_alignment->set_padding(0, 0, 12, 0);
+ if (indent) {
+#if WITH_GTKMM_3_12
+ label_widget->set_margin_start(12);
+#else
+ label_widget->set_margin_left(12);
+#endif
+ }
- label_alignment->set_valign(Gtk::ALIGN_CENTER);
- add(*label_alignment);
- attach_next_to(*w_alignment, *label_alignment, Gtk::POS_RIGHT, 1, 1);
+ label_widget->set_valign(Gtk::ALIGN_CENTER);
+ add(*label_widget);
+ attach_next_to(*hb, *label_widget, Gtk::POS_RIGHT, 1, 1);
}
// Now add the widget to the bottom of the dialog
if (label == "")
{
- if (indent)
- w_alignment->set_padding(0, 0, 12, 0);
+ if (indent) {
+#if WITH_GTKMM_3_12
+ hb->set_margin_start(12);
+#else
+ hb->set_margin_left(12);
+#endif
+ }
- add(*w_alignment);
+ add(*hb);
GValue width = G_VALUE_INIT;
g_value_init(&width, G_TYPE_INT);
g_value_set_int(&width, 2);
- gtk_container_child_set_property(GTK_CONTAINER(gobj()), GTK_WIDGET(w_alignment->gobj()), "width", &width);
+ gtk_container_child_set_property(GTK_CONTAINER(gobj()), GTK_WIDGET(hb->gobj()), "width", &width);
}
// Add a label on the right of the widget if desired
@@ -505,24 +504,21 @@ ZoomCorrRulerSlider::init(int ruler_width, int ruler_height, double lower, doubl
_sb.set_increments (step_increment, 0);
_sb.set_value (value);
_sb.set_digits(2);
+ _sb.set_halign(Gtk::ALIGN_CENTER);
+ _sb.set_valign(Gtk::ALIGN_END);
_unit.set_data("sensitive", GINT_TO_POINTER(0));
_unit.setUnitType(UNIT_TYPE_LINEAR);
_unit.set_data("sensitive", GINT_TO_POINTER(1));
_unit.setUnit(prefs->getString("/options/zoomcorrection/unit"));
-
- Gtk::Alignment *alignment1 = Gtk::manage(new Gtk::Alignment(0.5,1,0,0));
- Gtk::Alignment *alignment2 = Gtk::manage(new Gtk::Alignment(0.5,1,0,0));
- alignment1->add(_sb);
- alignment2->add(_unit);
+ _unit.set_halign(Gtk::ALIGN_CENTER);
+ _unit.set_valign(Gtk::ALIGN_END);
auto table = Gtk::manage(new Gtk::Grid());
- table->attach(*_slider, 0, 0, 1, 1);
- alignment1->set_halign(Gtk::ALIGN_CENTER);
- table->attach(*alignment1, 1, 0, 1, 1);
- table->attach(_ruler, 0, 1, 1, 1);
- alignment2->set_halign(Gtk::ALIGN_CENTER);
- table->attach(*alignment2, 1, 1, 1, 1);
+ table->attach(*_slider, 0, 0, 1, 1);
+ table->attach(_sb, 1, 0, 1, 1);
+ table->attach(_ruler, 0, 1, 1, 1);
+ table->attach(_unit, 1, 1, 1, 1);
pack_start(*table, Gtk::PACK_SHRINK);
}
@@ -582,15 +578,13 @@ PrefSlider::init(Glib::ustring const &prefs_path,
_sb.set_increments (step_increment, 0);
_sb.set_value (value);
_sb.set_digits(digits);
-
- Gtk::Alignment *alignment1 = Gtk::manage(new Gtk::Alignment(0.5,1,0,0));
- alignment1->add(_sb);
+ _sb.set_halign(Gtk::ALIGN_CENTER);
+ _sb.set_valign(Gtk::ALIGN_END);
auto table = Gtk::manage(new Gtk::Grid());
_slider->set_hexpand();
- table->attach(*_slider, 0, 0, 1, 1);
- alignment1->set_halign(Gtk::ALIGN_CENTER);
- table->attach(*alignment1, 1, 0, 1, 1);
+ table->attach(*_slider, 0, 0, 1, 1);
+ table->attach(_sb, 1, 0, 1, 1);
this->pack_start(*table, Gtk::PACK_EXPAND_WIDGET);
}