Mercurial > geeqie
changeset 1359:8f3d44564146
image_select(), image_set_selectable(): tidy up.
author | zas_ |
---|---|
date | Sun, 01 Mar 2009 16:46:40 +0000 |
parents | db324ac52bcc |
children | 721ffb823d6e |
files | src/image.c |
diffstat | 1 files changed, 11 insertions(+), 23 deletions(-) [+] |
line wrap: on
line diff
--- a/src/image.c Sun Mar 01 16:43:48 2009 +0000 +++ b/src/image.c Sun Mar 01 16:46:40 2009 +0000 @@ -1501,35 +1501,23 @@ void image_select(ImageWindow *imd, gboolean select) { - if (imd->has_frame) + if (!imd->has_frame) return; + + if (select) { - if (select) - { - gtk_widget_set_state(imd->widget, GTK_STATE_SELECTED); - gtk_widget_set_state(imd->pr, GTK_STATE_NORMAL); /* do not propagate */ - } - else - gtk_widget_set_state(imd->widget, GTK_STATE_NORMAL); + gtk_widget_set_state(imd->widget, GTK_STATE_SELECTED); + gtk_widget_set_state(imd->pr, GTK_STATE_NORMAL); /* do not propagate */ } + else + gtk_widget_set_state(imd->widget, GTK_STATE_NORMAL); } - - void image_set_selectable(ImageWindow *imd, gboolean selectable) { - if (imd->has_frame) - { - if (selectable) - { - gtk_frame_set_shadow_type(GTK_FRAME(imd->frame), GTK_SHADOW_NONE); - gtk_container_set_border_width(GTK_CONTAINER(imd->frame), 4); - } - else - { - gtk_frame_set_shadow_type(GTK_FRAME(imd->frame), GTK_SHADOW_NONE); - gtk_container_set_border_width(GTK_CONTAINER(imd->frame), 0); - } - } + if (!imd->has_frame) return; + + gtk_frame_set_shadow_type(GTK_FRAME(imd->frame), GTK_SHADOW_NONE); + gtk_container_set_border_width(GTK_CONTAINER(imd->frame), selectable ? 4 : 0); } /*