Re: [orca-list] Navigation on desktop icon view: Which is appropriate(Right arrow/Down Arrow)?



Hello all,

Thanks for feedback. This is to update you all regarding the same issue, that we have generated solution patch including both arrow(Down & Right) keys. Please checkout, apply and give feedback for "Easy Navigation on desktop Icon View Bug613111 ".

The solution patch is attached here with supporting ReadMe and Install file.

With regards
Leena Chourey <leenac cdac in>
For Accessibility Team,
C-DAC, MUMBAI

On Fri, Dec 30, 2011 at 1:13 PM, Mallory van Achterberg <stommepoes stommepoes nl> wrote:
If you had the choice to label your columns even that "wrapping"
problem would be solved.

On Fri, Dec 30, 2011 at 12:08:54AM -0700, Steve Holmes wrote:
> This sounds like the same sort of problems that often goes with the
> Microsoft Windows desktops too.  I really wish one could use a "List
> view" in both situations.  The only other thing I would think of
> would be to allow the tab key to traverse the desktop from first
> icon to the last which would usually be a top left to bottom right
> but probably go down each column vertically.
>
> What I usually do with these desktops is first, sort all icons by
> type; then when navigating, I usually start at the top left with the
> home key and then go down the first column.  When I hit bottom, I
> press home again and then move over to the right one position and
> then go down that column.  I keep doing that until I run out of
> choices.  I believe it is the right most column that will contain
> the last icons in the list.  the thing I don't like in all these
> desktops is on that last column, as you hit bottom of that often
> shorter list, the pointer will be pushed back over to the next
> column to the left and that can cause all kinds of confusion if you
> don't realize what is happening.  I think it would be better to just
> stop in its tracks and not allow any further navigation in that
> downward direction on that last column.
>
> Hope this makes sense.
_______________________________________________
orca-list mailing list
orca-list gnome org
http://mail.gnome.org/mailman/listinfo/orca-list
Visit http://live.gnome.org/Orca for more information on Orca.
The manual is at http://library.gnome.org/users/gnome-access-guide/nightly/ats-2.html
The FAQ is at http://live.gnome.org/Orca/FrequentlyAskedQuestions
Log bugs and feature requests at http://bugzilla.gnome.org
Find out how to help at http://live.gnome.org/Orca/HowCanIHelp

From 8cdb76ea08afa4d51a4ce353f3f556d03e00701b Mon Sep 17 00:00:00 2001
From: Leena Chourey <leenac cdac in>
Date: Wed, 22 Feb 2012 16:40:02 +0530
Subject: [PATCH] Completeness using Down and Right arrow key

---
 .../libnautilus-private/nautilus-icon-container.c  |  180 +++++++++++++++++---
 .../libnautilus-private/nautilus-icon-container.h  |    2 +
 2 files changed, 162 insertions(+), 20 deletions(-)

diff --git a/nautilus-2.32.2.1/libnautilus-private/nautilus-icon-container.c b/nautilus-2.32.2.1/libnautilus-private/nautilus-icon-container.c
index aa5c709..b99f444 100644
--- a/nautilus-2.32.2.1/libnautilus-private/nautilus-icon-container.c
+++ b/nautilus-2.32.2.1/libnautilus-private/nautilus-icon-container.c
@@ -243,6 +243,13 @@ static const char *nautilus_icon_container_accessible_action_descriptions[] = {
 
 G_DEFINE_TYPE (NautilusIconContainer, nautilus_icon_container, EEL_TYPE_CANVAS);
 
+/* Function to find next row leftmost*/
+static NautilusIcon *find_nextrow_leftmost (NautilusIconContainer *container, NautilusIcon *from);
+/* Function to search leftmost in a row */
+static NautilusIcon *search_leftmost(NautilusIconContainer *container, NautilusIcon *to);
+/* To define the simple dialog box for confirmation at last icon on desktop*/
+static gboolean simple_dialog();
+
 /* The NautilusIconContainer signals.  */
 enum {
 	ACTIVATE,
@@ -3484,15 +3491,32 @@ closest_in_90_degrees (NautilusIconContainer *container,
 	best_dist = data;
 	
 	if (best_so_far == NULL) {
-		*best_dist = dist;
-		return TRUE;
+		if (container->details->arrow_key_direction == GTK_DIR_DOWN) {
+			if (dx == 0 || ((-48) < dx && dx < 0) || (0 < dx && dx < 48)) {
+			/*Icon in the down direction  but not in the same column */
+				*best_dist = dist;
+				return TRUE;
+			}
+		}
+		else {
+			*best_dist = dist;
+			return TRUE;
+		}
 	}
 
 	if (dist < *best_dist) {
-		*best_dist = dist;
-		return TRUE;
+		if (container->details->arrow_key_direction == GTK_DIR_DOWN) {
+			if (dx == 0 || ((-48) < dx && dx < 0) || (0 < dx && dx < 48)) {
+			/*Icon in the down direction  but not in the same column*/
+				*best_dist = dist;
+				return TRUE;
+			}
+		}
+		else {
+			*best_dist = dist;
+			return TRUE;
+		}
 	}
-
 	return FALSE;
 }
 
@@ -3690,12 +3714,17 @@ keyboard_arrow_key (NautilusIconContainer *container,
 			 empty_start, NULL);
 	} else {
 		record_arrow_key_start (container, from, direction);
-		
-		to = find_best_icon
-			(container, from,
-			 container->details->auto_layout ? better_destination : better_destination_manual,
-			 &data);
 
+		if (direction == GTK_DIR_RIGHT) {
+                        to = find_nextrow_leftmost(container, from);
+                        printf (nautilus_icon_canvas_item_get_editable_text (to->item));
+                }
+		else {
+			to = find_best_icon
+				(container, from,
+				 container->details->auto_layout ? better_destination : better_destination_manual,
+				 &data);
+		}
 		/* only wrap around to next/previous row/column if no a11y is used.
 		 * Visually impaired people may be easily confused by this.
 		 */
@@ -3725,17 +3754,23 @@ keyboard_arrow_key (NautilusIconContainer *container,
 		 *
 		 * Should select 4.
 		 */
-		if (to == NULL &&
-		    container->details->auto_layout &&
-		    better_destination_fallback_fallback != NULL) {
-			to = find_best_icon
-				(container, from,
-				 better_destination_fallback_fallback,
-				 &data);
-		}
-
 		if (to == NULL) { 
-			to = from;
+			if (direction == GTK_DIR_DOWN) {
+				/*on last item of one col control will shift to first item of next col (if any) with down arrow*/
+				int x = 0;
+				to = find_best_icon(container, from, next_column_highest, &data);
+				if (to == NULL) {
+					x = simple_dialog();
+					if (x == 1)
+						to = find_best_icon (container, NULL, leftmost_in_top_row, NULL);
+					else
+						to = from;
+		               }
+			}
+			else if (direction == GTK_DIR_RIGHT)
+				to = find_nextrow_leftmost(container, from);
+			else
+				to = from;
 		}
 
 	}
@@ -9743,3 +9778,108 @@ nautilus_icon_container_set_store_layout_timestamps (NautilusIconContainer *cont
 
 
 #endif /* ! NAUTILUS_OMIT_SELF_CHECK */
+/* Function to find next row leftmost*/
+static NautilusIcon *find_nextrow_leftmost(NautilusIconContainer *container, NautilusIcon *from) {
+	NautilusIcon *to;
+	to = search_leftmost(container, from);
+	if (to != NULL)
+		return to;
+	return NULL;
+}
+
+/* Function to search leftmost in a row */
+static NautilusIcon *search_leftmost(NautilusIconContainer *container, NautilusIcon *from) {
+    NautilusIcon *candidate, *to, *temp;
+    GList *sort_list, *p, *q;
+    static gboolean x = 0;
+    q = container->details->icons;
+    sort_icons_yx(container);
+    for (p = container->details->icons; p != NULL; p = p->next) {
+        candidate = p->data;
+        if (candidate->item == from->item) {
+            if (p->next == NULL) {
+                x = simple_dialog();
+                if (x == 1)
+                   to = q->data;
+                else
+                   return candidate;
+            }
+            else
+                to = p->next->data;
+            return to;
+        }
+    }
+    return NULL;
+}
+
+static GList *sort_icons_yx(NautilusIconContainer *container) {
+    NautilusIcon *candidate, *temp, *next ;
+    int count = 0, j = 0, i = 0;
+    GList *p, *q;
+    p = container->details->icons;
+    q = p;
+    gint len= g_list_length(p);
+    for(i = 0; i < len ; i++) {
+        p = q;
+        for(j = 0; j < len-1;j++) {
+           candidate = p->data;
+           next = p->next->data;
+           if (candidate->y  > next->y) {
+               temp = p->next->data;
+               p->next->data = p->data;
+               p->data = temp;
+	   }
+           else if (candidate->y  == next->y) {
+              if (candidate->x > next->x) {
+                  temp = p->next->data;
+                  p->next->data = p->data;
+                  p->data = temp;
+              }
+          }
+           p = p->next;
+	}
+    }
+  return p;
+}
+static gboolean simple_dialog() {
+    static GtkWidget *dialog = NULL;
+    gint   response;
+    if (! dialog) {
+        GtkWidget *label, *window;
+        GtkWidget *box;
+	#if 1
+        /* Create dialog */
+        dialog = gtk_dialog_new();
+        window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+        /* Set it modal and transient for main window. */
+        gtk_window_set_modal(GTK_WINDOW(dialog ), TRUE);
+        gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(window));
+        /* Set title */
+        gtk_window_set_title(GTK_WINDOW(dialog), "Conformation");
+
+        /* Add buttons. */
+        gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_YES, 1);
+        gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_NO,  2);
+
+	#endif
+
+        /* Create label */
+        label = gtk_label_new("This is the last icon on Desktop, Do you want to continue visiting from first icon?");
+
+        /* Pack label, taking API change in account. */
+	#if GTK_MINOR_VERSION < 14
+		box = GTK_DIALOG(dialog)->vbox;
+	#else
+		box = gtk_dialog_get_content_area(GTK_DIALOG(dialog));
+	#endif
+		gtk_box_pack_start(GTK_BOX(box), label, TRUE, TRUE, 0);
+
+        /* Show dialog */
+		gtk_widget_show_all(dialog);
+    }
+
+/* Run dialog */
+    response = gtk_dialog_run(GTK_DIALOG(dialog));
+    gtk_widget_hide(dialog);
+    return(response);
+}
diff --git a/nautilus-2.32.2.1/libnautilus-private/nautilus-icon-container.h b/nautilus-2.32.2.1/libnautilus-private/nautilus-icon-container.h
index 7d2774e..63a3a2b 100644
--- a/nautilus-2.32.2.1/libnautilus-private/nautilus-icon-container.h
+++ b/nautilus-2.32.2.1/libnautilus-private/nautilus-icon-container.h
@@ -351,6 +351,8 @@ void              nautilus_icon_container_set_store_layout_timestamps   (Nautilu
 
 void              nautilus_icon_container_widget_to_file_operation_position (NautilusIconContainer *container,
 									     GdkPoint              *position);
+/*Function declaration for sort_icons_yx */
+static GList *sort_icons_yx(NautilusIconContainer *container);
 #define CANVAS_WIDTH(container,allocation) ((allocation.width	  \
 				- container->details->left_margin \
 				- container->details->right_margin) \
-- 
1.7.4.1

Attachment: Install.odt
Description: application/vnd.oasis.opendocument.text

Attachment: ReadMe(20feb).odt
Description: application/vnd.oasis.opendocument.text



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