[gtk+/treeview-refactor] Added special clause to GtkCellAreaBox focus navigation.



commit 26ac551b741e78500108cde318a91f61688231e0
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date:   Wed Dec 1 15:18:40 2010 +0900

    Added special clause to GtkCellAreaBox focus navigation.
    
    If the area has no activatable cells and has focus when
    focus should be cycled, immediately focus out of the area
    (because focus in that case is given to the entire area).

 gtk/gtkcellareabox.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkcellareabox.c b/gtk/gtkcellareabox.c
index 0ded281..12988e6 100644
--- a/gtk/gtkcellareabox.c
+++ b/gtk/gtkcellareabox.c
@@ -1826,6 +1826,16 @@ gtk_cell_area_box_focus (GtkCellArea      *area,
 
   focus_cell = gtk_cell_area_get_focus_cell (area);
 
+  /* Special case, when there is no activatable cell, focus
+   * is painted around the entire area... in this case we
+   * let focus leave the area directly.
+   */
+  if (focus_cell && !gtk_cell_area_is_activatable (area))
+    {
+      gtk_cell_area_set_focus_cell (area, NULL);
+      return FALSE;
+    }
+
   switch (direction)
     {
     case GTK_DIR_TAB_FORWARD:



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