[banshee] ThickClient: workaround for invisible (instead of bold) text (bgo#732838)



commit f3f9c3300d415f86b78c20ca22fef077ec221c44
Author: Andrés G. Aragoneses <knocte gmail com>
Date:   Mon Jul 7 15:44:37 2014 +0200

    ThickClient: workaround for invisible (instead of bold) text (bgo#732838)
    
    After several hours attempting to find a reduced testcase for this
    problem (which appears to be somewhere deeper in the stack: pango,
    cairo, or gtk), I've found this harmless workaround that actually
    makes the first line of text (in TrackInfoDisplay class) be more
    consistent with the second line of text (the latter already wrapped
    other markup elements with a wider <span> element using the default
    text colour).
    
    The TextColor and BackgroundColor properties seem to have wrong
    values though (both black, rgb#000000), compared to the stable
    branch (GTK2), but that will be tracked in a different bug, because
    it is unrelated to this issue.

 .../Banshee.Gui.Widgets/TrackInfoDisplay.cs        |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TrackInfoDisplay.cs 
b/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TrackInfoDisplay.cs
index 7ba287d..ade2e88 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;
@@ -505,7 +503,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)
@@ -542,6 +540,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);
@@ -563,7 +566,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]