From 3b3252c0e33238cc1e764c86689fd24407a56df4 Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Tue, 23 Jan 2007 08:18:13 +0000 Subject: [PATCH] code cleanup. 2007-01-23 Sven Neumann * plug-ins/common/compose.c (type_combo_callback): code cleanup. svn path=/trunk/; revision=21764 --- ChangeLog | 4 ++++ plug-ins/common/compose.c | 35 ++++++++++++++++++++--------------- 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8e0134a9ec..2c24794bfd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2007-01-23 Sven Neumann + + * plug-ins/common/compose.c (type_combo_callback): code cleanup. + 2007-01-23 Sven Neumann * app/main.c: improved output. diff --git a/plug-ins/common/compose.c b/plug-ins/common/compose.c index d02e100e30..c4d6e4da9e 100644 --- a/plug-ins/common/compose.c +++ b/plug-ins/common/compose.c @@ -1776,29 +1776,34 @@ type_combo_callback (GimpIntComboBox *combo, { if (gimp_int_combo_box_get_active (combo, &composeint.compose_idx)) { - const gchar *text; - gboolean combo4; - gboolean scale4; - gint compose_idx, j; + gboolean combo4; + gboolean scale4; + gint compose_idx; + gint j; compose_idx = composeint.compose_idx; for (j = 0; j < MAX_COMPOSE_IMAGES; j++) { - text = (compose_dsc[compose_idx].channel_name[j] ? - gettext (compose_dsc[compose_idx].channel_name[j]) : ""); + GtkWidget *label = composeint.channel_label[j]; + GtkWidget *image = composeint.channel_icon[j]; + const gchar *text = compose_dsc[compose_idx].channel_name[j]; + const gchar *icon = compose_dsc[compose_idx].channel_icon[j]; - gtk_label_set_text_with_mnemonic - (GTK_LABEL (composeint.channel_label[j]), text); + gtk_label_set_text_with_mnemonic (GTK_LABEL (label), + text ? gettext (text) : ""); - gtk_image_set_from_stock (GTK_IMAGE (composeint.channel_icon[j]), - compose_dsc[compose_idx].channel_icon[j], - GTK_ICON_SIZE_BUTTON); - - if (compose_dsc[compose_idx].channel_icon[j]) - gtk_widget_show (composeint.channel_icon[j]); + if (icon) + { + gtk_image_set_from_stock (GTK_IMAGE (image), + icon, GTK_ICON_SIZE_BUTTON); + gtk_widget_show (image); + } else - gtk_widget_hide (composeint.channel_icon[j]); + { + gtk_image_clear (GTK_IMAGE (image)); + gtk_widget_hide (image); + } } /* Set sensitivity of last menu */