[maemo-commits] [maemo-commits] r12210 - in projects/haf/trunk/sapwood: . demos demos/images src

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Fri Jun 8 16:50:25 EEST 2007
Author: tko
Date: 2007-06-08 16:50:20 +0300 (Fri, 08 Jun 2007)
New Revision: 12210

Modified:
   projects/haf/trunk/sapwood/ChangeLog
   projects/haf/trunk/sapwood/README
   projects/haf/trunk/sapwood/demos/images/treeview-active-alone.png
   projects/haf/trunk/sapwood/demos/images/treeview-active-left.png
   projects/haf/trunk/sapwood/demos/images/treeview-active-middle.png
   projects/haf/trunk/sapwood/demos/images/treeview-active-right.png
   projects/haf/trunk/sapwood/demos/images/treeview-active.png
   projects/haf/trunk/sapwood/demos/images/treeview-passive.png
   projects/haf/trunk/sapwood/demos/treeview.gtkrc
   projects/haf/trunk/sapwood/src/sapwood-draw.c
Log:
Improve handling cursor separately from selection.

	* src/sapwood-draw.c (maybe_check_cursor_position): Remove special
	active focus handling, only update 'shadow' for passive focus. Improves
	handling cursor separately from selection.

	* README
	* demos/treeview.gtkrc
	* demos/images/treeview-*: Updated


Modified: projects/haf/trunk/sapwood/ChangeLog
===================================================================
--- projects/haf/trunk/sapwood/ChangeLog	2007-06-08 13:05:49 UTC (rev 12209)
+++ projects/haf/trunk/sapwood/ChangeLog	2007-06-08 13:50:20 UTC (rev 12210)
@@ -1,3 +1,13 @@
+2007-06-08  Tommi Komulainen  <tommi.komulainen at nokia.com>
+
+	* src/sapwood-draw.c (maybe_check_cursor_position): Remove special
+	active focus handling, only update 'shadow' for passive focus. Improves
+	handling cursor separately from selection.
+
+	* README
+	* demos/treeview.gtkrc
+	* demos/images/treeview-*: Updated
+	
 2007-05-31  Xan Lopez  <xan.lopez at nokia.com>
 
 	* src/sapwood-draw.c (check_child_position, check_buttonbox_child_position):

Modified: projects/haf/trunk/sapwood/README
===================================================================
--- projects/haf/trunk/sapwood/README	2007-06-08 13:05:49 UTC (rev 12209)
+++ projects/haf/trunk/sapwood/README	2007-06-08 13:50:20 UTC (rev 12210)
@@ -449,10 +449,10 @@
 
 GtkTreeView
 -----------
-Focus row background:
+Cursor row background, passive focus:
   function = FLAT_BOX
-  state    = ACTIVE
-  shadow   = NONE for active, OUT for passive focus
+  state    = SELECTED / NORMAL
+  shadow   = OUT
 
 See demos/treeview.gtkrc
 

Modified: projects/haf/trunk/sapwood/demos/images/treeview-active-alone.png
===================================================================
--- projects/haf/trunk/sapwood/demos/images/treeview-active-alone.png	2007-06-08 13:05:49 UTC (rev 12209)
+++ projects/haf/trunk/sapwood/demos/images/treeview-active-alone.png	2007-06-08 13:50:20 UTC (rev 12210)
@@ -1,3 +1,4 @@
 ‰PNG
 
-   
IHDR         
±²   	pHYs     šœ   tIME×%,Ôod   tEXtComment Created with GIMPW   &IDAT×eб
 0ƒ ÿÿì޲t2˜Pt²w ?—U<DéKÓ    IEND®B`‚
\ No newline at end of file
+   
IHDR         o&å   bKGD ÿ ÿ ÿ ½§“   	pHYs     šœ   tIME×.#Ti•È   tEXtComment Created with GIMPW   .IDAT×mÌ1  Ã@›ÿÿÙU™²œ¬X Tp Ê0íj©…
+Ÿ>˜ ðˆY¢é    IEND®B`‚
\ No newline at end of file

Modified: projects/haf/trunk/sapwood/demos/images/treeview-active-left.png
===================================================================
--- projects/haf/trunk/sapwood/demos/images/treeview-active-left.png	2007-06-08 13:05:49 UTC (rev 12209)
+++ projects/haf/trunk/sapwood/demos/images/treeview-active-left.png	2007-06-08 13:50:20 UTC (rev 12210)
@@ -1,3 +1,3 @@
 ‰PNG
 
-   
IHDR         Áõ   	pHYs     šœ   tIME×!OÕny   tEXtComment Created with GIMPW   !IDAT×Uȱ
 0À0ÓÿS'+QUpÄß{ÃoóÌG4    IEND®B`‚
\ No newline at end of file
+   
IHDR         €qV¢   bKGD ÿ ÿ ÿ ½§“   	pHYs     šœ   tIME×-9‚&?q   tEXtComment Created with GIMPW   "IDAT×M‹±	  ƒÌÿGÛ¡²©`T 䥩:¨@ö90ÿï–±V>    IEND®B`‚
\ No newline at end of file

Modified: projects/haf/trunk/sapwood/demos/images/treeview-active-middle.png
===================================================================
--- projects/haf/trunk/sapwood/demos/images/treeview-active-middle.png	2007-06-08 13:05:49 UTC (rev 12209)
+++ projects/haf/trunk/sapwood/demos/images/treeview-active-middle.png	2007-06-08 13:50:20 UTC (rev 12210)
@@ -1,3 +1,3 @@
 ‰PNG
 
-   
IHDR         RÝe‚   	pHYs     šœ   tIME×_   tEXtComment Created with GIMPW   IDAT×c```øÏôŸþ  EXoþ    IEND®B`‚
\ No newline at end of file
+   
IHDR         RÝe‚   bKGD ÿ ÿ ÿ ½§“   	pHYs     šœ   tIME×-',Š   tEXtComment Created with GIMPW   IDAT×Á   €ÿO(5"ìüߨÆä    IEND®B`‚
\ No newline at end of file

Modified: projects/haf/trunk/sapwood/demos/images/treeview-active-right.png
===================================================================
--- projects/haf/trunk/sapwood/demos/images/treeview-active-right.png	2007-06-08 13:05:49 UTC (rev 12209)
+++ projects/haf/trunk/sapwood/demos/images/treeview-active-right.png	2007-06-08 13:50:20 UTC (rev 12210)
@@ -1,3 +1,3 @@
 ‰PNG
 
-   
IHDR         €qV¢   	pHYs     šœ   tIME×+¯ ‡g   tEXtComment Created with GIMPW   %IDAT×5˱   „°¼ûgE†*pÂ6°†óQý¾ç¸f
ÿ@!xd    IEND®B`‚
\ No newline at end of file
+   
IHDR         €qV¢   bKGD ÿ ÿ ÿ ½§“   	pHYs     šœ   tIME×-	¤ÿÝ   tEXtComment Created with GIMPW   $IDAT×U‹±	  ƒÌÿGÛ!Ú% ’€*À®jaÅ+¹Ÿïíz™åÅ    IEND®B`‚
\ No newline at end of file

Modified: projects/haf/trunk/sapwood/demos/images/treeview-active.png
===================================================================
--- projects/haf/trunk/sapwood/demos/images/treeview-active.png	2007-06-08 13:05:49 UTC (rev 12209)
+++ projects/haf/trunk/sapwood/demos/images/treeview-active.png	2007-06-08 13:50:20 UTC (rev 12210)
@@ -1,3 +1,4 @@
 ‰PNG
 
-   
IHDR         wSÞ   	pHYs     šœ   tIME×3!|f{—   tEXtComment Created with GIMPW   IDAT×cøÏÀ   ݍ°    IEND®B`‚
\ No newline at end of file
+   
IHDR         V(µ¿   bKGD ÿ ÿ ÿ ½§“   	pHYs     šœ   tIME×ÿàÀÝ   tEXtComment Created with GIMPW    IDAT×cd`øÿŸ
+˜Λ˜220000"Ë  sA:°V×    IEND®B`‚
\ No newline at end of file

Modified: projects/haf/trunk/sapwood/demos/images/treeview-passive.png
===================================================================
--- projects/haf/trunk/sapwood/demos/images/treeview-passive.png	2007-06-08 13:05:49 UTC (rev 12209)
+++ projects/haf/trunk/sapwood/demos/images/treeview-passive.png	2007-06-08 13:50:20 UTC (rev 12210)
@@ -1,3 +1,4 @@
 ‰PNG
 
-   
IHDR         wSÞ   	pHYs     šœ   tIME×vDG   tEXtComment Created with GIMPW   IDAT×c8ob 
8¶³KÂ    IEND®B`‚
\ No newline at end of file
+   
IHDR         V(µ¿   bKGD ÿ ÿ ÿ ½§“   	pHYs     šœ   tIME×˜J!   tEXtComment Created with GIMPW    IDAT×c<obòŸ
+˜ôObd````D– Šœ5ƒ+¾H    IEND®B`‚
\ No newline at end of file

Modified: projects/haf/trunk/sapwood/demos/treeview.gtkrc
===================================================================
--- projects/haf/trunk/sapwood/demos/treeview.gtkrc	2007-06-08 13:05:49 UTC (rev 12209)
+++ projects/haf/trunk/sapwood/demos/treeview.gtkrc	2007-06-08 13:50:20 UTC (rev 12210)
@@ -2,29 +2,40 @@
 pixmap_path "images"
 style "treeview" {
   engine "sapwood" {
+    image { # passive focus for selection 
+      function = FLAT_BOX
+      state    = SELECTED
+      shadow   = OUT
+
+      file     = "treeview-selected.png"
+
+      overlay_file     = "treeview-passive.png"
+      overlay_border   = { 1, 1, 1, 1 }
+    }
     image { # selection
       function = FLAT_BOX
       state    = SELECTED
       file     = "treeview-selected.png"
     }
-    image { # passive focus
+
+    image { # normal row passive focus
       function = FLAT_BOX
-      state    = ACTIVE
       shadow   = OUT
-      file     = "treeview-passive.png"
+
+      file     = "treeview-normal.png"
+
+      overlay_file     = "treeview-passive.png"
+      overlay_border   = { 1, 1, 1, 1 }
     }
-    image { # active focus
-      function = FLAT_BOX
-      state    = ACTIVE
-      file     = "treeview-active.png"
-    }
     image { # normal row background (fallback)
       function = FLAT_BOX
       file     = "treeview-normal.png"
     }
 
-    image { # disable the default focus rectangle
+    image { # active focus
       function = FOCUS
+      file     = "treeview-active.png"
+      border   = { 1, 1, 1, 1 }
     }
   }
 }
@@ -56,11 +67,21 @@
     #}
 
     # selection #######################################################
-    image {
+    image { # passive focus for selection 
       function = FLAT_BOX
       state    = SELECTED
+      shadow   = OUT
+
       file     = "treeview-selected.png"
+
+      overlay_file     = "treeview-passive.png"
+      overlay_border   = { 1, 1, 1, 1 }
     }
+    image { # selection
+      function = FLAT_BOX
+      state    = SELECTED
+      file     = "treeview-selected.png"
+    }
     # passive focus ###################################################
     image {
       function = FLAT_BOX
@@ -68,47 +89,45 @@
       shadow   = OUT
       file     = "treeview-passive.png"
     }
+    # normal row background (fallback) ################################
+    image { # normal row passive focus
+      function = FLAT_BOX
+      shadow   = OUT
+
+      file     = "treeview-normal.png"
+
+      overlay_file     = "treeview-passive.png"
+      overlay_border   = { 1, 1, 1, 1 }
+    }
+
     # active ##########################################################
     image {
-      function = FLAT_BOX
-      state    = ACTIVE
+      function = FOCUS
       detail   = "*_start"
 
       file     = "treeview-active-left.png"
       border   = { 2, 0, 2, 2 }
     }
     image {
-      function = FLAT_BOX
-      state    = ACTIVE
+      function = FOCUS
       detail   = "*_middle"
 
       file     = "treeview-active-middle.png"
       border   = { 0, 0, 1, 1 }
     }
     image {
-      function = FLAT_BOX
-      state    = ACTIVE
+      function = FOCUS
       detail   = "*_end"
 
       file     = "treeview-active-right.png"
       border   = { 0, 2, 2, 2 }
     }
     image {
-      function = FLAT_BOX
-      state    = ACTIVE
+      function = FOCUS
 
       file     = "treeview-active-alone.png"
       border   = { 2, 2, 2, 2 }
     }
-    # normal row background (fallback) ################################
-    image {
-      function = FLAT_BOX
-      file     = "treeview-normal.png"
-    }
-
-    image { # disable the default focus rectangle
-      function = FOCUS
-    }
   }
 }
 

Modified: projects/haf/trunk/sapwood/src/sapwood-draw.c
===================================================================
--- projects/haf/trunk/sapwood/src/sapwood-draw.c	2007-06-08 13:05:49 UTC (rev 12209)
+++ projects/haf/trunk/sapwood/src/sapwood-draw.c	2007-06-08 13:50:20 UTC (rev 12210)
@@ -852,22 +852,22 @@
   if (!gdk_rectangle_intersect (&paint_rect, &cursor_rect, &paint_rect))
     return;
 
-  /* We're painting the cursor row background, so distinguish between active
-   * and passive focus. Knowing that GTK_STATE_ACTIVE and GTK_SHADOW_NONE are
-   * never used in treeview, it should be (more or less) safe to (ab)use them
-   * for active/passive focus.
+  /* We're painting the cursor row background, so distinguish between focused
+   * and non-focused treeview so that we can paint the passive focus ring when
+   * non-focused. (gtk_paint_focus is used to paint the focus ring when focused.)
+   * Knowing that treeview always uses GTK_SHADOW_NONE, it should be (more or
+   * less) safe to (ab)use it for passive focus.
    *
-   * Active focus:
+   * Passive focus:
    *   function = FLAT_BOX
-   *   state    = ACTIVE
-   *   shadow   = NONE
+   *   state    = SELECTED / NORMAL
+   *   shadow   = OUT
    *
-   * Passive focus:
+   * Selection / normal row:
    *   function = FLAT_BOX
-   *   state    = ACTIVE
-   *   shadow   = OUT
+   *   state    = SELECTED / NORMAL
+   *   shadow   = NONE
    */
-  match_data->state = GTK_STATE_ACTIVE;
   if (!GTK_WIDGET_HAS_FOCUS (treeview))
     match_data->shadow = GTK_SHADOW_OUT;
 }


More information about the maemo-commits mailing list