From 519fdb8d3f3338f26db41292b2f0fb8f2efd14db Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Wed, 9 Nov 2011 21:13:18 +0100 Subject: lpe: add slider to scalar param optionally (does not work very well yet) (bzr r10735) --- src/ui/widget/scalar.cpp | 11 +++++++++-- src/ui/widget/scalar.h | 5 +++++ 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'src/ui') diff --git a/src/ui/widget/scalar.cpp b/src/ui/widget/scalar.cpp index 220498561..cc051599c 100644 --- a/src/ui/widget/scalar.cpp +++ b/src/ui/widget/scalar.cpp @@ -3,8 +3,9 @@ * Carl Hetherington * Derek P. Moore * Bryce Harrington + * Johan Engelen * - * Copyright (C) 2004 Carl Hetherington + * Copyright (C) 2004-2011 authors * * Released under GNU GPL. Read the file 'COPYING' for more information. */ @@ -16,6 +17,7 @@ #include "scalar.h" #include "spinbutton.h" +#include namespace Inkscape { namespace UI { @@ -133,7 +135,12 @@ void Scalar::update() static_cast(_widget)->update(); } - +void Scalar::addSlider() +{ + Gtk::HScale *scale = new Gtk::HScale( * static_cast(_widget)->get_adjustment() ); + scale->set_draw_value(false); + add (*manage (scale)); +} Glib::SignalProxy0 Scalar::signal_value_changed() { diff --git a/src/ui/widget/scalar.h b/src/ui/widget/scalar.h index c73bcc62a..19ccb7ae0 100644 --- a/src/ui/widget/scalar.h +++ b/src/ui/widget/scalar.h @@ -142,6 +142,11 @@ public: */ void update(); + /** + * Adds a slider (HScale) to the left of the spinbox. + */ + void addSlider(); + /** * Signal raised when the spin button's value changes. */ -- cgit v1.2.3