summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1f0aa55)
raw | patch | inline | side by side (parent: 1f0aa55)
author | joncruz <joncruz@users.sourceforge.net> | |
Tue, 1 Jul 2008 06:43:38 +0000 (06:43 +0000) | ||
committer | joncruz <joncruz@users.sourceforge.net> | |
Tue, 1 Jul 2008 06:43:38 +0000 (06:43 +0000) |
src/ege-adjustment-action.cpp | patch | blob | history | |
src/widgets/toolbox.cpp | patch | blob | history |
index 2380e2e6bf669fbf15bdcc48444d995bba1bd51c..c70fcc27d1cbf61c19cbdaa5b382c5acaa26337a 100644 (file)
#include <string.h>
#include <gdk/gdkkeysyms.h>
+#include <gtk/gtkversion.h>
#include <gtk/gtktoolitem.h>
#include <gtk/gtkspinbutton.h>
#include <gtk/gtkhscale.h>
+#if GTK_CHECK_VERSION(2,12,0)
+#include <gtk/gtkscalebutton.h>
+#include <gtk/gtkstock.h>
+#endif /* GTK_CHECK_VERSION(2,12,0) */
#include <gtk/gtkhbox.h>
#include <gtk/gtklabel.h>
#include <gtk/gtkmisc.h>
APPEARANCE_MINIMAL, // no label, just choices in a drop-down menu
};
+#if GTK_CHECK_VERSION(2,12,0)
+/* TODO need to have appropriate icons setup for these: */
+static const gchar *floogles[] = {
+ GTK_STOCK_REMOVE,
+ GTK_STOCK_ADD,
+ GTK_STOCK_GO_DOWN,
+ GTK_STOCK_ABOUT,
+ GTK_STOCK_GO_UP,
+ 0};
+#endif /* GTK_CHECK_VERSION(2,12,0) */
+
typedef struct _EgeAdjustmentDescr EgeAdjustmentDescr;
struct _EgeAdjustmentDescr
if ( act->private_data->appearanceMode == APPEARANCE_FULL ) {
spinbutton = gtk_hscale_new( act->private_data->adj);
gtk_widget_set_size_request(spinbutton, 100, -1);
+#if GTK_CHECK_VERSION(2,12,0)
+ } else if ( act->private_data->appearanceMode == APPEARANCE_MINIMAL ) {
+ spinbutton = gtk_scale_button_new( GTK_ICON_SIZE_MENU, 0, 100, 2, 0 );
+ gtk_scale_button_set_adjustment( GTK_SCALE_BUTTON(spinbutton), act->private_data->adj );
+ gtk_scale_button_set_icons( GTK_SCALE_BUTTON(spinbutton), floogles );
+#endif /* GTK_CHECK_VERSION(2,12,0) */
} else {
spinbutton = gtk_spin_button_new( act->private_data->adj, act->private_data->climbRate, act->private_data->digits );
}
g_signal_connect_swapped( G_OBJECT(spinbutton), "event", G_CALLBACK(event_cb), action );
if ( act->private_data->appearanceMode == APPEARANCE_FULL ) {
/* */
+#if GTK_CHECK_VERSION(2,12,0)
+ } else if ( act->private_data->appearanceMode == APPEARANCE_MINIMAL ) {
+ /* */
+#endif /* GTK_CHECK_VERSION(2,12,0) */
} else {
gtk_entry_set_width_chars( GTK_ENTRY(spinbutton), act->private_data->digits + 3 );
}
EgeAdjustmentAction* action = EGE_ADJUSTMENT_ACTION( data );
if ( GTK_IS_SPIN_BUTTON(widget) ) {
action->private_data->lastVal = gtk_spin_button_get_value( GTK_SPIN_BUTTON(widget) );
+#if GTK_CHECK_VERSION(2,12,0)
+ } else if ( GTK_IS_SCALE_BUTTON(widget) ) {
+ action->private_data->lastVal = gtk_scale_button_get_value( GTK_SCALE_BUTTON(widget) );
+#endif /* GTK_CHECK_VERSION(2,12,0) */
} else if (GTK_IS_RANGE(widget) ) {
action->private_data->lastVal = gtk_range_get_value( GTK_RANGE(widget) );
}
index 0d46cca359e723124e17780be61c8360f1d3b05a..6669f5825926565a30c791b636abd906deb26506 100644 (file)
--- a/src/widgets/toolbox.cpp
+++ b/src/widgets/toolbox.cpp
{ NULL, NULL, NULL, NULL, NULL, SP_VERB_INVALID, NULL, NULL }
};
+#if GTK_CHECK_VERSION(2,12,0)
+#define TOOLBAR_SLIDER_HINT "minimal"
+#else // GTK_CHECK_VERSION(2,12,0)
+#define TOOLBAR_SLIDER_HINT "full"
+#endif // GTK_CHECK_VERSION(2,12,0)
static gchar const * ui_descr =
"<ui>"
@@ -3420,7 +3425,7 @@ static void sp_pencil_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActio
NULL, NULL, 0,
sp_pencil_tb_tolerance_value_changed,
1, 2);
- ege_adjustment_action_set_appearance( eact, "full" );
+ ege_adjustment_action_set_appearance( eact, TOOLBAR_SLIDER_HINT );
gtk_action_group_add_action( mainActions, GTK_ACTION(eact) );
Inkscape::XML::Node *repr = inkscape_get_repr(INKSCAPE,
@@ -3529,7 +3534,7 @@ static void sp_tweak_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainAction
1, 100, 1.0, 0.0,
labels, values, G_N_ELEMENTS(labels),
sp_tweak_width_value_changed, 0.01, 0, 100 );
- ege_adjustment_action_set_appearance( eact, "full" );
+ ege_adjustment_action_set_appearance( eact, TOOLBAR_SLIDER_HINT );
gtk_action_group_add_action( mainActions, GTK_ACTION(eact) );
gtk_action_set_sensitive( GTK_ACTION(eact), TRUE );
}
@@ -3546,7 +3551,7 @@ static void sp_tweak_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainAction
1, 100, 1.0, 0.0,
labels, values, G_N_ELEMENTS(labels),
sp_tweak_force_value_changed, 0.01, 0, 100 );
- ege_adjustment_action_set_appearance( eact, "full" );
+ ege_adjustment_action_set_appearance( eact, TOOLBAR_SLIDER_HINT );
gtk_action_group_add_action( mainActions, GTK_ACTION(eact) );
gtk_action_set_sensitive( GTK_ACTION(eact), TRUE );
}
@@ -3936,7 +3941,7 @@ static void sp_calligraphy_toolbox_prep(SPDesktop *desktop, GtkActionGroup* main
1, 100, 1.0, 0.0,
labels, values, G_N_ELEMENTS(labels),
sp_ddc_width_value_changed, 0.01, 0, 100 );
- ege_adjustment_action_set_appearance( eact, "full" );
+ ege_adjustment_action_set_appearance( eact, TOOLBAR_SLIDER_HINT );
gtk_action_group_add_action( mainActions, GTK_ACTION(eact) );
gtk_action_set_sensitive( GTK_ACTION(eact), TRUE );
}
@@ -4021,7 +4026,7 @@ static void sp_calligraphy_toolbox_prep(SPDesktop *desktop, GtkActionGroup* main
labels, values, G_N_ELEMENTS(labels),
sp_ddc_tremor_value_changed, 0.01, 2 );
- ege_adjustment_action_set_appearance( eact, "full" );
+ ege_adjustment_action_set_appearance( eact, TOOLBAR_SLIDER_HINT );
gtk_action_group_add_action( mainActions, GTK_ACTION(eact) );
gtk_action_set_sensitive( GTK_ACTION(eact), TRUE );
}
@@ -4038,7 +4043,7 @@ static void sp_calligraphy_toolbox_prep(SPDesktop *desktop, GtkActionGroup* main
0.0, 1.0, 0.01, 0.0,
labels, values, G_N_ELEMENTS(labels),
sp_ddc_wiggle_value_changed, 0.01, 2 );
- ege_adjustment_action_set_appearance( eact, "full" );
+ ege_adjustment_action_set_appearance( eact, TOOLBAR_SLIDER_HINT );
gtk_action_group_add_action( mainActions, GTK_ACTION(eact) );
gtk_action_set_sensitive( GTK_ACTION(eact), TRUE );
}
@@ -4055,7 +4060,7 @@ static void sp_calligraphy_toolbox_prep(SPDesktop *desktop, GtkActionGroup* main
0.0, 1.0, 0.01, 0.0,
labels, values, G_N_ELEMENTS(labels),
sp_ddc_mass_value_changed, 0.01, 2 );
- ege_adjustment_action_set_appearance( eact, "full" );
+ ege_adjustment_action_set_appearance( eact, TOOLBAR_SLIDER_HINT );
gtk_action_group_add_action( mainActions, GTK_ACTION(eact) );
gtk_action_set_sensitive( GTK_ACTION(eact), TRUE );
}
@@ -4613,7 +4618,7 @@ static void sp_eraser_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActio
1, 100, 1.0, 0.0,
labels, values, G_N_ELEMENTS(labels),
sp_ddc_width_value_changed, 0.01, 0, 100 );
- ege_adjustment_action_set_appearance( eact, "full" );
+ ege_adjustment_action_set_appearance( eact, TOOLBAR_SLIDER_HINT );
gtk_action_group_add_action( mainActions, GTK_ACTION(eact) );
gtk_action_set_sensitive( GTK_ACTION(eact), TRUE );
}
@@ -6022,7 +6027,7 @@ static void sp_paintbucket_toolbox_prep(SPDesktop *desktop, GtkActionGroup* main
0, 0, 0,
paintbucket_threshold_changed, 1, 0 );
- ege_adjustment_action_set_appearance( eact, "full" );
+ ege_adjustment_action_set_appearance( eact, TOOLBAR_SLIDER_HINT );
gtk_action_group_add_action( mainActions, GTK_ACTION(eact) );
}