Commit be3aefbe authored by Pierre Wieser's avatar Pierre Wieser

Fix bad reinitialization of the icon item

parent 49399bc4
2010-08-02 Pierre Wieser <pwieser@trychlos.org>
* src/nact/nact-gtk-utils.c (nact_gtk_utils_get_pixbuf):
* src/nact/nact-iaction-tab.c (on_icon_changed):
Fix bad reinitialization of the icon item.
* doc/nact/C/figures/nact-basenames-tab.png:
* doc/nact/C/figures/nact-capabilities-tab.png:
* doc/nact/C/figures/nact-command-tab.png:
......
......@@ -493,5 +493,3 @@ Parameter Description
instead of terminating the edition and letting the old value
- 2010-06-20: TODO: is_candidate_for_show_in: get current environment
- 2010-08-02: icon is not reset when last action is removed
......@@ -148,7 +148,7 @@ nact_gtk_utils_get_pixbuf( const gchar *name, GtkWidget *widget, gint size )
/**
* nact_utils_render:
* @name: the name of the file or an icon.
* @name: the name of the file or an icon, or %NULL.
* widget: the widget on which the image should be rendered.
* size: the desired size.
*
......@@ -159,7 +159,11 @@ nact_gtk_utils_render( const gchar *name, GtkImage *widget, gint size )
{
GdkPixbuf* pixbuf;
pixbuf = nact_gtk_utils_get_pixbuf( name, GTK_WIDGET( widget ), size );
if( name ){
pixbuf = nact_gtk_utils_get_pixbuf( name, GTK_WIDGET( widget ), size );
} else {
pixbuf = gdk_pixbuf_new_from_file_at_size( PKGDATADIR "/transparent.png", size, size, NULL );
}
if( pixbuf ){
gtk_image_set_from_pixbuf( widget, pixbuf );
......
......@@ -898,10 +898,13 @@ on_icon_changed( GtkEntry *icon_entry, NactIActionTab *instance )
icon_name = gtk_entry_get_text( icon_entry );
na_object_set_icon( item, icon_name );
g_signal_emit_by_name( G_OBJECT( instance ), TAB_UPDATABLE_SIGNAL_ITEM_UPDATED, item, TRUE );
image = GTK_IMAGE( base_window_get_widget( BASE_WINDOW( instance ), "ActionIconImage" ));
nact_gtk_utils_render( icon_name, image, GTK_ICON_SIZE_MENU );
}
/* icon_name may be null if there is no current item
* in such a case, we blank the image
*/
image = GTK_IMAGE( base_window_get_widget( BASE_WINDOW( instance ), "ActionIconImage" ));
nact_gtk_utils_render( icon_name, image, GTK_ICON_SIZE_MENU );
}
static gint
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment