[banshee/gtk3] ThickClient: Update to the new GTK theming API



commit 625aeb0f2ccac426c8ac58c6da83bb81ac2bb96d
Author: Bertrand Lorentz <bertrand lorentz gmail com>
Date:   Thu Jul 21 22:58:28 2011 +0200

    ThickClient: Update to the new GTK theming API

 .../Banshee.Gui.TrackEditor/StatisticsPage.cs      |    6 +++---
 .../Banshee.Gui.TrackEditor/TextViewEntry.cs       |    3 ++-
 .../Banshee.Gui.Widgets/ArtworkPopup.cs            |   12 ++++++++----
 .../Banshee.Gui.Widgets/TitledList.cs              |    4 ++--
 .../Banshee.Gui.Widgets/TrackInfoDisplay.cs        |    4 ++--
 5 files changed, 17 insertions(+), 12 deletions(-)
---
diff --git a/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/StatisticsPage.cs b/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/StatisticsPage.cs
index 3ac3fef..4fc4577 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/StatisticsPage.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/StatisticsPage.cs
@@ -163,10 +163,10 @@ namespace Banshee.Gui.TrackEditor
             }
         }
 
-        protected override void OnStyleSet (Style previous_style)
+        protected override void OnStyleUpdated ()
         {
-            base.OnStyleSet (previous_style);
-            name_renderer.CellBackgroundGdk = Style.Background (StateType.Normal);
+            base.OnStyleUpdated ();
+            name_renderer.CellBackgroundRgba = StyleContext.GetBackgroundColor (StateFlags.Normal);
         }
 
         public void Initialize (TrackEditorDialog dialog)
diff --git a/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/TextViewEntry.cs b/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/TextViewEntry.cs
index 87713d8..d2f2935 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/TextViewEntry.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/TextViewEntry.cs
@@ -64,7 +64,8 @@ namespace Banshee.Gui.TrackEditor
 
         protected override void OnGetPreferredHeight (out int minimum_height, out int natural_height)
         {
-            Pango.FontMetrics metrics = PangoContext.GetMetrics (entry.Style.FontDescription, PangoContext.Language);
+            Pango.FontMetrics metrics = PangoContext.GetMetrics (
+                entry.StyleContext.GetFont (StateFlags.Normal), PangoContext.Language);
             int line_height = ((int)(metrics.Ascent + metrics.Descent) + 512) >> 10; // PANGO_PIXELS(d)
             metrics.Dispose ();
             minimum_height = natural_height = (line_height + 2) * 2;
diff --git a/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/ArtworkPopup.cs b/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/ArtworkPopup.cs
index 69dadf6..b02307c 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/ArtworkPopup.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/ArtworkPopup.cs
@@ -52,10 +52,14 @@ namespace Banshee.Gui.Widgets
             label.CanFocus = false;
             label.Wrap = true;
 
-            label.ModifyBg(StateType.Normal, new Color(0, 0, 0));
-            label.ModifyFg(StateType.Normal, new Color(160, 160, 160));
-            ModifyBg(StateType.Normal, new Color(0, 0, 0));
-            ModifyFg(StateType.Normal, new Color(160, 160, 160));
+            var bg_color = new RGBA ();
+            bg_color.Red = bg_color.Green = bg_color.Blue = 0;
+            var fg_color = new RGBA ();
+            fg_color.Red = bg_color.Green = bg_color.Blue =  160.0 / 255;
+            label.OverrideBackgroundColor (StateFlags.Normal, bg_color);
+            label.OverrideColor (StateFlags.Normal, fg_color);
+            OverrideBackgroundColor (StateFlags.Normal, bg_color);
+            OverrideColor (StateFlags.Normal, fg_color);
 
             vbox.PackStart(image, true, true, 0);
             vbox.PackStart(label, false, false, 0);
diff --git a/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TitledList.cs b/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TitledList.cs
index c85affb..eaee423 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TitledList.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TitledList.cs
@@ -61,8 +61,8 @@ namespace Banshee.Gui.Widgets
             title.Show ();
 
             StyleSet += delegate {
-                title.ModifyBg (StateType.Normal, Style.Base (StateType.Normal));
-                title.ModifyFg (StateType.Normal, Style.Text (StateType.Normal));
+                title.OverrideBackgroundColor (StateFlags.Normal, StyleContext.GetBackgroundColor (StateFlags.Normal));
+                title.OverrideColor (StateFlags.Normal, StyleContext.GetColor (StateFlags.Normal));
             };
         }
     }
diff --git a/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TrackInfoDisplay.cs b/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TrackInfoDisplay.cs
index 14f2275..838dcf8 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TrackInfoDisplay.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TrackInfoDisplay.cs
@@ -202,8 +202,8 @@ namespace Banshee.Gui.Widgets
         {
             base.OnStyleSet (previous);
 
-            text_color = CairoExtensions.GdkColorToCairoColor (Style.Foreground (StateType.Normal));
-            BackgroundColor = CairoExtensions.GdkColorToCairoColor (Style.Background (StateType.Normal));
+            text_color = CairoExtensions.GdkRGBAToCairoColor (StyleContext.GetColor (StateFlags.Normal));
+            BackgroundColor = CairoExtensions.GdkRGBAToCairoColor (StyleContext.GetBackgroundColor (StateFlags.Normal));
             text_light_color = Hyena.Gui.Theming.GtkTheme.GetCairoTextMidColor (this);
 
             ResetMissingImages ();



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