[hyena] Mostly done with new unknown artwork rendering



commit df202f340753ec4de4100840ca19e99e0abb1e19
Author: Aaron Bockover <abockover novell com>
Date:   Tue Dec 15 19:27:42 2009 -0500

    Mostly done with new unknown artwork rendering
    
    - Added 90 as a valid artwork cache size
    - Tweaked look and feel of the unknown artwork
    - Added 3 new properties to CellContext: ViewRowIndex,
      ViewColumnIndex, and ModelRowIndex; also made all the
      properties in CellContext use automatic getter/setters
    - Set the three new CellContext properties when doing
      rendering
    - Set the global GTK theme radius to 0, just seeing if
      I like this; getting tired of rounded

 src/Hyena.Gui/Hyena.Data.Gui/CellContext.cs        |   71 +++++---------------
 .../Hyena.Data.Gui/ListView/ListView_Rendering.cs  |    8 ++
 src/Hyena.Gui/Hyena.Gui.Theming/ThemeContext.cs    |    2 +-
 3 files changed, 26 insertions(+), 55 deletions(-)
---
diff --git a/src/Hyena.Gui/Hyena.Data.Gui/CellContext.cs b/src/Hyena.Gui/Hyena.Data.Gui/CellContext.cs
index f25ec0d..253d5b2 100644
--- a/src/Hyena.Gui/Hyena.Data.Gui/CellContext.cs
+++ b/src/Hyena.Gui/Hyena.Data.Gui/CellContext.cs
@@ -34,59 +34,22 @@ namespace Hyena.Data.Gui
 {
     public class CellContext
     {
-        private Cairo.Context context;
-        private Pango.Layout layout;
-        private Gtk.Widget widget;
-        private Gdk.Drawable drawable;
-        private Theme theme;
-        private Gdk.Rectangle area;
-        private Gdk.Rectangle clip;
-        private bool text_as_foreground = false;
-        private bool opaque = true;
-
-        public Cairo.Context Context {
-            get { return context; }
-            set { context = value; }
-        }
-
-        public Pango.Layout Layout {
-            get { return layout; }
-            set { layout = value; }
-        }
-
-        public Gtk.Widget Widget {
-            get { return widget; }
-            set { widget = value; }
-        }
-
-        public Gdk.Drawable Drawable {
-            get { return drawable; }
-            set { drawable = value; }
-        }
-
-        public Theme Theme {
-            get { return theme; }
-            set { theme = value; }
-        }
-
-        public Gdk.Rectangle Area {
-            get { return area; }
-            set { area = value; }
-        }
-
-        public Gdk.Rectangle Clip {
-            get { return clip; }
-            set { clip = value; }
-        }
-
-        public bool TextAsForeground {
-            get { return text_as_foreground; }
-            set { text_as_foreground = value; }
-        }
-
-        public bool Opaque {
-            get { return opaque; }
-            set { opaque = value; }
-        }
+        public CellContext ()
+        {
+            Opaque = true;
+        }
+
+        public Cairo.Context Context { get; set; }
+        public Pango.Layout Layout { get; set; }
+        public Gtk.Widget Widget { get; set; }
+        public Gdk.Drawable Drawable { get; set; }
+        public Theme Theme { get; set; }
+        public Gdk.Rectangle Area { get; set; }
+        public Gdk.Rectangle Clip { get; set; }
+        public bool TextAsForeground { get; set; }
+        public bool Opaque { get; set; }
+        public int ViewRowIndex { get; set; }
+        public int ViewColumnIndex { get; set; }
+        public int ModelRowIndex { get; set; }
     }
 }
diff --git a/src/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs b/src/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs
index 26f698b..9aba3a7 100644
--- a/src/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs
+++ b/src/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs
@@ -353,7 +353,11 @@ namespace Hyena.Data.Gui
             cell_area.Height = RowHeight;
             cell_area.Y = area.Y;
 
+            cell_context.ViewRowIndex = cell_context.ModelRowIndex = row_index;
+
             for (int ci = 0; ci < column_cache.Length; ci++) {
+                cell_context.ViewColumnIndex = ci;
+
                 if (pressed_column_is_dragging && pressed_column_index == ci) {
                     continue;
                 }
@@ -483,6 +487,10 @@ namespace Hyena.Data.Gui
                         true, true, selection_color, CairoCorners.All);
                 }
 
+                cell_context.ModelRowIndex = model_row_index;
+                cell_context.ViewRowIndex = view_row_index;
+                cell_context.ViewColumnIndex = view_column_index;
+
                 var item = model[model_row_index];
                 PaintCell (item, 0, model_row_index, grid_cell_alloc,
                     IsRowOpaque (item), IsRowBold (item), StateType.Normal, false);
diff --git a/src/Hyena.Gui/Hyena.Gui.Theming/ThemeContext.cs b/src/Hyena.Gui/Hyena.Gui.Theming/ThemeContext.cs
index 0f8ea97..5c7b6af 100644
--- a/src/Hyena.Gui/Hyena.Gui.Theming/ThemeContext.cs
+++ b/src/Hyena.Gui/Hyena.Gui.Theming/ThemeContext.cs
@@ -33,7 +33,7 @@ namespace Hyena.Gui.Theming
 {
     public class ThemeContext
     {
-        private double radius = 3.0;
+        private double radius = 0.0;
         public double Radius {
             get { return radius; }
             set { radius = value; }



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