[longomatch] Set the category color as a background color
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Set the category color as a background color
- Date: Tue, 30 Aug 2011 20:58:17 +0000 (UTC)
commit f047212c0c40c713f02d6b9a67d9984fd48d255c
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Sun Aug 28 20:07:00 2011 +0200
Set the category color as a background color
LongoMatch/Gui/Component/ButtonsWidget.cs | 15 +++++++++------
1 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/LongoMatch/Gui/Component/ButtonsWidget.cs b/LongoMatch/Gui/Component/ButtonsWidget.cs
index 36cf9a2..d18b169 100644
--- a/LongoMatch/Gui/Component/ButtonsWidget.cs
+++ b/LongoMatch/Gui/Component/ButtonsWidget.cs
@@ -21,6 +21,7 @@
using System;
using System.Collections.Generic;
using Gtk;
+using Gdk;
using LongoMatch.Common;
using LongoMatch.Handlers;
using LongoMatch.Store;
@@ -85,20 +86,22 @@ namespace LongoMatch.Gui.Component
uint col_left = (uint) i%table1.NColumns;
uint col_right = (uint) col_left+1 ;
- string colorString = String.Format("#{0:X4}{1:X4}{2:X4}",
- cat.Color.Red,
- cat.Color.Green,
- cat.Color.Blue);
- l.Markup = String.Format("<span foreground=\"{0}\">{1}</span>",
- colorString, cat.Name);
+ l.Markup = cat.Name;
l.Justify = Justification.Center;
l.Ellipsize = Pango.EllipsizeMode.Middle;
l.CanFocus = false;
+
+ var c = new Color();
+ Color.Parse("black", ref c);
+ l.ModifyFg(StateType.Normal, c);
+ l.ModifyFg(StateType.Prelight, cat.Color);
+ l.Markup = cat.Name;
b.Add(l);
b.Name = i.ToString();
b.Clicked += new EventHandler(OnButtonClicked);
b.CanFocus = false;
+ b.ModifyBg(StateType.Normal, cat.Color);
l.Show();
b.Show();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]