banshee r3135 - in trunk/banshee: . src/Core/Banshee.ThickClient/Banshee.Sources.Gui src/Core/Hyena.Gui/Hyena.Widgets



Author: abock
Date: Sat Feb  2 05:49:22 2008
New Revision: 3135
URL: http://svn.gnome.org/viewvc/banshee?rev=3135&view=rev

Log:
2008-02-02  Aaron Bockover  <aaron abock org>

    * src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceRowRenderer.cs:
    Use smarter calculations for computing the row height and middle-aligning
    contents in a row; should look better across all font sizes now

    * src/Core/Hyena.Gui/Hyena.Widgets/RoundedFrame.cs: Reduce the inner border
    width to the correct size to be consistent with the ListView



Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceRowRenderer.cs
   trunk/banshee/src/Core/Hyena.Gui/Hyena.Widgets/RoundedFrame.cs

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceRowRenderer.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceRowRenderer.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceRowRenderer.cs	Sat Feb  2 05:49:22 2008
@@ -67,7 +67,7 @@
             x_offset = 0;
             y_offset = 0;
             width = text_w;
-            height = text_h + 5;
+            height = (int)Math.Max (22, text_h) + 1;
         }
         
         protected override void Render (Gdk.Drawable drawable, Widget widget, Gdk.Rectangle background_area, 
@@ -154,13 +154,13 @@
 
             if (icon != null) {
                 drawable.DrawPixbuf (main_gc, icon, 0, 0, 
-                    cell_area.X + 0, cell_area.Y + ((cell_area.Height - icon.Height) / 2) + 1,
+                    cell_area.X, Middle (cell_area, icon.Height),
                     icon.Width, icon.Height, RgbDither.None, 0, 0);
             }
             
             drawable.DrawLayout (main_gc, 
                 cell_area.X + (icon == null ? 0 : icon.Width) + 6, 
-                cell_area.Y + ((cell_area.Height - title_layout_height) / 2) + 1, 
+                Middle (cell_area, title_layout_height),
                 title_layout);
             
             if (hide_counts) {
@@ -179,11 +179,16 @@
             } 
             
             drawable.DrawLayout (mod_gc,
-                (cell_area.X + cell_area.Width) - count_layout_width - 2,
-                cell_area.Y + ((cell_area.Height - count_layout_height) / 2) + 1,
+                cell_area.X + cell_area.Width - count_layout_width - 2,
+                Middle (cell_area, count_layout_height),
                 count_layout);
         }
         
+        private int Middle (Gdk.Rectangle area, int height)
+        {
+            return area.Y + (int)Math.Round ((double)(area.Height - height) / 2.0) + 1;
+        }
+        
         private Gdk.Pixbuf ResolveSourceIcon (Source source)
         {
             Hyena.Data.PropertyStore properties = source.Properties;

Modified: trunk/banshee/src/Core/Hyena.Gui/Hyena.Widgets/RoundedFrame.cs
==============================================================================
--- trunk/banshee/src/Core/Hyena.Gui/Hyena.Widgets/RoundedFrame.cs	(original)
+++ trunk/banshee/src/Core/Hyena.Gui/Hyena.Widgets/RoundedFrame.cs	Sat Feb  2 05:49:22 2008
@@ -38,7 +38,7 @@
     public class RoundedFrame : Bin
     {
         private ListViewGraphics graphics;
-        private int frame_width = 4;
+        private int frame_width = 3;
         
         private Widget child;
         private Gdk.Rectangle child_allocation;



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