# HG changeset patch # User nadvornik # Date 1202734288 0 # Node ID 12672427531934fc1029cafa30ba430968f5e47a # Parent 0472275e19f4f5f75edc668d87548fc2a071fa42 improved drawing of image frames diff -r 0472275e19f4 -r 126724275319 src/image.c --- a/src/image.c Sat Jan 26 21:18:23 2008 +0000 +++ b/src/image.c Mon Feb 11 12:51:28 2008 +0000 @@ -1684,6 +1684,24 @@ } + +void image_set_selectable(ImageWindow *imd, gboolean selectable) +{ + if (imd->has_frame) + { + if (selectable) + { + gtk_frame_set_shadow_type(GTK_FRAME(imd->widget), GTK_SHADOW_NONE); + gtk_container_set_border_width (GTK_CONTAINER (imd->widget), 4); + } + else + { + gtk_frame_set_shadow_type(GTK_FRAME(imd->widget), GTK_SHADOW_NONE); + gtk_container_set_border_width (GTK_CONTAINER (imd->widget), 0); + } + } +} + /* *------------------------------------------------------------------- * prefs sync @@ -1760,8 +1778,8 @@ NULL, widget, NULL, - widget->allocation.x, widget->allocation.y, - widget->allocation.width, widget->allocation.height); + widget->allocation.x + 3, widget->allocation.y + 3, + widget->allocation.width - 6, widget->allocation.height - 6); return FALSE; @@ -1818,9 +1836,8 @@ if (imd->has_frame) { imd->widget = gtk_frame_new(NULL); - gtk_frame_set_shadow_type(GTK_FRAME(imd->widget), GTK_SHADOW_NONE); + image_set_selectable(imd, 0); gtk_container_add(GTK_CONTAINER(imd->widget), imd->pr); - gtk_container_set_border_width (GTK_CONTAINER (imd->widget), 7); gtk_widget_show(imd->pr); g_signal_connect (G_OBJECT (imd->widget), "expose_event", G_CALLBACK (selectable_frame_expose_cb), NULL); diff -r 0472275e19f4 -r 126724275319 src/image.h --- a/src/image.h Sat Jan 26 21:18:23 2008 +0000 +++ b/src/image.h Mon Feb 11 12:51:28 2008 +0000 @@ -42,6 +42,7 @@ gpointer data); void image_select(ImageWindow *imd, gboolean select); +void image_set_selectable(ImageWindow *imd, gboolean selectable); /* path, name */ const gchar *image_get_path(ImageWindow *imd); diff -r 0472275e19f4 -r 126724275319 src/layout_image.c --- a/src/layout_image.c Sat Jan 26 21:18:23 2008 +0000 +++ b/src/layout_image.c Mon Feb 11 12:51:28 2008 +0000 @@ -1706,6 +1706,7 @@ } layout_image_activate(lw, 0); + image_set_selectable(lw->split_images[0], 0); lw->split_image_widget = lw->split_images[0]->widget; @@ -1750,6 +1751,9 @@ } } + image_set_selectable(lw->split_images[0], 1); + image_set_selectable(lw->split_images[1], 1); + if (!lw->image || lw->active_split_image < 0 || lw->active_split_image > 1) { layout_image_activate(lw, 0); @@ -1817,6 +1821,11 @@ } } + image_set_selectable(lw->split_images[0], 1); + image_set_selectable(lw->split_images[1], 1); + image_set_selectable(lw->split_images[2], 1); + image_set_selectable(lw->split_images[3], 1); + if (!lw->image || lw->active_split_image < 0 || lw->active_split_image > 3) { layout_image_activate(lw, 0);