diff options
| author | bulia byak <buliabyak@gmail.com> | 2007-08-18 18:53:41 +0000 |
|---|---|---|
| committer | buliabyak <buliabyak@users.sourceforge.net> | 2007-08-18 18:53:41 +0000 |
| commit | 8f361a6ab367d487c8a0c9c1520ed78347ffada3 (patch) | |
| tree | 88a0f3e409b8f7e5a7d815891633c85e04fd4c23 /src | |
| parent | Improved handling bounding boxes and rotated/skewed coordinates in filters (diff) | |
| download | inkscape-8f361a6ab367d487c8a0c9c1520ed78347ffada3.tar.gz inkscape-8f361a6ab367d487c8a0c9c1520ed78347ffada3.zip | |
if there's no icon, create a toggle button with text label
(bzr r3506)
Diffstat (limited to 'src')
| -rw-r--r-- | src/ink-action.cpp | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/src/ink-action.cpp b/src/ink-action.cpp index 138adafd1..f1dcaf04b 100644 --- a/src/ink-action.cpp +++ b/src/ink-action.cpp @@ -426,26 +426,27 @@ static GtkWidget* ink_toggle_action_create_menu_item( GtkAction* action ) static GtkWidget* ink_toggle_action_create_tool_item( GtkAction* action ) { - InkToggleAction* act = INK_TOGGLE_ACTION( action ); - GtkWidget* item = gInkToggleActionParentClass->parent_class.create_tool_item(action); + InkToggleAction* act = INK_TOGGLE_ACTION( action ); + GtkWidget* item = gInkToggleActionParentClass->parent_class.create_tool_item(action); + if ( GTK_IS_TOOL_BUTTON(item) ) { + GtkToolButton* button = GTK_TOOL_BUTTON(item); if ( act->private_data->iconId ) { - if ( GTK_IS_TOOL_BUTTON(item) ) { - GtkToolButton* button = GTK_TOOL_BUTTON(item); - - GtkWidget* child = sp_icon_new( act->private_data->iconSize, act->private_data->iconId ); - gtk_tool_button_set_icon_widget( button, child ); - } else { - // For now trigger a warning but don't do anything else - GtkToolButton* button = GTK_TOOL_BUTTON(item); - (void)button; - } - } - - // TODO investigate if needed - gtk_widget_show_all( item ); - - return item; + GtkWidget* child = sp_icon_new( act->private_data->iconSize, act->private_data->iconId ); + gtk_tool_button_set_icon_widget( button, child ); + } else { + gchar *label; + g_object_get (G_OBJECT(action), "label", &label, NULL); + gtk_tool_button_set_label( button, label ); + } + } else { + // For now trigger a warning but don't do anything else + GtkToolButton* button = GTK_TOOL_BUTTON(item); + (void)button; + } + gtk_widget_show_all( item ); + + return item; } |
