[mistelix] Fixes issue #584493
- From: Jordi Mas <jmas src gnome org>
- To: svn-commits-list gnome org
- Subject: [mistelix] Fixes issue #584493
- Date: Wed, 24 Jun 2009 18:07:34 +0000 (UTC)
commit c90356e6338593b44e197b80ab8589e0ca5dd322
Author: Jordi Mas <jmas softcatala org>
Date: Wed Jun 24 20:07:07 2009 +0200
Fixes issue #584493
src/datamodel/ProjectDetails.cs | 4 ++--
src/widgets/GtkUtils.cs | 13 ++++++++++---
2 files changed, 12 insertions(+), 5 deletions(-)
---
diff --git a/src/datamodel/ProjectDetails.cs b/src/datamodel/ProjectDetails.cs
index b15371f..aba1017 100644
--- a/src/datamodel/ProjectDetails.cs
+++ b/src/datamodel/ProjectDetails.cs
@@ -65,11 +65,11 @@ namespace Mistelix.DataModel
public ProjectDetails ()
{
buttons_back_color = new Cairo.Color (44d / 255d, 56d / 255d, 119d / 255d, 0.5);
- buttons_fore_color = new Cairo.Color (1, 1, 1, 255);
+ buttons_fore_color = new Cairo.Color (1, 1, 1, 1);
buttons_fontname = "sans 12";
slideshows_back_color = new Cairo.Color (44d / 255d, 56d / 255d, 119d / 255d, 0.5);
- slideshows_fore_color = new Cairo.Color (1, 1, 1, 255);
+ slideshows_fore_color = new Cairo.Color (1, 1, 1, 1);
slideshows_fontname = "sans 12";
}
diff --git a/src/widgets/GtkUtils.cs b/src/widgets/GtkUtils.cs
index 4af1202..1593ae2 100644
--- a/src/widgets/GtkUtils.cs
+++ b/src/widgets/GtkUtils.cs
@@ -45,9 +45,10 @@ namespace Mistelix.Widgets
cr.Restore ();
}
- public static Cairo.Color GdkToCairoColor (Gdk.Color color, int alpha)
+ public static Cairo.Color GdkToCairoColor (Gdk.Color color, int a)
{
- return new Cairo.Color (color.Red / 65535.0, color.Green / 65535.0, color.Blue / 65535.0, alpha / 65535.0);
+ double alpha = a / 65535.0;
+ return new Cairo.Color ((color.Red / 65535.0) * alpha, (color.Green / 65535.0) * alpha, (color.Blue / 65535.0) * alpha, alpha);
}
public static Cairo.Color GdkToCairoColor (Gdk.Color color)
@@ -57,7 +58,13 @@ namespace Mistelix.Widgets
public static Gdk.Color CairoToGdkColor (Cairo.Color color)
{
- return new Gdk.Color ((byte) (color.R * 65535), (byte) (color.G * 65535), (byte) (color.B * 65535));
+ double r, g, b;
+
+ r = (color.R * 255.0) / color.A;
+ g = (color.G * 255.0) / color.A;
+ b = (color.B * 255.0) / color.A;
+
+ return new Gdk.Color ((byte)r, (byte)g, (byte)b);
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]