banshee r3538 - in trunk/banshee: . src/Clients/Nereid/Nereid src/Core/Banshee.ThickClient/Banshee.Collection.Gui src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView src/Libraries/Hyena.Gui/Hyena.Gui.Theming



Author: abock
Date: Tue Mar 25 20:43:57 2008
New Revision: 3538
URL: http://svn.gnome.org/viewvc/banshee?rev=3538&view=rev

Log:
2008-03-25  Aaron Bockover  <abock gnome org>

    * src/Clients/Nereid/Nereid/PlayerInterface.cs:
    Set the source on the track view column controller when it changes

    * src/Core/Banshee.ThickClient/Banshee.Collection.Gui/PersistentColumnController.cs:
    Preliminary work to allow column settings to persist against each primary
    source; all settings go to the default save location for now

    * src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs:
    Set the FillAlpha when rendering the sort rectangle for the column so it
    blends with the row rules

    * src/Libraries/Hyena.Gui/Hyena.Gui.Theming/GtkTheme.cs: Render the
    row rule with a set FillAlpha



Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Clients/Nereid/Nereid/PlayerInterface.cs
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/PersistentColumnController.cs
   trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs
   trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Gui.Theming/GtkTheme.cs

Modified: trunk/banshee/src/Clients/Nereid/Nereid/PlayerInterface.cs
==============================================================================
--- trunk/banshee/src/Clients/Nereid/Nereid/PlayerInterface.cs	(original)
+++ trunk/banshee/src/Clients/Nereid/Nereid/PlayerInterface.cs	Tue Mar 25 20:43:57 2008
@@ -306,6 +306,11 @@
                 }
                 composite_view.SetSource (source);
                 composite_view.TrackModel.Reloaded += HandleTrackModelReloaded;
+                PersistentColumnController column_controller = 
+                    composite_view.TrackView.ColumnController as PersistentColumnController;
+                if (column_controller != null) {
+                    column_controller.Source = source;
+                }
                 view_container.Content = composite_view;
                 view_container.Show ();
             } else if (source is Hyena.Data.IObjectListModel) {

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/PersistentColumnController.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/PersistentColumnController.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/PersistentColumnController.cs	Tue Mar 25 20:43:57 2008
@@ -30,6 +30,7 @@
 using System.Collections.Generic;
 
 using Hyena.Data.Gui;
+using Banshee.Sources;
 using Banshee.Configuration;
 
 namespace Banshee.Collection.Gui
@@ -39,6 +40,31 @@
         private string root_namespace;
         private bool loaded = false;
         
+        private string source_id;
+        private Source source;
+        public Source Source {
+            get { return source; }
+            set { 
+                if (source == value) {
+                    return;
+                }
+                
+                if (source != null) {
+                    Save ();
+                }
+                
+                source = value;
+                source_id = null;
+                
+                if (source != null) {
+                    // FIXME: Build a real source ID based on the source's primary source
+                    source_id = "default";
+                    source_id = source_id.ToLower ().Replace ('.', '_');
+                    Load ();
+                }
+            }
+        }
+        
         public PersistentColumnController (string rootNamespace) : base ()
         {
             if (String.IsNullOrEmpty (rootNamespace)) {
@@ -49,8 +75,12 @@
         }
         
         public void Load ()
-        {
+        {    
             lock (this) {
+                if (source == null) {
+                    return;
+                }
+                
                 foreach (Column column in this) {
                     if (column.Id != null) {
                         string @namespace = MakeNamespace (column.Id); 
@@ -80,6 +110,10 @@
         public void Save ()
         {
             lock (this) {
+                if (source == null) {
+                    return;
+                }
+            
                 for (int i = 0; i < Count; i++) {
                     if (Columns[i].Id != null) {
                         Save (Columns[i], i);
@@ -107,7 +141,7 @@
         
         private string MakeNamespace (string name)
         {
-            return String.Format ("{0}.{1}", root_namespace, name);
+            return String.Format ("{0}.{1}.{2}", root_namespace, source_id, name);
         }
         
         public override bool EnableColumnMenu {

Modified: trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs
==============================================================================
--- trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs	(original)
+++ trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs	Tue Mar 25 20:43:57 2008
@@ -214,7 +214,10 @@
             // Render the sort effect to the canvas.
             if (sort_column_index != -1 && (!pressed_column_is_dragging || pressed_column_index != sort_column_index)) {
                 CachedColumn col = column_cache[sort_column_index];
+                Theme.PushContext ();
+                Theme.Context.FillAlpha = 0.6;
                 Theme.DrawRowRule (cairo_context, col.X1, 0, col.Width, canvas_alloc.Height);
+                Theme.PopContext ();
             }
             
             int first_row = top;

Modified: trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Gui.Theming/GtkTheme.cs
==============================================================================
--- trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Gui.Theming/GtkTheme.cs	(original)
+++ trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Gui.Theming/GtkTheme.cs	Tue Mar 25 20:43:57 2008
@@ -248,7 +248,7 @@
         
         public override void DrawRowRule(Cairo.Context cr, int x, int y, int width, int height)
         {
-            cr.Color = rule_color;
+            cr.Color = new Cairo.Color (rule_color.R, rule_color.G, rule_color.B, Context.FillAlpha);
             cr.Rectangle (x, y, width, height);
             cr.Fill ();
         }



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