[murrine/gtk+3] Fixed arrows
- From: Andrea Cimitan <acimitan src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [murrine/gtk+3] Fixed arrows
- Date: Wed, 13 Oct 2010 02:27:09 +0000 (UTC)
commit f8de372128cbee31b6738b19fc1ef2afc8801bac
Author: Andrea Cimitan <andrea cimitan gmail com>
Date: Wed Oct 13 04:26:43 2010 +0200
Fixed arrows
src/cairo-support.c | 16 ++++++++++++++++
src/cairo-support.h | 2 ++
src/murrine_draw.c | 4 +++-
src/murrine_style.c | 33 +++++++--------------------------
4 files changed, 28 insertions(+), 27 deletions(-)
---
diff --git a/src/cairo-support.c b/src/cairo-support.c
index 958cb47..2a3592c 100644
--- a/src/cairo-support.c
+++ b/src/cairo-support.c
@@ -263,6 +263,22 @@ murrine_gdk_color_to_rgb (GdkColor *c, double *r, double *g, double *b)
}
void
+murrine_gdk_color_to_murrinergb (const GdkColor *c, MurrineRGB *cc)
+{
+ gdouble r, g, b;
+
+ g_return_if_fail (c && cc);
+
+ r = c->red / 65535.0;
+ g = c->green / 65535.0;
+ b = c->blue / 65535.0;
+
+ cc->r = r;
+ cc->g = g;
+ cc->b = b;
+}
+
+void
murrine_get_parent_bg (const GtkWidget *widget, MurrineRGB *color)
{
GtkStateType state_type;
diff --git a/src/cairo-support.h b/src/cairo-support.h
index ee67c69..c9f81a3 100644
--- a/src/cairo-support.h
+++ b/src/cairo-support.h
@@ -33,6 +33,8 @@ G_GNUC_INTERNAL void murrine_mix_color (const MurrineRGB *color1, const MurrineR
G_GNUC_INTERNAL void murrine_gdk_color_to_rgb (GdkColor *c,
double *r, double *g, double *b);
+G_GNUC_INTERNAL void murrine_gdk_color_to_murrinergb (const GdkColor * gc, MurrineRGB *cc);
+
G_GNUC_INTERNAL void murrine_get_parent_bg (const GtkWidget *widget,
MurrineRGB *color);
diff --git a/src/murrine_draw.c b/src/murrine_draw.c
index eb7f92d..b4147d0 100644
--- a/src/murrine_draw.c
+++ b/src/murrine_draw.c
@@ -2778,11 +2778,13 @@ murrine_draw_arrow (cairo_t *cr,
if (widget->disabled)
{
+ cairo_save (cr);
_murrine_draw_arrow (cr, &colors->shade[0], arrow,
tx+0.5, ty+0.5, width, height);
+ cairo_restore (cr);
}
- cairo_identity_matrix (cr);
+/* cairo_identity_matrix (cr);*/
_murrine_draw_arrow (cr, &color, arrow,
tx, ty, width, height);
diff --git a/src/murrine_style.c b/src/murrine_style.c
index eb72ace..f09bf2d 100644
--- a/src/murrine_style.c
+++ b/src/murrine_style.c
@@ -954,7 +954,7 @@ murrine_style_draw_box (DRAW_ARGS)
slider.lower = DETAIL ("trough-lower");
slider.fill_level = DETAIL ("trough-fill-level") || DETAIL ("trough-fill-level-full");
- slider.horizontal = gtk_orientable_get_orientation (GTK_ORIENTABLE (widget)); /* width>=height; *//* XXX fallback based on size, is there an API? */
+ slider.horizontal = gtk_orientable_get_orientation (GTK_ORIENTABLE (widget)) == GTK_ORIENTATION_HORIZONTAL;
murrine_set_widget_parameters (widget, style, state_type, ¶ms);
params.corners = MRN_CORNER_ALL;
@@ -2344,9 +2344,7 @@ murrine_style_realize (GtkStyle *style)
contrast = MURRINE_RC_STYLE (style->rc_style)->contrast;
- bg_normal.r = style->bg[0].red/65535.0;
- bg_normal.g = style->bg[0].green/65535.0;
- bg_normal.b = style->bg[0].blue/65535.0;
+ murrine_gdk_color_to_murrinergb (&style->bg[GTK_STATE_NORMAL], &bg_normal);
/* (GtkWidget *) Apply contrast */
for (i = 0; i < 9; i++)
@@ -2357,9 +2355,7 @@ murrine_style_realize (GtkStyle *style)
}
spots[2] = murrine_get_contrast(spots[2], contrast);
- spot_color.r = style->bg[GTK_STATE_SELECTED].red/65535.0;
- spot_color.g = style->bg[GTK_STATE_SELECTED].green/65535.0;
- spot_color.b = style->bg[GTK_STATE_SELECTED].blue/65535.0;
+ murrine_gdk_color_to_murrinergb (&style->bg[GTK_STATE_SELECTED], &spot_color);
murrine_shade (&spot_color, spots[0], &murrine_style->colors.spot[0]);
murrine_shade (&spot_color, spots[1], &murrine_style->colors.spot[1]);
@@ -2367,25 +2363,10 @@ murrine_style_realize (GtkStyle *style)
for (i=0; i<5; i++)
{
- murrine_gdk_color_to_rgb (&style->bg[i],
- &murrine_style->colors.bg[i].r,
- &murrine_style->colors.bg[i].g,
- &murrine_style->colors.bg[i].b);
-
- murrine_gdk_color_to_rgb (&style->base[i],
- &murrine_style->colors.base[i].r,
- &murrine_style->colors.base[i].g,
- &murrine_style->colors.base[i].b);
-
- murrine_gdk_color_to_rgb (&style->text[i],
- &murrine_style->colors.text[i].r,
- &murrine_style->colors.text[i].g,
- &murrine_style->colors.text[i].b);
-
- murrine_gdk_color_to_rgb (&style->fg[i],
- &murrine_style->colors.fg[i].r,
- &murrine_style->colors.fg[i].g,
- &murrine_style->colors.fg[i].b);
+ murrine_gdk_color_to_murrinergb (&style->bg[i], &murrine_style->colors.bg[i]);
+ murrine_gdk_color_to_murrinergb (&style->base[i], &murrine_style->colors.base[i]);
+ murrine_gdk_color_to_murrinergb (&style->text[i], &murrine_style->colors.text[i]);
+ murrine_gdk_color_to_murrinergb (&style->fg[i], &murrine_style->colors.fg[i]);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]