diff options
| author | Jon A. Cruz <jon@joncruz.org> | 2008-04-25 08:07:57 +0000 |
|---|---|---|
| committer | joncruz <joncruz@users.sourceforge.net> | 2008-04-25 08:07:57 +0000 |
| commit | a8bc70dad12976b156c6d6a2795c350cf0680a0e (patch) | |
| tree | ea8dbeeca3019eb8c498dd7a232f4ae83a0fa047 /src/ege-select-one-action.cpp | |
| parent | Left out a comment. sorry. (diff) | |
| download | inkscape-a8bc70dad12976b156c6d6a2795c350cf0680a0e.tar.gz inkscape-a8bc70dad12976b156c6d6a2795c350cf0680a0e.zip | |
Improved options for toolbar icon sizes, especially for Ubuntu. Fixes bug #221676.
(bzr r5514)
Diffstat (limited to 'src/ege-select-one-action.cpp')
| -rw-r--r-- | src/ege-select-one-action.cpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/ege-select-one-action.cpp b/src/ege-select-one-action.cpp index 0a1a6435d..463011990 100644 --- a/src/ege-select-one-action.cpp +++ b/src/ege-select-one-action.cpp @@ -94,6 +94,7 @@ struct _EgeSelectOneActionPrivate gint iconColumn; gint tooltipColumn; gint appearanceMode; + gint iconSize; GType radioActionType; GtkTreeModel* model; gchar* iconProperty; @@ -109,6 +110,7 @@ enum { PROP_ICON_COLUMN, PROP_TOOLTIP_COLUMN, PROP_ICON_PROP, + PROP_ICON_SIZE, PROP_APPEARANCE }; @@ -203,6 +205,14 @@ void ege_select_one_action_class_init( EgeSelectOneActionClass* klass ) (GParamFlags)(G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT) ) ); g_object_class_install_property( objClass, + PROP_ICON_SIZE, + g_param_spec_int( "icon-size", + "Icon Size", + "Target icon size", + -1, 20, -1, + (GParamFlags)(G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT) ) ); + + g_object_class_install_property( objClass, PROP_APPEARANCE, g_param_spec_string( "appearance", "Appearance hint", @@ -234,6 +244,7 @@ void ege_select_one_action_init( EgeSelectOneAction* action ) action->private_data->radioActionType = 0; action->private_data->model = 0; action->private_data->iconProperty = g_strdup("stock-id"); + action->private_data->iconSize = -1; action->private_data->appearance = 0; /* g_signal_connect( action, "notify", G_CALLBACK( fixup_labels ), NULL ); */ @@ -294,6 +305,17 @@ void ege_select_one_action_set_icon_column( EgeSelectOneAction* action, gint col g_object_set( G_OBJECT(action), "icon-column", col, NULL ); } +gint ege_select_one_action_get_icon_size( EgeSelectOneAction* action ) +{ + g_return_val_if_fail( IS_EGE_SELECT_ONE_ACTION(action), 0 ); + return action->private_data->iconSize; +} + +void ege_select_one_action_set_icon_size( EgeSelectOneAction* action, gint size ) +{ + g_object_set( G_OBJECT(action), "icon-size", size, NULL ); +} + gint ege_select_one_action_get_tooltip_column( EgeSelectOneAction* action ) { g_return_val_if_fail( IS_EGE_SELECT_ONE_ACTION(action), 0 ); @@ -338,6 +360,10 @@ void ege_select_one_action_get_property( GObject* obj, guint propId, GValue* val g_value_set_string( value, action->private_data->iconProperty ); break; + case PROP_ICON_SIZE: + g_value_set_int( value, action->private_data->iconSize ); + break; + case PROP_APPEARANCE: g_value_set_string( value, action->private_data->appearance ); break; @@ -390,6 +416,12 @@ void ege_select_one_action_set_property( GObject* obj, guint propId, const GValu } break; + case PROP_ICON_SIZE: + { + action->private_data->iconSize = g_value_get_int( value ); + } + break; + case PROP_APPEARANCE: { gchar* tmp = action->private_data->appearance; @@ -543,6 +575,11 @@ GtkWidget* create_tool_item( GtkAction* action ) g_object_set( G_OBJECT(obj), act->private_data->iconProperty, iconId, NULL ); } + if ( act->private_data->iconProperty >= 0 ) { + /* TODO get this string to be set instead of hardcoded */ + g_object_set( G_OBJECT(obj), "iconSize", act->private_data->iconSize, NULL ); + } + ract = GTK_RADIO_ACTION(obj); } else { ract = gtk_radio_action_new( "Name 1", str, tip, iconId, index ); |
