changeset 174:126724275319

improved drawing of image frames
author nadvornik
date Mon, 11 Feb 2008 12:51:28 +0000
parents 0472275e19f4
children 682705e0c0e0
files src/image.c src/image.h src/layout_image.c
diffstat 3 files changed, 31 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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);
--- 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);
--- 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);