banshee r3265 - in trunk/banshee: . src/Core/Banshee.ThickClient/Banshee.Gui.Widgets src/Libraries/Hyena.Gui/Hyena.Data.Gui src/Libraries/Hyena.Gui/Hyena.Widgets



Author: abock
Date: Mon Feb 18 22:37:01 2008
New Revision: 3265
URL: http://svn.gnome.org/viewvc/banshee?rev=3265&view=rev

Log:
2008-02-18  Aaron Bockover  <abock gnome org>

    * src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/ConnectedMessageBar.cs:
    Set some default spacing

    * src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListViewGraphics.cs: Add a version
    of DrawFrame that takes a color

    * src/Libraries/Hyena.Gui/Hyena.Widgets/MessageBar.cs: Draw our nice
    rounded frame and set a good default padding



Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/ConnectedMessageBar.cs
   trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListViewGraphics.cs
   trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Widgets/MessageBar.cs

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/ConnectedMessageBar.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/ConnectedMessageBar.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/ConnectedMessageBar.cs	Mon Feb 18 22:37:01 2008
@@ -48,6 +48,8 @@
             CloseClicked += OnCloseClicked;
             ServiceManager.SourceManager.ActiveSourceChanged += OnActiveSourceChanged;
             ConnectSource (ServiceManager.SourceManager.ActiveSource);
+            
+            LeftPadding = 15;
         }
         
         private void ConnectSource (Source source)

Modified: trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListViewGraphics.cs
==============================================================================
--- trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListViewGraphics.cs	(original)
+++ trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListViewGraphics.cs	Mon Feb 18 22:37:01 2008
@@ -205,11 +205,16 @@
         
         public void DrawFrame (Cairo.Context cr, Gdk.Rectangle alloc, bool baseColor)
         {
+            DrawFrame (cr, alloc,  baseColor 
+                ? GetWidgetColor (GtkColorClass.Base, StateType.Normal)
+                : GetWidgetColor (GtkColorClass.Background, StateType.Normal));
+        }
+        
+        public void DrawFrame (Cairo.Context cr, Gdk.Rectangle alloc, Cairo.Color color)
+        {
             CairoCorners corners = CairoCorners.All;
         
-            cr.Color = baseColor 
-                ? GetWidgetColor (GtkColorClass.Base, StateType.Normal)
-                : GetWidgetColor (GtkColorClass.Background, StateType.Normal);
+            cr.Color = color;
             CairoExtensions.RoundedRectangle (cr, alloc.X, alloc.Y, alloc.Width, alloc.Height, BorderRadius, corners);
             cr.Fill ();
             

Modified: trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Widgets/MessageBar.cs
==============================================================================
--- trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Widgets/MessageBar.cs	(original)
+++ trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Widgets/MessageBar.cs	Mon Feb 18 22:37:01 2008
@@ -29,6 +29,9 @@
 using System;
 using Gtk;
 
+using Hyena.Gui;
+using Hyena.Data.Gui;
+
 namespace Hyena.Widgets
 {
     public class MessageBar : Alignment
@@ -39,6 +42,8 @@
         private Button button;
         private Button close_button;
         
+        private ListViewGraphics graphics;
+        
         public event EventHandler ButtonClicked {
             add { button.Clicked += value; }
             remove { button.Clicked -= value; }
@@ -87,20 +92,36 @@
             Add (shell_box);
             
             EnsureStyle ();
+            
+            BorderWidth = 3;
         }
-
+        
+        protected override void OnRealized ()
+        {
+            base.OnRealized ();
+            
+            graphics = new ListViewGraphics (this);
+            graphics.RefreshColors ();
+        }
+        
         protected override bool OnExposeEvent (Gdk.EventExpose evnt)
         {
-            GdkWindow.DrawRectangle (Style.BackgroundGC (StateType.Normal), true, Allocation);
+            if (!IsDrawable) {
+                return false;
+            }
+ 
+            Cairo.Context cr = Gdk.CairoHelper.Create (evnt.Window);
                 
-            Gtk.Style.PaintFlatBox (Style, GdkWindow, StateType.Normal, ShadowType.Out,
-                Gdk.Rectangle.Zero, this, "tooltip", Allocation.X, Allocation.Y, 
-                Allocation.Width, Allocation.Height);
-            
-            base.OnExposeEvent (evnt);
-            return true;
+            try {
+                Gdk.Color color = Style.Background (StateType.Normal);
+                graphics.DrawFrame (cr, Allocation, CairoExtensions.GdkColorToCairoColor (color));
+                return base.OnExposeEvent(evnt);
+            } finally {
+                ((IDisposable)cr.Target).Dispose ();
+                ((IDisposable)cr).Dispose ();
+            }
         }
-      
+        
         private bool changing_style = false;
         protected override void OnStyleSet (Gtk.Style previousStyle)
         {



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