Commit b0aa779d authored by Andrés G. Aragoneses's avatar Andrés G. Aragoneses

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.
parent 25fec2bc
......@@ -212,7 +212,6 @@ namespace Banshee.Gui.Widgets
if (renderTrack) {
cr.MoveTo (x, y);
cr.SetSourceColor (TextColor);
Pango.CairoHelper.ShowLayout (cr, first_line_layout);
......@@ -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),
......@@ -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);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment