summaryrefslogtreecommitdiffstats
path: root/src/ui/widget
diff options
context:
space:
mode:
authorsu_v <suv-sf@users.sourceforge.net>2013-03-08 08:59:37 +0000
committer~suv <suv-sf@users.sourceforge.net>2013-03-08 08:59:37 +0000
commitd8a3b36b43e0700126a7a25a1d38858d1a1d4836 (patch)
treeeaf5a86ac5542fc33ed8bb697a615e08ddd2ae01 /src/ui/widget
parentchanges_2013_02_25a.patch (diff)
parentDrop deprecated get_vbox method in Gtk::Dialog (diff)
downloadinkscape-d8a3b36b43e0700126a7a25a1d38858d1a1d4836.tar.gz
inkscape-d8a3b36b43e0700126a7a25a1d38858d1a1d4836.zip
merge from trunk (r12181)
(bzr r11668.1.53)
Diffstat (limited to 'src/ui/widget')
-rw-r--r--src/ui/widget/color-picker.cpp6
-rw-r--r--src/ui/widget/dock-item.cpp1
-rw-r--r--src/ui/widget/dock.cpp12
-rw-r--r--src/ui/widget/preferences-widget.cpp239
-rw-r--r--src/ui/widget/preferences-widget.h32
-rw-r--r--src/ui/widget/scalar.cpp2
-rw-r--r--src/ui/widget/spin-slider.cpp9
-rw-r--r--src/ui/widget/spin-slider.h8
-rw-r--r--src/ui/widget/tolerance-slider.cpp9
-rw-r--r--src/ui/widget/tolerance-slider.h13
10 files changed, 243 insertions, 88 deletions
diff --git a/src/ui/widget/color-picker.cpp b/src/ui/widget/color-picker.cpp
index 31fb3096c..5585f2db4 100644
--- a/src/ui/widget/color-picker.cpp
+++ b/src/ui/widget/color-picker.cpp
@@ -56,8 +56,14 @@ void ColorPicker::setupDialog(const Glib::ustring &title)
_colorSelectorDialog.set_title (title);
_colorSelectorDialog.set_border_width (4);
_colorSelector = SP_COLOR_SELECTOR(sp_color_selector_new(SP_TYPE_COLOR_NOTEBOOK));
+
+#if WITH_GTKMM_3_0
+ _colorSelectorDialog.get_content_area()->pack_start (
+ *Glib::wrap(&_colorSelector->vbox), true, true, 0);
+#else
_colorSelectorDialog.get_vbox()->pack_start (
*Glib::wrap(&_colorSelector->vbox), true, true, 0);
+#endif
g_signal_connect(G_OBJECT(_colorSelector), "dragged",
G_CALLBACK(sp_color_picker_color_mod), (void *)this);
diff --git a/src/ui/widget/dock-item.cpp b/src/ui/widget/dock-item.cpp
index b9cc50845..8d960ddc3 100644
--- a/src/ui/widget/dock-item.cpp
+++ b/src/ui/widget/dock-item.cpp
@@ -18,6 +18,7 @@
#include <gtkmm/icontheme.h>
#include <gtkmm/stockitem.h>
+#include <glibmm/exceptionhandler.h>
namespace Inkscape {
namespace UI {
diff --git a/src/ui/widget/dock.cpp b/src/ui/widget/dock.cpp
index a38a93fb1..2bfc7e0df 100644
--- a/src/ui/widget/dock.cpp
+++ b/src/ui/widget/dock.cpp
@@ -54,6 +54,17 @@ Dock::Dock(Gtk::Orientation orientation)
{
gdl_dock_bar_set_orientation(_gdl_dock_bar, static_cast<GtkOrientation>(orientation));
+#if WITH_GTKMM_3_0
+ switch(orientation) {
+ case Gtk::ORIENTATION_VERTICAL:
+ _dock_box = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL));
+ break;
+ case Gtk::ORIENTATION_HORIZONTAL:
+ _dock_box = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL));
+ }
+
+ _paned = Gtk::manage(new Gtk::Paned(orientation));
+#else
switch (orientation) {
case Gtk::ORIENTATION_VERTICAL:
_dock_box = Gtk::manage(new Gtk::HBox());
@@ -63,6 +74,7 @@ Dock::Dock(Gtk::Orientation orientation)
_dock_box = Gtk::manage(new Gtk::VBox());
_paned = Gtk::manage(new Gtk::HPaned());
}
+#endif
_scrolled_window->add(*_dock_box);
_scrolled_window->set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
diff --git a/src/ui/widget/preferences-widget.cpp b/src/ui/widget/preferences-widget.cpp
index e5b062ec9..314bf75bf 100644
--- a/src/ui/widget/preferences-widget.cpp
+++ b/src/ui/widget/preferences-widget.cpp
@@ -21,7 +21,9 @@
#include <gtkmm/box.h>
#include <gtkmm/frame.h>
#include <gtkmm/alignment.h>
+#include <gtkmm/scale.h>
#include <gtkmm/stock.h>
+#include <gtkmm/table.h>
#include "preferences.h"
#include "ui/widget/preferences-widget.h"
@@ -49,90 +51,139 @@ namespace Widget {
DialogPage::DialogPage()
{
- this->set_border_width(12);
- this->set_col_spacings(12);
- this->set_row_spacings(6);
+ set_border_width(12);
+
+#if WITH_GTKMM_3_0
+ set_orientation(Gtk::ORIENTATION_VERTICAL);
+ set_column_spacing(12);
+ set_row_spacing(6);
+#else
+ set_col_spacings(12);
+ set_row_spacings(6);
+#endif
}
-void DialogPage::add_line(bool indent, Glib::ustring const &label, Gtk::Widget &widget, Glib::ustring const &suffix, const Glib::ustring &tip, bool expand_widget, Gtk::Widget *other_widget)
+/**
+ * Add a widget to the bottom row of the dialog page
+ *
+ * \param[in] indent Whether the widget should be indented by one column
+ * \param[in] label The label text for the widget
+ * \param[in] widget The widget to add to the page
+ * \param[in] suffix Text for an optional label at the right of the widget
+ * \param[in] tip Tooltip text for the widget
+ * \param[in] expand_widget Whether to expand the widget horizontally
+ * \param[in] other_widget An optional additional widget to display at the right of the first one
+ */
+void DialogPage::add_line(bool indent,
+ Glib::ustring const &label,
+ Gtk::Widget &widget,
+ Glib::ustring const &suffix,
+ const Glib::ustring &tip,
+ bool expand_widget,
+ Gtk::Widget *other_widget)
{
- int start_col;
- int row = this->property_n_rows();
- Gtk::Widget* w;
- if (expand_widget)
- {
- w = &widget;
- }
- else
- {
- Gtk::HBox* hb = Gtk::manage(new Gtk::HBox());
- hb->set_spacing(12);
- hb->pack_start(widget,false,false);
- if (other_widget) {
- hb->pack_start(*other_widget,false,false);
- }
-
- w = (Gtk::Widget*) hb;
- }
+ if (tip != "")
+ widget.set_tooltip_text (tip);
+
+ Gtk::Alignment* label_alignment = Gtk::manage(new Gtk::Alignment());
+
+ Gtk::HBox* hb = Gtk::manage(new Gtk::HBox());
+ hb->set_spacing(12);
+ hb->pack_start(widget, expand_widget, expand_widget);
+
+ // Pack an additional widget into a box with the widget if desired
+ 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);
+
+#if WITH_GTKMM_3_0
+ w_alignment->set_valign(Gtk::ALIGN_CENTER);
+#else
+ guint row = property_n_rows();
+#endif
+
+ // Add a label in the first column if provided
if (label != "")
{
- Gtk::Label* label_widget;
- label_widget = Gtk::manage(new Gtk::Label(label , Gtk::ALIGN_START , Gtk::ALIGN_CENTER, true));
+ Gtk::Label* label_widget = Gtk::manage(new Gtk::Label(label, Gtk::ALIGN_START,
+ 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)
- {
- Gtk::Alignment* alignment = Gtk::manage(new Gtk::Alignment());
- alignment->set_padding(0, 0, 12, 0);
- alignment->add(*label_widget);
- this->attach(*alignment , 0, 1, row, row + 1, Gtk::FILL, Gtk::AttachOptions(), 0, 0);
- }
- else
- this->attach(*label_widget , 0, 1, row, row + 1, Gtk::FILL, Gtk::AttachOptions(), 0, 0);
- start_col = 1;
+ label_alignment->set_padding(0, 0, 12, 0);
+
+#if WITH_GTKMM_3_0
+ label_alignment->set_valign(Gtk::ALIGN_CENTER);
+ add(*label_alignment);
+ attach_next_to(*w_alignment, *label_alignment, Gtk::POS_RIGHT, 1, 1);
+#else
+ attach(*label_alignment, 0, 1, row, row + 1, Gtk::FILL, Gtk::AttachOptions(), 0, 0);
+#endif
}
- else
- start_col = 0;
- if (start_col == 0 && indent) //indent this widget
+ // Now add the widget to the bottom of the dialog
+#if WITH_GTKMM_3_0
+ if (label == "")
{
- Gtk::Alignment* alignment = Gtk::manage(new Gtk::Alignment());
- alignment->set_padding(0, 0, 12, 0);
- alignment->add(*w);
- this->attach(*alignment, start_col, 2, row, row + 1, Gtk::FILL | Gtk::EXPAND, Gtk::AttachOptions(), 0, 0);
- }
- else
- {
- this->attach(*w, start_col, 2, row, row + 1, Gtk::FILL | Gtk::EXPAND, Gtk::AttachOptions(), 0, 0);
- }
+ if (indent)
+ w_alignment->set_padding(0, 0, 12, 0);
+
+ add(*w_alignment);
+
+ 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);
+ }
+#else
+ // The widget should span two columns if there is no label
+ int w_col_span = 1;
+ if (label == "")
+ w_col_span = 2;
+
+ attach(*w_alignment, 2 - w_col_span, 2, row, row + 1,
+ Gtk::FILL | Gtk::EXPAND,
+ Gtk::AttachOptions(),
+ 0, 0);
+#endif
+ // Add a label on the right of the widget if desired
if (suffix != "")
{
Gtk::Label* suffix_widget = Gtk::manage(new Gtk::Label(suffix , Gtk::ALIGN_START , Gtk::ALIGN_CENTER, true));
- if (expand_widget)
- this->attach(*suffix_widget, 2, 3, row, row + 1, Gtk::FILL, Gtk::AttachOptions(), 0, 0);
- else
- ((Gtk::HBox*)w)->pack_start(*suffix_widget,false,false);
- }
-
- if (tip != "")
- {
- widget.set_tooltip_text (tip);
+ hb->pack_start(*suffix_widget,false,false);
}
}
void DialogPage::add_group_header(Glib::ustring name)
{
- int row = this->property_n_rows();
if (name != "")
{
Gtk::Label* label_widget = Gtk::manage(new Gtk::Label(Glib::ustring(/*"<span size='large'>*/"<b>") + name +
Glib::ustring("</b>"/*</span>"*/) , Gtk::ALIGN_START , Gtk::ALIGN_CENTER, true));
label_widget->set_use_markup(true);
- this->attach(*label_widget , 0, 4, row, row + 1, Gtk::FILL, Gtk::AttachOptions(), 0, 0);
+
+#if WITH_GTKMM_3_0
+ label_widget->set_valign(Gtk::ALIGN_CENTER);
+ add(*label_widget);
+// if (row != 1)
+ // set_row_spacing(row - 1, 18);
+#else
+ int row = property_n_rows();
+ attach(*label_widget , 0, 4, row, row + 1, Gtk::FILL, Gtk::AttachOptions(), 0, 0);
if (row != 1)
- this->set_row_spacing(row - 1, 18);
+ set_row_spacing(row - 1, 18);
+#endif
}
}
@@ -444,8 +495,8 @@ ZoomCorrRulerSlider::on_slider_value_changed()
{
freeze = true;
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
- prefs->setDouble("/options/zoomcorrection/value", _slider.get_value() / 100.0);
- _sb.set_value(_slider.get_value());
+ prefs->setDouble("/options/zoomcorrection/value", _slider->get_value() / 100.0);
+ _sb.set_value(_slider->get_value());
_ruler.queue_draw();
freeze = false;
}
@@ -459,7 +510,7 @@ ZoomCorrRulerSlider::on_spinbutton_value_changed()
freeze = true;
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
prefs->setDouble("/options/zoomcorrection/value", _sb.get_value() / 100.0);
- _slider.set_value(_sb.get_value());
+ _slider->set_value(_sb.get_value());
_ruler.queue_draw();
freeze = false;
}
@@ -498,13 +549,19 @@ ZoomCorrRulerSlider::init(int ruler_width, int ruler_height, double lower, doubl
_ruler.set_size(ruler_width, ruler_height);
- _slider.set_size_request(_ruler.width(), -1);
- _slider.set_range (lower, upper);
- _slider.set_increments (step_increment, page_increment);
- _slider.set_value (value);
- _slider.set_digits(2);
+#if WITH_GTKMM_3_0
+ _slider = Gtk::manage(new Gtk::Scale(Gtk::ORIENTATION_HORIZONTAL));
+#else
+ _slider = Gtk::manage(new Gtk::HScale());
+#endif
+
+ _slider->set_size_request(_ruler.width(), -1);
+ _slider->set_range (lower, upper);
+ _slider->set_increments (step_increment, page_increment);
+ _slider->set_value (value);
+ _slider->set_digits(2);
- _slider.signal_value_changed().connect(sigc::mem_fun(*this, &ZoomCorrRulerSlider::on_slider_value_changed));
+ _slider->signal_value_changed().connect(sigc::mem_fun(*this, &ZoomCorrRulerSlider::on_slider_value_changed));
_sb.signal_value_changed().connect(sigc::mem_fun(*this, &ZoomCorrRulerSlider::on_spinbutton_value_changed));
_unit.signal_changed().connect(sigc::mem_fun(*this, &ZoomCorrRulerSlider::on_unit_changed));
@@ -518,18 +575,28 @@ ZoomCorrRulerSlider::init(int ruler_width, int ruler_height, double lower, doubl
_unit.set_data("sensitive", GINT_TO_POINTER(1));
_unit.setUnit(prefs->getString("/options/zoomcorrection/unit"));
- Gtk::Table *table = Gtk::manage(new Gtk::Table());
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);
- table->attach(_slider, 0, 1, 0, 1);
+#if WITH_GTKMM_3_0
+ Gtk::Grid *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);
+#else
+ Gtk::Table *table = Gtk::manage(new Gtk::Table());
+ table->attach(*_slider, 0, 1, 0, 1);
table->attach(*alignment1, 1, 2, 0, 1, static_cast<Gtk::AttachOptions>(0));
table->attach(_ruler, 0, 1, 1, 2);
table->attach(*alignment2, 1, 2, 1, 2, static_cast<Gtk::AttachOptions>(0));
+#endif
- this->pack_start(*table, Gtk::PACK_EXPAND_WIDGET);
+ pack_start(*table, Gtk::PACK_SHRINK);
}
void
@@ -539,8 +606,8 @@ PrefSlider::on_slider_value_changed()
{
freeze = true;
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
- prefs->setDouble(_prefs_path, _slider.get_value());
- _sb.set_value(_slider.get_value());
+ prefs->setDouble(_prefs_path, _slider->get_value());
+ _sb.set_value(_slider->get_value());
freeze = false;
}
}
@@ -553,7 +620,7 @@ PrefSlider::on_spinbutton_value_changed()
freeze = true;
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
prefs->setDouble(_prefs_path, _sb.get_value());
- _slider.set_value(_sb.get_value());
+ _slider->set_value(_sb.get_value());
freeze = false;
}
}
@@ -574,11 +641,17 @@ PrefSlider::init(Glib::ustring const &prefs_path,
freeze = false;
- _slider.set_range (lower, upper);
- _slider.set_increments (step_increment, page_increment);
- _slider.set_value (value);
- _slider.set_digits(digits);
- _slider.signal_value_changed().connect(sigc::mem_fun(*this, &PrefSlider::on_slider_value_changed));
+#if WITH_GTKMM_3_0
+ _slider = Gtk::manage(new Gtk::Scale(Gtk::ORIENTATION_HORIZONTAL));
+#else
+ _slider = Gtk::manage(new Gtk::HScale());
+#endif
+
+ _slider->set_range (lower, upper);
+ _slider->set_increments (step_increment, page_increment);
+ _slider->set_value (value);
+ _slider->set_digits(digits);
+ _slider->signal_value_changed().connect(sigc::mem_fun(*this, &PrefSlider::on_slider_value_changed));
_sb.signal_value_changed().connect(sigc::mem_fun(*this, &PrefSlider::on_spinbutton_value_changed));
_sb.set_range (lower, upper);
@@ -586,12 +659,20 @@ PrefSlider::init(Glib::ustring const &prefs_path,
_sb.set_value (value);
_sb.set_digits(digits);
- Gtk::Table *table = Gtk::manage(new Gtk::Table());
Gtk::Alignment *alignment1 = Gtk::manage(new Gtk::Alignment(0.5,1,0,0));
alignment1->add(_sb);
- table->attach(_slider, 0, 1, 0, 1);
+#if WITH_GTKMM_3_0
+ Gtk::Grid *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);
+#else
+ Gtk::Table *table = Gtk::manage(new Gtk::Table());
+ table->attach(*_slider, 0, 1, 0, 1);
table->attach(*alignment1, 1, 2, 0, 1, static_cast<Gtk::AttachOptions>(0));
+#endif
this->pack_start(*table, Gtk::PACK_EXPAND_WIDGET);
}
diff --git a/src/ui/widget/preferences-widget.h b/src/ui/widget/preferences-widget.h
index 646a8b2fa..e3968045d 100644
--- a/src/ui/widget/preferences-widget.h
+++ b/src/ui/widget/preferences-widget.h
@@ -25,14 +25,26 @@
#include <gtkmm/radiobutton.h>
#include <gtkmm/comboboxtext.h>
#include <gtkmm/drawingarea.h>
-#include <gtkmm/scale.h>
+
+#if WITH_GTKMM_3_0
+#include <gtkmm/grid.h>
+#else
#include <gtkmm/table.h>
+#endif
#include "ui/widget/color-picker.h"
#include "ui/widget/unit-menu.h"
#include "ui/widget/spinbutton.h"
#include "ui/widget/scalar-unit.h"
+namespace Gtk {
+#if WITH_GTKMM_3_0
+class Scale;
+#else
+class HScale;
+#endif
+}
+
namespace Inkscape {
namespace UI {
namespace Widget {
@@ -137,7 +149,11 @@ private:
Inkscape::UI::Widget::SpinButton _sb;
UnitMenu _unit;
- Gtk::HScale _slider;
+#if WITH_GTKMM_3_0
+ Gtk::Scale* _slider;
+#else
+ Gtk::HScale* _slider;
+#endif
ZoomCorrRuler _ruler;
bool freeze; // used to block recursive updates of slider and spinbutton
};
@@ -155,7 +171,13 @@ private:
Glib::ustring _prefs_path;
Inkscape::UI::Widget::SpinButton _sb;
- Gtk::HScale _slider;
+
+#if WITH_GTKMM_3_0
+ Gtk::Scale* _slider;
+#else
+ Gtk::HScale* _slider;
+#endif
+
bool freeze; // used to block recursive updates of slider and spinbutton
};
@@ -251,7 +273,11 @@ protected:
void on_changed();
};
+#if WITH_GTKMM_3_0
+class DialogPage : public Gtk::Grid
+#else
class DialogPage : public Gtk::Table
+#endif
{
public:
DialogPage();
diff --git a/src/ui/widget/scalar.cpp b/src/ui/widget/scalar.cpp
index 9bbcc80f9..fca8a7974 100644
--- a/src/ui/widget/scalar.cpp
+++ b/src/ui/widget/scalar.cpp
@@ -142,7 +142,7 @@ void Scalar::update()
void Scalar::addSlider()
{
#if WITH_GTKMM_3_0
- Gtk::HScale *scale = new Gtk::HScale(static_cast<SpinButton*>(_widget)->get_adjustment());
+ Gtk::Scale *scale = new Gtk::Scale(static_cast<SpinButton*>(_widget)->get_adjustment());
#else
Gtk::HScale *scale = new Gtk::HScale( * static_cast<SpinButton*>(_widget)->get_adjustment() );
#endif
diff --git a/src/ui/widget/spin-slider.cpp b/src/ui/widget/spin-slider.cpp
index 323b1209c..facbf704c 100644
--- a/src/ui/widget/spin-slider.cpp
+++ b/src/ui/widget/spin-slider.cpp
@@ -116,11 +116,20 @@ Gtk::Adjustment& SpinSlider::get_adjustment()
return _adjustment;
}
+#if WITH_GTKMM_3_0
+const Gtk::Scale& SpinSlider::get_scale() const
+#else
const Gtk::HScale& SpinSlider::get_scale() const
+#endif
{
return _scale;
}
+
+#if WITH_GTKMM_3_0
+Gtk::Scale& SpinSlider::get_scale()
+#else
Gtk::HScale& SpinSlider::get_scale()
+#endif
{
return _scale;
}
diff --git a/src/ui/widget/spin-slider.h b/src/ui/widget/spin-slider.h
index f4a62107b..8a45299e5 100644
--- a/src/ui/widget/spin-slider.h
+++ b/src/ui/widget/spin-slider.h
@@ -41,13 +41,14 @@ public:
#if WITH_GTKMM_3_0
const Glib::RefPtr<Gtk::Adjustment> get_adjustment() const;
Glib::RefPtr<Gtk::Adjustment> get_adjustment();
+ const Gtk::Scale& get_scale() const;
+ Gtk::Scale& get_scale();
#else
const Gtk::Adjustment& get_adjustment() const;
Gtk::Adjustment& get_adjustment();
-#endif
-
const Gtk::HScale& get_scale() const;
Gtk::HScale& get_scale();
+#endif
const Inkscape::UI::Widget::SpinButton& get_spin_button() const;
Inkscape::UI::Widget::SpinButton& get_spin_button();
@@ -57,10 +58,11 @@ public:
private:
#if WITH_GTKMM_3_0
Glib::RefPtr<Gtk::Adjustment> _adjustment;
+ Gtk::Scale _scale;
#else
Gtk::Adjustment _adjustment;
-#endif
Gtk::HScale _scale;
+#endif
Inkscape::UI::Widget::SpinButton _spin;
};
diff --git a/src/ui/widget/tolerance-slider.cpp b/src/ui/widget/tolerance-slider.cpp
index 16558f0ee..f92a08d0a 100644
--- a/src/ui/widget/tolerance-slider.cpp
+++ b/src/ui/widget/tolerance-slider.cpp
@@ -73,8 +73,15 @@ void ToleranceSlider::init (const Glib::ustring& label1, const Glib::ustring& la
theLabel1->set_use_underline();
theLabel1->set_alignment(0, 0.5);
// align the label with the checkbox text above by indenting 22 px.
- _hbox->pack_start(*theLabel1, Gtk::PACK_EXPAND_WIDGET, 22);
+ _hbox->pack_start(*theLabel1, Gtk::PACK_EXPAND_WIDGET, 22);
+
+#if WITH_GTKMM_3_0
+ _hscale = manage(new Gtk::Scale(Gtk::ORIENTATION_HORIZONTAL));
+ _hscale->set_range(1.0, 51.0);
+#else
_hscale = manage (new Gtk::HScale (1.0, 51, 1.0));
+#endif
+
theLabel1->set_mnemonic_widget (*_hscale);
_hscale->set_draw_value (true);
_hscale->set_value_pos (Gtk::POS_RIGHT);
diff --git a/src/ui/widget/tolerance-slider.h b/src/ui/widget/tolerance-slider.h
index d0b78e3c1..2184cd52b 100644
--- a/src/ui/widget/tolerance-slider.h
+++ b/src/ui/widget/tolerance-slider.h
@@ -13,7 +13,12 @@
#include <gtkmm/radiobuttongroup.h>
namespace Gtk {
- class RadioButton;
+class RadioButton;
+#if WITH_GTKMM_3_0
+class Scale;
+#else
+class HScale;
+#endif
}
namespace Inkscape {
@@ -55,7 +60,13 @@ protected:
void on_toggled();
void update (double val);
Gtk::HBox *_hbox;
+
+#if WITH_GTKMM_3_0
+ Gtk::Scale *_hscale;
+#else
Gtk::HScale *_hscale;
+#endif
+
Gtk::RadioButtonGroup _radio_button_group;
Gtk::RadioButton *_button1;
Gtk::RadioButton *_button2;