changeset 78:b192a0efe080

Sun Oct 15 12:36:06 2006 John Ellis <johne@verizon.net> * pan-view.c: For now, also display the full size image under the thumbnail's information bubble. Make clicking the info box close it.
author gqview
date Sun, 15 Oct 2006 16:39:19 +0000
parents 44f2223541d1
children 528e3432e0c0
files ChangeLog src/pan-view.c
diffstat 2 files changed, 54 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Oct 15 14:49:25 2006 +0000
+++ b/ChangeLog	Sun Oct 15 16:39:19 2006 +0000
@@ -1,3 +1,8 @@
+Sun Oct 15 12:36:06 2006  John Ellis  <johne@verizon.net>
+
+	* pan-view.c: For now, also display the full size image under the
+	thumbnail's information bubble. Make clicking the info box close it.
+
 Sun Oct 15 10:45:14 2006  John Ellis  <johne@verizon.net>
 
 	* pan-view.c: Recalc the size of the layout when popping up new images
--- a/src/pan-view.c	Sun Oct 15 14:49:25 2006 +0000
+++ b/src/pan-view.c	Sun Oct 15 16:39:19 2006 +0000
@@ -288,7 +288,7 @@
 
 static GList *pan_layout_intersect(PanWindow *pw, gint x, gint y, gint width, gint height);
 
-static void pan_layout_resize(PanWindow *pw, gint border);
+static void pan_layout_resize(PanWindow *pw);
 
 static void pan_window_layout_update_idle(PanWindow *pw);
 
@@ -1077,6 +1077,13 @@
 	pi->x = x;
 	pi->y = y;
 
+	pi->color_a = 255;
+
+	pi->color2_r = 0;
+	pi->color2_g = 0;
+	pi->color2_b = 0;
+	pi->color2_a = PAN_SHADOW_ALPHA / 2;
+
 	pan_item_image_find_size(pw, pi, w, h);
 
 	pw->list = g_list_prepend(pw->list, pi);
@@ -2000,7 +2007,7 @@
 	pan_item_box_shadow(pbox, PAN_SHADOW_OFFSET * 2, PAN_SHADOW_FADE * 2);
 	pan_item_added(pw, pbox);
 
-	pan_layout_resize(pw, 100);
+	pan_layout_resize(pw);
 }
 
 static void pan_window_layout_compute_calendar(PanWindow *pw, const gchar *path, gint *width, gint *height)
@@ -2532,7 +2539,7 @@
 	return list;
 }
 
-static void pan_layout_resize(PanWindow *pw, gint border)
+static void pan_layout_resize(PanWindow *pw)
 {
 	gint width = 0;
 	gint height = 0;
@@ -2562,8 +2569,8 @@
 		if (height < pi->y + pi->height) height = pi->y + pi->height;
 		}
 
-	width += border;
-	height += border;
+	width += PAN_FOLDER_BOX_BORDER * 2;
+	height += PAN_FOLDER_BOX_BORDER * 2;
 
 	pr = PIXBUF_RENDERER(pw->imd->pr);
 	if (width < pr->window_width) width = pr->window_width;
@@ -2749,7 +2756,11 @@
 static void pan_layout_queue(PanWindow *pw, PanItem *pi)
 {
 	if (!pi || pi->queued || pi->pixbuf) return;
-	if (pw->size <= LAYOUT_SIZE_THUMB_NONE) return;
+	if (pw->size <= LAYOUT_SIZE_THUMB_NONE &&
+	    (!pi->key || strcmp(pi->key, "info") != 0) )
+		{
+		return;
+		}
 
 	pi->queued = TRUE;
 	pw->queue = g_list_prepend(pw->queue, pi);
@@ -2935,13 +2946,13 @@
 							     (double) pi->x - x,
 							     (double) pi->y - y,
 							     1.0, 1.0, GDK_INTERP_NEAREST,
-							     255);
+							     pi->color_a);
 					}
 				else
 					{
 					pixbuf_draw_rect_fill(pixbuf,
 							      rx - x, ry - y, rw, rh,
-							      PAN_SHADOW_COLOR, PAN_SHADOW_ALPHA / 2);
+							      pi->color2_r, pi->color2_g, pi->color2_b, pi->color2_a);
 					pan_layout_queue(pw, pi);
 					}
 				}
@@ -3704,6 +3715,29 @@
 
 	pan_item_box_shadow(pbox, PAN_SHADOW_OFFSET * 2, PAN_SHADOW_FADE * 2);
 	pan_item_added(pw, pbox);
+
+	if (TRUE)
+		{
+		gint iw, ih;
+		if (image_load_dimensions(pi->fd->path, &iw, &ih))
+			{
+			pbox = pan_item_new_box(pw, NULL, pbox->x, pbox->y + pbox->height + 8, 10, 10,
+						PAN_POPUP_BORDER,
+						PAN_POPUP_COLOR, PAN_POPUP_ALPHA,
+						PAN_POPUP_BORDER_COLOR, PAN_POPUP_ALPHA);
+			pan_item_set_key(pbox, "info");
+
+			p = pan_item_new_image(pw, file_data_new_simple(pi->fd->path),
+					       pbox->x + 8, pbox->y + 8, iw, ih);
+			pan_item_set_key(p, "info");
+			pan_item_size_by_item(pbox, p, 8);
+
+			pan_item_box_shadow(pbox, PAN_SHADOW_OFFSET * 2, PAN_SHADOW_FADE * 2);
+			pan_item_added(pw, pbox);
+
+			pan_layout_resize(pw);
+			}
+		}
 }
 
 
@@ -4083,6 +4117,13 @@
 		ry = (double)(pr->y_scroll + event->y - pr->y_offset) / pr->scale;
 		}
 
+	pi = pan_item_find_by_coord(pw, ITEM_BOX, rx, ry, "info");
+	if (pi && event->button == 1)
+		{
+		pan_info_update(pw, NULL);
+		return;
+		}
+
 	pi = pan_item_find_by_coord(pw, (pw->size > LAYOUT_SIZE_THUMB_LARGE) ? ITEM_IMAGE : ITEM_THUMB,
 				    rx, ry, NULL);