summaryrefslogtreecommitdiffstats
path: root/src/widgets/toolbox.cpp
diff options
context:
space:
mode:
authorJon A. Cruz <jon@joncruz.org>2011-04-19 06:14:35 +0000
committerJon A. Cruz <jon@joncruz.org>2011-04-19 06:14:35 +0000
commit84766315ff4f59563bc8e6e100b6fc1d435df6f7 (patch)
tree356f15b57275349155e9c80a1b4323619be5645e /src/widgets/toolbox.cpp
parentdxf import. add support for longer cubic NURB (Bug 685707) (diff)
downloadinkscape-84766315ff4f59563bc8e6e100b6fc1d435df6f7.tar.gz
inkscape-84766315ff4f59563bc8e6e100b6fc1d435df6f7.zip
Restore modularity to adjustment action.
(bzr r10184)
Diffstat (limited to 'src/widgets/toolbox.cpp')
-rw-r--r--src/widgets/toolbox.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp
index fe87bc4e2..8496ec0d0 100644
--- a/src/widgets/toolbox.cpp
+++ b/src/widgets/toolbox.cpp
@@ -100,6 +100,7 @@
#include "../verbs.h"
#include "../widgets/button.h"
#include "../widgets/spinbutton-events.h"
+#include "ui/widget/spinbutton.h"
#include "../widgets/spw-utilities.h"
#include "../widgets/widget-sizes.h"
#include "../xml/attribute-record.h"
@@ -1052,6 +1053,14 @@ GtkWidget *ToolboxFactory::createSnapToolbox()
return toolboxNewCommon( tb, BAR_SNAP, GTK_POS_LEFT );
}
+static GtkWidget* createCustomSlider( GtkAdjustment *adjustment, gdouble climbRate, guint digits )
+{
+ Inkscape::UI::Widget::SpinButton *inkSpinner = new Inkscape::UI::Widget::SpinButton(*Glib::wrap(adjustment, true), climbRate, digits);
+ inkSpinner = Gtk::manage( inkSpinner );
+ GtkWidget *widget = GTK_WIDGET( inkSpinner->gobj() );
+ return widget;
+}
+
static EgeAdjustmentAction * create_adjustment_action( gchar const *name,
gchar const *label, gchar const *shortLabel, gchar const *tooltip,
Glib::ustring const &path, gdouble def,
@@ -1064,6 +1073,12 @@ static EgeAdjustmentAction * create_adjustment_action( gchar const *name,
void (*callback)(GtkAdjustment *, GObject *),
gdouble climb = 0.1, guint digits = 3, double factor = 1.0 )
{
+ static bool init = false;
+ if ( !init ) {
+ init = true;
+ ege_adjustment_action_set_compact_tool_factory( createCustomSlider );
+ }
+
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
GtkAdjustment* adj = GTK_ADJUSTMENT( gtk_adjustment_new( prefs->getDouble(path, def) * factor,
lower, upper, step, page, 0 ) );