[banshee] TrackInfoDisplay: consistenly choose a color for both line layouts



commit b0aa779de3995c648757d30ae4d4ed578883d7d4
Author: Andrés G. Aragoneses <knocte gmail com>
Date:   Wed Jul 16 20:28:45 2014 +0200

    TrackInfoDisplay: consistenly choose a color for both line layouts
    
    The Pango.Layout objects 'first_line_layout' and 'second_line_layout'
    were being assigned a colour in different ways, which could be a bit
    confusing (the latter was using <span color="xyz"> markup, the former
    was using Cairo.Context.SetSourceColor() API), so let's use markup
    in both cases.
    
    This commit changes behaviour, but doesn't (shouldn't) produce a
    different rendering result in any way.

 .../Banshee.Gui.Widgets/ClassicTrackInfoDisplay.cs |    1 -
 .../Banshee.Gui.Widgets/TrackInfoDisplay.cs        |   10 ++++++----
 2 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/ClassicTrackInfoDisplay.cs 
b/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/ClassicTrackInfoDisplay.cs
index 14e66e1..c1e3bdc 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/ClassicTrackInfoDisplay.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/ClassicTrackInfoDisplay.cs
@@ -212,7 +212,6 @@ namespace Banshee.Gui.Widgets
 
             if (renderTrack) {
                 cr.MoveTo (x, y);
-                cr.SetSourceColor (TextColor);
                 Pango.CairoHelper.ShowLayout (cr, first_line_layout);
             }
 
diff --git a/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TrackInfoDisplay.cs 
b/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TrackInfoDisplay.cs
index 3722737..0df50ff 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TrackInfoDisplay.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TrackInfoDisplay.cs
@@ -28,7 +28,6 @@
 //
 
 using System;
-using System.Collections.Generic;
 using Mono.Unix;
 
 using Gtk;
@@ -38,7 +37,6 @@ using Hyena;
 using Hyena.Gui;
 using Hyena.Gui.Theatrics;
 
-using Banshee.Base;
 using Banshee.Collection;
 using Banshee.Collection.Gui;
 using Banshee.ServiceStack;
@@ -524,7 +522,7 @@ namespace Banshee.Gui.Widgets
 
         protected virtual string GetFirstLineText (TrackInfo track)
         {
-            return String.Format ("<b>{0}</b>", GLib.Markup.EscapeText (track.DisplayTrackTitle));
+            return WrapWithDefaultTextColor (String.Format ("<b>{0}</b>", GLib.Markup.EscapeText 
(track.DisplayTrackTitle)));
         }
 
         protected virtual string GetSecondLineText (TrackInfo track)
@@ -561,6 +559,11 @@ namespace Banshee.Gui.Widgets
                 markup = GetByFrom (track.ArtistName, track.DisplayArtistName, track.AlbumTitle, 
track.DisplayAlbumTitle, true);
             }
 
+            return WrapWithDefaultTextColor (markup);
+        }
+
+        private string WrapWithDefaultTextColor (string markup)
+        {
             return String.Format ("<span color=\"{0}\">{1}</span>",
                 CairoExtensions.ColorGetHex (TextColor, false),
                 markup);
@@ -582,7 +585,6 @@ namespace Banshee.Gui.Widgets
 
         private string GetByFrom (string artist, string display_artist, string album, string display_album, 
bool unknown_ok)
         {
-
             bool has_artist = !String.IsNullOrEmpty (artist);
             bool has_album = !String.IsNullOrEmpty (album);
 


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