[banshee] [ThickClient] Add canvas tooltips to status indicator



commit 4257f338cb8e742589164aa6f74cca781eb8188c
Author: Gabriel Burt <gabriel burt gmail com>
Date:   Wed Oct 27 21:13:32 2010 -0500

    [ThickClient] Add canvas tooltips to status indicator

 .../ColumnCellStatusIndicator.cs                   |   19 +++++++--------
 .../ColumnCellPodcastStatusIndicator.cs            |   25 +++++++++++--------
 2 files changed, 23 insertions(+), 21 deletions(-)
---
diff --git a/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellStatusIndicator.cs b/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellStatusIndicator.cs
index addcd14..f569e23 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellStatusIndicator.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellStatusIndicator.cs
@@ -113,16 +113,13 @@ namespace Banshee.Collection.Gui
             get { return status_names; }
         }
 
-        private int pixbuf_size = 16;
-        protected virtual int PixbufSize {
+        private int pixbuf_size;
+        protected int PixbufSize {
             get { return pixbuf_size; }
-            set { pixbuf_size = value; }
-        }
-
-        private int pixbuf_spacing = 4;
-        protected virtual int PixbufSpacing {
-            get { return pixbuf_spacing; }
-            set { pixbuf_spacing = value; }
+            set {
+                pixbuf_size = value;
+                Width = Height = value;
+            }
         }
 
         private Gdk.Pixbuf [] pixbufs;
@@ -136,8 +133,9 @@ namespace Banshee.Collection.Gui
 
         public ColumnCellStatusIndicator (string property, bool expand) : base (property, expand)
         {
-            LoadPixbufs ();
             RestrictSize = true;
+            PixbufSize = 16;
+            LoadPixbufs ();
         }
 
         public bool RestrictSize { get; set; }
@@ -241,6 +239,7 @@ namespace Banshee.Collection.Gui
             }
 
             int icon_index = GetIconIndex (track);
+            TooltipMarkup = icon_index == -1 ? null : StatusNames[icon_index];
 
             if (icon_index < 0 || pixbufs == null || pixbufs[icon_index] == null) {
                 return;
diff --git a/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/ColumnCellPodcastStatusIndicator.cs b/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/ColumnCellPodcastStatusIndicator.cs
index 792fc48..77c1832 100644
--- a/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/ColumnCellPodcastStatusIndicator.cs
+++ b/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/ColumnCellPodcastStatusIndicator.cs
@@ -62,24 +62,27 @@ namespace Banshee.Podcasting.Gui
             StatusNames[base.PixbufCount + 0] = Catalog.GetString ("Downloading");
 
             // Podcast is Downloaded
-            Pixbufs[base.PixbufCount + 1] = IconThemeUtils.LoadIcon (PixbufSize, "podcast-new");
-            StatusNames[base.PixbufCount + 1] = Catalog.GetString ("New");
+            Pixbufs[base.PixbufCount + 1] = IconThemeUtils.LoadIcon (PixbufSize, "document-save");
+            StatusNames[base.PixbufCount + 1] = Catalog.GetString ("Downloaded");
         }
 
         protected override int GetIconIndex (TrackInfo track)
         {
+            int i = -1;
             PodcastTrackInfo podcast = PodcastTrackInfo.From (track);
-            if (track == null) {
-                return -1;
+            if (track != null) {
+                switch (podcast.Activity) {
+                    case PodcastItemActivity.Downloading:
+                    case PodcastItemActivity.DownloadPending:
+                        i = base.PixbufCount + 0;
+                        break;
+                    default:
+                        i = podcast.IsDownloaded ? base.PixbufCount + 1 : -1;
+                        break;
+                }
             }
 
-            switch (podcast.Activity) {
-                case PodcastItemActivity.Downloading:
-                case PodcastItemActivity.DownloadPending:
-                    return base.PixbufCount + 0;
-                default:
-                    return podcast.IsDownloaded ? base.PixbufCount + 1 : -1;
-            }
+            return i;
         }
 
         public override void Render (CellContext context, StateType state, double cellWidth, double cellHeight)



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