diff options
Diffstat (limited to 'src/ui/widget')
| -rw-r--r-- | src/ui/widget/scalar.cpp | 2 | ||||
| -rw-r--r-- | src/ui/widget/spin-slider.cpp | 9 | ||||
| -rw-r--r-- | src/ui/widget/spin-slider.h | 8 | ||||
| -rw-r--r-- | src/ui/widget/tolerance-slider.cpp | 9 | ||||
| -rw-r--r-- | src/ui/widget/tolerance-slider.h | 13 |
5 files changed, 35 insertions, 6 deletions
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; |
