[PATCH] Uncomplete icon selection with SHIFT + Cursor key



Hi!,
another keyboardability patch, please see http://bugzilla.gnome.org/show_bug.cgi?id=545493 for better description of the bug. I'm attaching the patches here also.

Greetings
Index: eel-art-extensions.c
===================================================================
--- eel-art-extensions.c	(revisión: 2139)
+++ eel-art-extensions.c	(copia de trabajo)
@@ -181,6 +181,22 @@ eel_drect_union (EelDRect *dest,
 	}
 }
 
+void
+eel_drect_superset (EelDRect *dest,
+		 const EelDRect *src1,
+		 const EelDRect *src2)
+{
+	if (eel_drect_is_empty (src1)) {
+		eel_drect_copy (dest, src2);
+	} else if (eel_drect_is_empty (src2)) {
+		eel_drect_copy (dest, src1);
+	} else {
+		dest->x0 = MAX (src1->x0, src2->x0);
+		dest->y0 = MAX (src1->y0, src2->y0);
+		dest->x1 = MAX (src1->x1, src2->x1);
+		dest->y1 = MAX (src1->y1, src2->y1);
+	}
+}
 
 /**
  * eel_irect_contains_point:
Index: eel-art-extensions.h
===================================================================
--- eel-art-extensions.h	(revisión: 2139)
+++ eel-art-extensions.h	(copia de trabajo)
@@ -101,6 +101,10 @@ void eel_drect_union (EelDRect       *de
 		      const EelDRect *src1,
 		      const EelDRect *src2);
 
+void eel_drect_superset (EelDRect    *dest,
+		      const EelDRect *src1,
+		      const EelDRect *src2);
+
 
 /* EelDimensions functions. */
 gboolean      eel_dimensions_are_empty        (EelDimensions dimensions);
Index: libnautilus-private/nautilus-icon-container.c
===================================================================
--- libnautilus-private/nautilus-icon-container.c	(revisión: 14418)
+++ libnautilus-private/nautilus-icon-container.c	(copia de trabajo)
@@ -3070,10 +3070,14 @@ closest_in_90_degrees (NautilusIconConta
 
 static EelDRect 
 get_rubberband (NautilusIcon *icon1,
-		NautilusIcon *icon2)
+		NautilusIcon *icon2,
+		NautilusIcon *icon3)
 {
 	EelDRect rect1;
 	EelDRect rect2;
+	EelDRect rect3;
+	EelDRect union1_2;
+	EelDRect union1_3;
 	EelDRect ret;
 
 	eel_canvas_item_get_bounds (EEL_CANVAS_ITEM (icon1->item),
@@ -3082,8 +3086,13 @@ get_rubberband (NautilusIcon *icon1,
 	eel_canvas_item_get_bounds (EEL_CANVAS_ITEM (icon2->item),
 				    &rect2.x0, &rect2.y0, 
 				    &rect2.x1, &rect2.y1);
-
-	eel_drect_union (&ret, &rect1, &rect2);
+	eel_canvas_item_get_bounds (EEL_CANVAS_ITEM (icon3->item),
+				    &rect3.x0, &rect3.y0, 
+				    &rect3.x1, &rect3.y1);
+
+	eel_drect_union (&union1_2, &rect1, &rect2);
+	eel_drect_union (&union1_3, &rect1, &rect3);
+	eel_drect_superset (&ret, &union1_2, &union1_3);
 
 	return ret;
 }
@@ -3116,7 +3125,7 @@ keyboard_move_to (NautilusIconContainer 
 
 		if (icon && container->details->keyboard_rubberband_start) {
 			rect = get_rubberband (container->details->keyboard_rubberband_start,
-					       icon);
+					       icon, from);
 			rubberband_select (container, NULL, &rect);
 		}
 	} else {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]