[murrine] Too much things here... I will edit the NEWS file
- From: Andrea Cimitan <acimitan src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [murrine] Too much things here... I will edit the NEWS file
- Date: Tue, 8 Dec 2009 15:22:37 +0000 (UTC)
commit 0a19c65eeca37ee27964434af0e572f24d3bdabe
Author: Andrea Cimitan <andrea cimitan gmail com>
Date: Mon Dec 7 23:23:54 2009 +0100
Too much things here... I will edit the NEWS file
src/cairo-support.c | 150 ++++++++++++++---
src/cairo-support.h | 14 ++
src/murrine_draw.c | 432 ++++++++++++++++++++++++++++++++--------------
src/murrine_draw_rgba.c | 340 ++++++++++++++++++++++++-------------
src/murrine_rc_style.c | 323 +++++++++++++++++++++++-----------
src/murrine_rc_style.h | 68 ++++----
src/murrine_style.c | 258 ++++++++++++++++------------
src/murrine_style.h | 12 +-
src/murrine_theme_main.c | 1 +
src/murrine_types.h | 39 +++--
10 files changed, 1100 insertions(+), 537 deletions(-)
---
diff --git a/src/cairo-support.c b/src/cairo-support.c
index 847c94b..ab86acf 100644
--- a/src/cairo-support.c
+++ b/src/cairo-support.c
@@ -611,23 +611,32 @@ murrine_draw_top_glow (cairo_t *cr,
static void
murrine_draw_lightborder (cairo_t *cr,
- const MurrineRGB *highlight_color,
const MurrineRGB *fill,
MurrineGradients mrn_gradient,
double x, double y, int width, int height,
boolean gradients,
int glazestyle, int lightborderstyle,
- int radius, uint8 corners)
+ double lightborder_shade, int radius, uint8 corners)
{
cairo_pattern_t *pat;
MurrineRGB shade1, shade2, shade3, shade4;
double alpha_value = mrn_gradient.use_rgba ? mrn_gradient.rgba_opacity : 1.0;
radius = MIN (radius, MIN ((double)width/2.0, (double)height/2.0));
- murrine_shade (highlight_color, mrn_gradient.gradient_shades[0], &shade1);
- murrine_shade (highlight_color, mrn_gradient.gradient_shades[1], &shade2);
- murrine_shade (highlight_color, mrn_gradient.gradient_shades[2], &shade3);
- murrine_shade (highlight_color, mrn_gradient.gradient_shades[3], &shade4);
+ if (mrn_gradient.has_gradient_colors)
+ {
+ murrine_shade (&mrn_gradient.gradient_colors[0], lightborder_shade*mrn_gradient.gradient_shades[0], &shade1);
+ murrine_shade (&mrn_gradient.gradient_colors[1], lightborder_shade*mrn_gradient.gradient_shades[1], &shade2);
+ murrine_shade (&mrn_gradient.gradient_colors[2], lightborder_shade*mrn_gradient.gradient_shades[2], &shade3);
+ murrine_shade (&mrn_gradient.gradient_colors[3], lightborder_shade*mrn_gradient.gradient_shades[3], &shade4);
+ }
+ else
+ {
+ murrine_shade (fill, lightborder_shade*mrn_gradient.gradient_shades[0], &shade1);
+ murrine_shade (fill, lightborder_shade*mrn_gradient.gradient_shades[1], &shade2);
+ murrine_shade (fill, lightborder_shade*mrn_gradient.gradient_shades[2], &shade3);
+ murrine_shade (fill, lightborder_shade*mrn_gradient.gradient_shades[3], &shade4);
+ }
cairo_save (cr);
@@ -749,16 +758,14 @@ murrine_draw_glaze (cairo_t *cr,
if (widget->glazestyle != 4 && lightborder_shade != 1.0)
{
- murrine_shade (fill, lightborder_shade*highlight_shade, &highlight);
-
if (mrn_gradient.use_rgba)
cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
- murrine_draw_lightborder (cr, &highlight, fill, mrn_gradient,
+ murrine_draw_lightborder (cr, fill, mrn_gradient,
x+0.5, y+0.5, width-1, height-1,
mrn_gradient.gradients,
widget->glazestyle, widget->lightborderstyle,
- radius, corners);
+ lightborder_shade*highlight_shade, radius, corners);
}
}
@@ -779,7 +786,27 @@ murrine_set_gradient (cairo_t *cr,
alpha_value *= 0.8;
}
- if (gradients)
+ if (mrn_gradient.has_gradient_colors)
+ {
+ cairo_pattern_t *pat;
+ MurrineRGB shade1, shade2, shade3, shade4;
+
+ murrine_shade (&mrn_gradient.gradient_colors[0], mrn_gradient.gradient_shades[0], &shade1);
+ murrine_shade (&mrn_gradient.gradient_colors[1], mrn_gradient.gradient_shades[1], &shade2);
+ murrine_shade (&mrn_gradient.gradient_colors[2], mrn_gradient.gradient_shades[2], &shade3);
+ murrine_shade (&mrn_gradient.gradient_colors[3], mrn_gradient.gradient_shades[3], &shade4);
+
+ pat = cairo_pattern_create_linear (x, y, width+x, height+y);
+
+ murrine_pattern_add_color_stop_rgba (pat, 0.00, &shade1, alpha_value);
+ murrine_pattern_add_color_stop_rgba (pat, 0.49, &shade2, alpha_value);
+ murrine_pattern_add_color_stop_rgba (pat, 0.49, &shade3, alpha_value);
+ murrine_pattern_add_color_stop_rgba (pat, 1.00, &shade4, alpha_value);
+
+ cairo_set_source (cr, pat);
+ cairo_pattern_destroy (pat);
+ }
+ else if (gradients)
{
cairo_pattern_t *pat;
MurrineRGB shade1, shade2, shade3, shade4;
@@ -812,8 +839,23 @@ murrine_draw_border (cairo_t *cr,
int roundness, uint8 corners,
MurrineGradients mrn_gradient, double alpha)
{
- if (mrn_gradient.border_shades[0] != 1.0 ||
- mrn_gradient.border_shades[1] != 1.0) // improve
+ if (mrn_gradient.has_border_colors)
+ {
+ cairo_pattern_t *pat;
+ MurrineRGB shade1, shade2;
+
+ murrine_shade (&mrn_gradient.border_colors[0], mrn_gradient.border_shades[0], &shade1);
+ murrine_shade (&mrn_gradient.border_colors[1], mrn_gradient.border_shades[1], &shade2);
+
+ pat = cairo_pattern_create_linear (x, y, x, height+y);
+ murrine_pattern_add_color_stop_rgba (pat, 0.00, &shade1, alpha);
+ murrine_pattern_add_color_stop_rgba (pat, 1.00, &shade2, alpha);
+
+ cairo_set_source (cr, pat);
+ cairo_pattern_destroy (pat);
+ }
+ else if (mrn_gradient.border_shades[0] != 1.0 ||
+ mrn_gradient.border_shades[1] != 1.0) // improve
{
cairo_pattern_t *pat;
MurrineRGB shade1, shade2;
@@ -868,6 +910,68 @@ murrine_draw_shadow (cairo_t *cr,
}
void
+murrine_draw_trough (cairo_t *cr,
+ const MurrineRGB *color,
+ double x, double y, double width, double height,
+ int roundness, uint8 corners,
+ MurrineGradients mrn_gradient, double alpha,
+ boolean horizontal)
+{
+ if (mrn_gradient.trough_shades[0] != 1.0 ||
+ mrn_gradient.trough_shades[1] != 1.0) // improve
+ {
+ cairo_pattern_t *pat;
+ MurrineRGB shade1, shade2;
+
+ murrine_shade (color, mrn_gradient.trough_shades[0], &shade1);
+ murrine_shade (color, mrn_gradient.trough_shades[1], &shade2);
+
+ pat = cairo_pattern_create_linear (x, y, horizontal ? x : width+x, horizontal ? height+y : y);
+ murrine_pattern_add_color_stop_rgba (pat, 0.00, &shade1, alpha);
+ murrine_pattern_add_color_stop_rgba (pat, 1.00, &shade2, alpha);
+
+ cairo_set_source (cr, pat);
+ cairo_pattern_destroy (pat);
+ }
+ else
+ murrine_set_color_rgba (cr, color, alpha);
+
+ murrine_rounded_rectangle_closed (cr, x, y, width, height, roundness, corners);
+ cairo_fill (cr);
+}
+
+void
+murrine_draw_trough_border (cairo_t *cr,
+ const MurrineRGB *color,
+ double x, double y, double width, double height,
+ int roundness, uint8 corners,
+ MurrineGradients mrn_gradient, double alpha,
+ boolean horizontal)
+{
+ if (mrn_gradient.trough_shades[0] != 1.0 ||
+ mrn_gradient.trough_shades[1] != 1.0) // improve
+ {
+ cairo_pattern_t *pat;
+ MurrineRGB shade1, shade2;
+
+ murrine_shade (color, mrn_gradient.trough_shades[0], &shade1);
+ murrine_shade (color, mrn_gradient.trough_shades[1], &shade2);
+
+ pat = cairo_pattern_create_linear (x, y, horizontal ? x : width+x, horizontal ? height+y : y);
+ murrine_pattern_add_color_stop_rgba (pat, 0.00, &shade1, alpha);
+ murrine_pattern_add_color_stop_rgba (pat, 1.00, &shade2, alpha);
+
+ cairo_set_source (cr, pat);
+ cairo_pattern_destroy (pat);
+ }
+ else
+ murrine_set_color_rgba (cr, color, alpha);
+
+ murrine_rounded_rectangle (cr, x, y, width, height, roundness, corners);
+ cairo_stroke (cr);
+}
+
+void
rotate_mirror_translate (cairo_t *cr,
double radius, double x, double y,
boolean mirror_horizontally, boolean mirror_vertically)
@@ -969,23 +1073,23 @@ get_inverted_shade (double old)
MurrineGradients
get_inverted_border_shades (MurrineGradients mrn_gradient)
{
- MurrineGradients mrn_gradient_custom = mrn_gradient;
+ MurrineGradients mrn_gradient_new = mrn_gradient;
- mrn_gradient_custom.border_shades[0] = mrn_gradient.border_shades[1];
- mrn_gradient_custom.border_shades[1] = mrn_gradient.border_shades[0];
+ mrn_gradient_new.border_shades[0] = mrn_gradient.border_shades[1];
+ mrn_gradient_new.border_shades[1] = mrn_gradient.border_shades[0];
- return mrn_gradient_custom;
+ return mrn_gradient_new;
}
MurrineGradients
get_decreased_gradient_shades (MurrineGradients mrn_gradient, double factor)
{
- MurrineGradients mrn_gradient_custom = mrn_gradient;
+ MurrineGradients mrn_gradient_new = mrn_gradient;
- mrn_gradient_custom.gradient_shades[0] = get_decreased_shade (mrn_gradient.gradient_shades[0], factor);
- mrn_gradient_custom.gradient_shades[1] = get_decreased_shade (mrn_gradient.gradient_shades[1], factor);
- mrn_gradient_custom.gradient_shades[2] = get_decreased_shade (mrn_gradient.gradient_shades[2], factor);
- mrn_gradient_custom.gradient_shades[3] = get_decreased_shade (mrn_gradient.gradient_shades[3], factor);
+ mrn_gradient_new.gradient_shades[0] = get_decreased_shade (mrn_gradient.gradient_shades[0], factor);
+ mrn_gradient_new.gradient_shades[1] = get_decreased_shade (mrn_gradient.gradient_shades[1], factor);
+ mrn_gradient_new.gradient_shades[2] = get_decreased_shade (mrn_gradient.gradient_shades[2], factor);
+ mrn_gradient_new.gradient_shades[3] = get_decreased_shade (mrn_gradient.gradient_shades[3], factor);
- return mrn_gradient_custom;
+ return mrn_gradient_new;
}
diff --git a/src/cairo-support.h b/src/cairo-support.h
index 0490b12..7e78531 100644
--- a/src/cairo-support.h
+++ b/src/cairo-support.h
@@ -108,6 +108,20 @@ G_GNUC_INTERNAL void murrine_draw_shadow (cairo_t *cr,
int reliefstyle,
MurrineGradients mrn_gradient, double alpha);
+G_GNUC_INTERNAL void murrine_draw_trough (cairo_t *cr,
+ const MurrineRGB *color,
+ double x, double y, double width, double height,
+ int roundness, uint8 corners,
+ MurrineGradients mrn_gradient, double alpha,
+ boolean horizontal);
+
+G_GNUC_INTERNAL void murrine_draw_trough_border (cairo_t *cr,
+ const MurrineRGB *color,
+ double x, double y, double width, double height,
+ int roundness, uint8 corners,
+ MurrineGradients mrn_gradient, double alpha,
+ boolean horizontal);
+
G_GNUC_INTERNAL void murrine_draw_glaze (cairo_t *cr,
const MurrineRGB *fill,
double glow_shade,
diff --git a/src/murrine_draw.c b/src/murrine_draw.c
index 615f9f6..3227135 100644
--- a/src/murrine_draw.c
+++ b/src/murrine_draw.c
@@ -147,23 +147,26 @@ murrine_draw_button (cairo_t *cr,
int x, int y, int width, int height,
boolean horizontal)
{
- double xos = widget->xthickness > 2 ? 1 : 0;
- double yos = widget->ythickness > 2 ? 1 : 0;
- double glow_shade_custom = widget->glow_shade;
- double highlight_shade_custom = widget->highlight_shade;
- double lightborder_shade_custom = widget->lightborder_shade;
- MurrineRGB fill = colors->bg[widget->state_type];
+ int os = (widget->xthickness > 2 && widget->ythickness > 2) ? 1 : 0;
+ double glow_shade_new = widget->glow_shade;
+ double highlight_shade_new = widget->highlight_shade;
+ double lightborder_shade_new = widget->lightborder_shade;
+ MurrineGradients mrn_gradient_new = widget->mrn_gradient;
MurrineRGB border = colors->shade[!widget->disabled ? 6 : 5];
- MurrineGradients mrn_gradient_custom = widget->mrn_gradient;
+ MurrineRGB fill = colors->bg[widget->state_type];
+ if (mrn_gradient_new.has_gradient_colors)
+ murrine_mix_color (&mrn_gradient_new.gradient_colors[0],
+ &mrn_gradient_new.gradient_colors[3],
+ 0.5, &fill);
if (widget->disabled)
{
- mrn_gradient_custom = get_decreased_gradient_shades (widget->mrn_gradient, 3.0);
- mrn_gradient_custom.border_shades[0] = get_decreased_shade (widget->mrn_gradient.border_shades[0], 2.0);
- mrn_gradient_custom.border_shades[1] = get_decreased_shade (widget->mrn_gradient.border_shades[1], 2.0);
- glow_shade_custom = get_decreased_shade (widget->glow_shade, 2.0);
- highlight_shade_custom = get_decreased_shade (widget->highlight_shade, 2.0);
- lightborder_shade_custom = get_decreased_shade (widget->lightborder_shade, 2.0);
+ mrn_gradient_new = get_decreased_gradient_shades (widget->mrn_gradient, 3.0);
+ mrn_gradient_new.border_shades[0] = get_decreased_shade (widget->mrn_gradient.border_shades[0], 2.0);
+ mrn_gradient_new.border_shades[1] = get_decreased_shade (widget->mrn_gradient.border_shades[1], 2.0);
+ glow_shade_new = get_decreased_shade (widget->glow_shade, 2.0);
+ highlight_shade_new = get_decreased_shade (widget->highlight_shade, 2.0);
+ lightborder_shade_new = get_decreased_shade (widget->lightborder_shade, 2.0);
}
else
murrine_shade (&colors->shade[6], 0.95, &border);
@@ -173,6 +176,12 @@ murrine_draw_button (cairo_t *cr,
{
murrine_shade (&border, 0.8, &border);
murrine_mix_color (&fill, &colors->spot[1], 0.2, &fill);
+
+ if (mrn_gradient_new.has_border_colors)
+ {
+ murrine_shade (&mrn_gradient_new.border_colors[0], 0.8, &mrn_gradient_new.border_colors[0]);
+ murrine_shade (&mrn_gradient_new.border_colors[1], 0.8, &mrn_gradient_new.border_colors[1]);
+ }
}
if (!horizontal)
@@ -180,19 +189,19 @@ murrine_draw_button (cairo_t *cr,
cairo_translate (cr, x, y);
- if (!widget->active && !widget->disabled && widget->reliefstyle > 1 && xos >= 0.5 && yos >= 0.5)
+ if (!widget->active && !widget->disabled && widget->reliefstyle > 1 && os > 0)
{
murrine_draw_shadow (cr, &border,
- xos-0.5, yos-0.5, width-(xos*2)+1, height-(yos*2)+1,
+ os-0.5, os-0.5, width-(os*2)+1, height-(os*2)+1,
widget->roundness+1, widget->corners,
widget->reliefstyle,
- mrn_gradient_custom, 0.08);
+ mrn_gradient_new, 0.08);
}
- else if (widget->reliefstyle != 0 && xos >= 0.5 && yos >= 0.5)
+ else if (widget->reliefstyle != 0 && os > 0)
{
- mrn_gradient_custom = get_inverted_border_shades (mrn_gradient_custom);
- murrine_draw_inset (cr, &widget->parentbg, xos-0.5, yos-0.5,
- width-(xos*2)+1, height-(yos*2)+1,
+ mrn_gradient_new = get_inverted_border_shades (mrn_gradient_new);
+ murrine_draw_inset (cr, &widget->parentbg, os-0.5, os-0.5,
+ width-(os*2)+1, height-(os*2)+1,
widget->roundness+1, widget->corners);
}
@@ -200,13 +209,13 @@ murrine_draw_button (cairo_t *cr,
cairo_save (cr);
- murrine_rounded_rectangle_closed (cr, xos+1, yos+1, width-(xos*2)-2, height-(yos*2)-2, widget->roundness-1, widget->corners);
+ murrine_rounded_rectangle_closed (cr, os+1, os+1, width-(os*2)-2, height-(os*2)-2, widget->roundness-1, widget->corners);
cairo_clip_preserve (cr);
murrine_draw_glaze (cr, &fill,
- glow_shade_custom, highlight_shade_custom, !widget->active ? lightborder_shade_custom : 1.0,
- mrn_gradient_custom, widget,
- xos+1, yos+1, width-(xos*2)-2, height-(yos*2)-2,
+ glow_shade_new, highlight_shade_new, !widget->active ? lightborder_shade_new : 1.0,
+ mrn_gradient_new, widget,
+ os+1, os+1, width-(os*2)-2, height-(os*2)-2,
widget->roundness, widget->corners, horizontal);
cairo_restore (cr);
@@ -221,20 +230,20 @@ murrine_draw_button (cairo_t *cr,
cairo_save (cr);
- murrine_rounded_rectangle_closed (cr, xos+1, yos+1, width-(xos*2)-2, height-(yos*2)-2, widget->roundness-1,
+ murrine_rounded_rectangle_closed (cr, os+1, os+1, width-(os*2)-2, height-(os*2)-2, widget->roundness-1,
widget->corners & (MRN_CORNER_TOPLEFT | MRN_CORNER_TOPRIGHT | MRN_CORNER_BOTTOMLEFT));
cairo_clip (cr);
- cairo_rectangle (cr, xos+1, yos+1, width-(xos*2)-2, 3);
- pat = cairo_pattern_create_linear (xos+1, yos+1, xos+1, yos+4);
+ cairo_rectangle (cr, os+1, os+1, width-(os*2)-2, 3);
+ pat = cairo_pattern_create_linear (os+1, os+1, os+1, os+4);
murrine_pattern_add_color_stop_rgba (pat, 0.0, &shadow, 0.58);
murrine_pattern_add_color_stop_rgba (pat, 1.0, &shadow, 0.0);
cairo_set_source (cr, pat);
cairo_fill (cr);
cairo_pattern_destroy (pat);
- cairo_rectangle (cr, xos+1, yos+1, 3, height-(yos*2)-2);
- pat = cairo_pattern_create_linear (xos+1, yos+1, xos+4, yos+1);
+ cairo_rectangle (cr, os+1, os+1, 3, height-(os*2)-2);
+ pat = cairo_pattern_create_linear (os+1, os+1, os+4, os+1);
murrine_pattern_add_color_stop_rgba (pat, 0.0, &shadow, 0.58);
murrine_pattern_add_color_stop_rgba (pat, 1.0, &shadow, 0.0);
cairo_set_source (cr, pat);
@@ -245,9 +254,9 @@ murrine_draw_button (cairo_t *cr,
}
murrine_draw_border (cr, &border,
- xos+0.5, yos+0.5, width-(xos*2)-1, height-(yos*2)-1,
+ os+0.5, os+0.5, width-(os*2)-1, height-(os*2)-1,
widget->roundness, widget->corners,
- mrn_gradient_custom, 1.0);
+ mrn_gradient_new, 1.0);
}
static void
@@ -257,7 +266,7 @@ murrine_draw_entry (cairo_t *cr,
const FocusParameters *focus,
int x, int y, int width, int height)
{
- MurrineGradients mrn_gradient_custom = widget->mrn_gradient;
+ MurrineGradients mrn_gradient_new = widget->mrn_gradient;
const MurrineRGB *base = &colors->base[widget->state_type];
MurrineRGB border = colors->shade[widget->disabled ? 4 : 6];
int radius = CLAMP (widget->roundness, 0, 3);
@@ -298,13 +307,13 @@ murrine_draw_entry (cairo_t *cr,
cairo_stroke (cr);
}
- mrn_gradient_custom = get_inverted_border_shades (mrn_gradient_custom);
+ mrn_gradient_new = get_inverted_border_shades (mrn_gradient_new);
/* Draw border */
murrine_draw_border (cr, &border,
1, 1, width-3, height-3,
radius, widget->corners,
- mrn_gradient_custom, 1.0);
+ mrn_gradient_new, 1.0);
}
static void
@@ -381,6 +390,66 @@ murrine_draw_entry_progress (cairo_t *cr,
}
static void
+murrine_draw_spinbutton (cairo_t *cr,
+ const MurrineColors *colors,
+ const WidgetParameters *widget,
+ const SpinbuttonParameters *spinbutton,
+ int x, int y, int width, int height,
+ boolean horizontal)
+{
+ widget->style_functions->draw_button (cr, colors, widget, x, y, width, height, horizontal);
+
+ switch (spinbutton->style)
+ {
+ default:
+ case 0:
+ break;
+ case 1:
+ {
+ MurrineRGB line = colors->shade[!widget->disabled ? 6 : 5];
+ MurrineRGB highlight = colors->bg[widget->state_type];
+ double lightborder_shade_new = widget->lightborder_shade;
+ MurrineGradients mrn_gradient_new = widget->mrn_gradient;
+
+ if (widget->disabled)
+ {
+ mrn_gradient_new = get_decreased_gradient_shades (widget->mrn_gradient, 3.0);
+ lightborder_shade_new = get_decreased_shade (widget->lightborder_shade, 2.0);
+ mrn_gradient_new.border_shades[0] = get_decreased_shade (widget->mrn_gradient.border_shades[0], 2.0);
+ mrn_gradient_new.border_shades[1] = get_decreased_shade (widget->mrn_gradient.border_shades[1], 2.0);
+ }
+ else
+ murrine_shade (&colors->shade[6], 0.95, &line);
+
+ /* adjust line accordingly to buttons */
+ if (widget->mrn_gradient.has_border_colors)
+ murrine_mix_color (&mrn_gradient_new.border_colors[0], &mrn_gradient_new.border_colors[1], 0.5, &line);
+ else if (widget->mrn_gradient.has_gradient_colors)
+ murrine_mix_color (&line, &mrn_gradient_new.gradient_colors[2], 0.4, &line);
+ else
+ murrine_mix_color (&line, &colors->bg[widget->state_type], 0.4, &line);
+ murrine_shade (&line, (mrn_gradient_new.border_shades[0]+mrn_gradient_new.border_shades[1])/2.0, &line);
+
+ /* adjust highlight accordingly to buttons */
+ if (widget->mrn_gradient.has_gradient_colors)
+ murrine_shade (&mrn_gradient_new.gradient_colors[2], mrn_gradient_new.gradient_shades[2], &highlight);
+ murrine_shade (&highlight, lightborder_shade_new*mrn_gradient_new.gradient_shades[2], &highlight);
+
+ cairo_move_to (cr, x+3, y+height/2.0);
+ cairo_line_to (cr, width-2, y+height/2.0);
+ murrine_set_color_rgb (cr, &line);
+ cairo_stroke (cr);
+
+ cairo_move_to (cr, x+4, y+height/2.0+1);
+ cairo_line_to (cr, width-3, y+height/2.0+1);
+ murrine_set_color_rgba (cr, &highlight, 0.5);
+ cairo_stroke (cr);
+ break;
+ }
+ }
+}
+
+static void
murrine_draw_spinbutton_down (cairo_t *cr,
const MurrineColors *colors,
const WidgetParameters *widget,
@@ -544,25 +613,25 @@ static void
murrine_draw_progressbar_trough (cairo_t *cr,
const MurrineColors *colors,
const WidgetParameters *widget,
+ const ProgressBarParameters *progressbar,
int x, int y, int width, int height)
{
MurrineRGB border, fill;
int roundness = MIN (widget->roundness, MIN ((height-2.0)/2.0, (width-2.0)/2.0));
+ boolean horizontal = progressbar->orientation < 2;
murrine_shade (&colors->bg[GTK_STATE_ACTIVE], 1.0, &fill);
murrine_shade (&colors->bg[GTK_STATE_ACTIVE], get_contrast(0.82, widget->contrast), &border);
/* Create trough box */
- murrine_rounded_rectangle_closed (cr, x+1, y+1, width-2, height-2, roundness, widget->corners);
- murrine_set_color_rgb (cr, &fill);
- cairo_fill (cr);
+ murrine_draw_trough (cr, &fill, x+1, y+1, width-2, height-2, roundness-1, widget->corners, widget->mrn_gradient, 1.0, horizontal);
/* Draw border */
- murrine_rounded_rectangle (cr, x+0.5, y+0.5, width-1, height-1, roundness, widget->corners);
- murrine_set_color_rgb (cr, &border);
- cairo_stroke (cr);
+ murrine_draw_trough_border (cr, &border, x+0.5, y+0.5, width-1, height-1, roundness, widget->corners, widget->mrn_gradient, 1.0, horizontal);
- if (widget->mrn_gradient.gradients)
+ if (widget->mrn_gradient.gradients &&
+ widget->mrn_gradient.trough_shades[0] == 1.0 &&
+ widget->mrn_gradient.trough_shades[1] == 1.0)
{
cairo_pattern_t *pat;
MurrineRGB shadow;
@@ -717,6 +786,71 @@ murrine_draw_progressbar_fill (cairo_t *cr,
}
static void
+murrine_draw_combobox (cairo_t *cr,
+ MurrineColors colors,
+ WidgetParameters widget,
+ const ComboBoxParameters *combobox,
+ int x, int y, int w, int h, boolean horizontal)
+{
+ switch (combobox->style)
+ {
+ default:
+ case 0:
+ widget.style_functions->draw_button (cr, &colors, &widget, x, y, w, h, horizontal);
+ break;
+ case 1:
+ {
+ WidgetParameters params = widget;
+ MurrineColors colors_new = colors;
+ int box_w = combobox->box_w;
+ if (!(widget.xthickness > 2 && widget.ythickness > 2))
+ box_w -= 3;
+ int os = (widget.xthickness > 2 && widget.ythickness > 2) ? 1 : 0;
+ colors_new.bg[GTK_STATE_NORMAL] = colors.spot[1];
+ colors_new.bg[GTK_STATE_PRELIGHT] = colors.spot[0];
+
+ cairo_save (cr);
+ if (params.ltr)
+ {
+ params.corners = MRN_CORNER_TOPLEFT | MRN_CORNER_BOTTOMLEFT;
+ cairo_rectangle (cr, x, y, w-box_w, h);
+ cairo_clip (cr);
+ params.style_functions->draw_button (cr, &colors, ¶ms, x, y, w-box_w+1+os, h, horizontal);
+ }
+ else
+ {
+ params.corners = MRN_CORNER_TOPRIGHT | MRN_CORNER_BOTTOMRIGHT;
+ cairo_rectangle (cr, x+box_w, y, w-box_w, h);
+ cairo_clip (cr);
+ params.style_functions->draw_button (cr, &colors, ¶ms, x+box_w-1-os, y, w-box_w+1+os, h, horizontal);
+ }
+ cairo_restore (cr);
+
+ params.mrn_gradient.has_border_colors = FALSE;
+ params.mrn_gradient.has_gradient_colors = FALSE;
+
+ cairo_save (cr);
+ if (params.ltr)
+ {
+ params.corners = MRN_CORNER_TOPRIGHT | MRN_CORNER_BOTTOMRIGHT;
+ cairo_rectangle (cr, x+w-box_w, y, box_w, h);
+ cairo_clip (cr);
+ params.style_functions->draw_button (cr, &colors_new, ¶ms, x+w-(box_w+os), y, box_w+os, h, horizontal);
+ }
+ else
+ {
+ params.corners = MRN_CORNER_TOPLEFT | MRN_CORNER_BOTTOMLEFT;
+ cairo_rectangle (cr, x, y, box_w, h);
+ cairo_clip (cr);
+ params.style_functions->draw_button (cr, &colors_new, ¶ms, x, y, box_w+os, h, horizontal);
+ }
+ cairo_restore (cr);
+ break;
+ }
+ }
+}
+
+static void
murrine_draw_optionmenu (cairo_t *cr,
const MurrineColors *colors,
const WidgetParameters *widget,
@@ -1071,14 +1205,14 @@ murrine_draw_tab (cairo_t *cr,
if (widget->active)
{
MurrineRGB shade1, shade2, shade3, shade4, highlight;
- MurrineGradients mrn_gradient_custom = get_decreased_gradient_shades (widget->mrn_gradient, 3.0);
- double highlight_shade_custom = get_decreased_shade (widget->highlight_shade, 2.0);
- double lightborder_shade_custom = get_decreased_shade (widget->lightborder_shade, 2.0);
+ MurrineGradients mrn_gradient_new = get_decreased_gradient_shades (widget->mrn_gradient, 3.0);
+ double highlight_shade_new = get_decreased_shade (widget->highlight_shade, 2.0);
+ double lightborder_shade_new = get_decreased_shade (widget->lightborder_shade, 2.0);
- murrine_shade (fill, mrn_gradient_custom.gradient_shades[0]*highlight_shade_custom, &shade1);
- murrine_shade (fill, mrn_gradient_custom.gradient_shades[1]*highlight_shade_custom, &shade2);
- murrine_shade (fill, mrn_gradient_custom.gradient_shades[2], &shade3);
- murrine_shade (fill, mrn_gradient_custom.gradient_shades[3], &shade4);
+ murrine_shade (fill, mrn_gradient_new.gradient_shades[0]*highlight_shade_new, &shade1);
+ murrine_shade (fill, mrn_gradient_new.gradient_shades[1]*highlight_shade_new, &shade2);
+ murrine_shade (fill, mrn_gradient_new.gradient_shades[2], &shade3);
+ murrine_shade (fill, mrn_gradient_new.gradient_shades[3], &shade4);
switch (tab->gap_side)
{
@@ -1107,11 +1241,11 @@ murrine_draw_tab (cairo_t *cr,
cairo_pattern_destroy (pat);
/* Draw lightborder */
- murrine_shade (fill, lightborder_shade_custom*highlight_shade_custom, &highlight);
- murrine_shade (&highlight, mrn_gradient_custom.gradient_shades[0]*highlight_shade_custom, &shade1);
- murrine_shade (&highlight, mrn_gradient_custom.gradient_shades[1]*highlight_shade_custom, &shade2);
- murrine_shade (&highlight, mrn_gradient_custom.gradient_shades[2], &shade3);
- murrine_shade (&highlight, mrn_gradient_custom.gradient_shades[3], &shade4);
+ murrine_shade (fill, lightborder_shade_new*highlight_shade_new, &highlight);
+ murrine_shade (&highlight, mrn_gradient_new.gradient_shades[0]*highlight_shade_new, &shade1);
+ murrine_shade (&highlight, mrn_gradient_new.gradient_shades[1]*highlight_shade_new, &shade2);
+ murrine_shade (&highlight, mrn_gradient_new.gradient_shades[2], &shade3);
+ murrine_shade (&highlight, mrn_gradient_new.gradient_shades[3], &shade4);
switch (tab->gap_side)
{
@@ -1142,12 +1276,12 @@ murrine_draw_tab (cairo_t *cr,
else
{
MurrineRGB shade1, shade2, shade3, shade4, highlight;
- MurrineGradients mrn_gradient_custom = get_decreased_gradient_shades (widget->mrn_gradient, 3.0);
- double highlight_shade_custom = get_decreased_shade (widget->highlight_shade, 2.0);
+ MurrineGradients mrn_gradient_new = get_decreased_gradient_shades (widget->mrn_gradient, 3.0);
+ double highlight_shade_new = get_decreased_shade (widget->highlight_shade, 2.0);
- murrine_shade (fill, mrn_gradient_custom.gradient_shades[0]*highlight_shade_custom, &shade1);
- murrine_shade (fill, mrn_gradient_custom.gradient_shades[1]*highlight_shade_custom, &shade2);
- murrine_shade (fill, mrn_gradient_custom.gradient_shades[2], &shade3);
+ murrine_shade (fill, mrn_gradient_new.gradient_shades[0]*highlight_shade_new, &shade1);
+ murrine_shade (fill, mrn_gradient_new.gradient_shades[1]*highlight_shade_new, &shade2);
+ murrine_shade (fill, mrn_gradient_new.gradient_shades[2], &shade3);
murrine_shade (fill, 1.0, &shade4);
/* Draw shade */
@@ -1178,10 +1312,10 @@ murrine_draw_tab (cairo_t *cr,
cairo_pattern_destroy (pat);
/* Draw lightborder */
- murrine_shade (fill, widget->lightborder_shade*highlight_shade_custom, &highlight);
- murrine_shade (&highlight, mrn_gradient_custom.gradient_shades[0]*highlight_shade_custom, &shade1);
- murrine_shade (&highlight, mrn_gradient_custom.gradient_shades[1]*highlight_shade_custom, &shade2);
- murrine_shade (&highlight, mrn_gradient_custom.gradient_shades[2], &shade3);
+ murrine_shade (fill, widget->lightborder_shade*highlight_shade_new, &highlight);
+ murrine_shade (&highlight, mrn_gradient_new.gradient_shades[0]*highlight_shade_new, &shade1);
+ murrine_shade (&highlight, mrn_gradient_new.gradient_shades[1]*highlight_shade_new, &shade2);
+ murrine_shade (&highlight, mrn_gradient_new.gradient_shades[2], &shade3);
murrine_shade (fill, 1.04, &shade4); /* this value should change as draw_frame */
switch (tab->gap_side)
@@ -1280,9 +1414,11 @@ murrine_draw_list_view_header (cairo_t *cr,
int x, int y, int width, int height)
{
const MurrineRGB *fill = &colors->bg[widget->state_type];
- const MurrineRGB *border = &colors->shade[3];
+ MurrineRGB border = colors->shade[3];
+ MurrineRGB grip = colors->shade[3];
MurrineRGB highlight;
- murrine_shade (border, 1.3, &highlight);
+
+ murrine_shade (&border, 1.3, &highlight);
cairo_translate (cr, x, y);
@@ -1294,8 +1430,6 @@ murrine_draw_list_view_header (cairo_t *cr,
else
cairo_move_to (cr, 0.0, 0.5);
-
-
/* Effects */
switch (header->style)
{
@@ -1311,9 +1445,15 @@ murrine_draw_list_view_header (cairo_t *cr,
widget->glow_shade, widget->highlight_shade, widget->glazestyle != 0 ? widget->lightborder_shade : 1.0,
widget->mrn_gradient, widget, 0, 0, width, height-1,
widget->roundness, widget->corners, TRUE);
+
+ if (widget->mrn_gradient.has_border_colors)
+ {
+ border = grip = widget->mrn_gradient.border_colors[1];
+ grip = widget->mrn_gradient.border_colors[0];
+ }
break;
case 2:
- border = (MurrineRGB*)&colors->shade[4];
+ border = colors->shade[4];
MurrineRGB shadow_header;
murrine_shade (fill, 0.925, &shadow_header);
@@ -1335,8 +1475,10 @@ murrine_draw_list_view_header (cairo_t *cr,
cairo_fill (cr);
break;
}
+ murrine_shade (&border, widget->mrn_gradient.border_shades[1], &border);
+
/* Draw bottom border */
- murrine_set_color_rgb (cr, border);
+ murrine_set_color_rgb (cr, &border);
cairo_move_to (cr, 0.0, height-0.5);
cairo_line_to (cr, width, height-0.5);
cairo_stroke (cr);
@@ -1345,13 +1487,15 @@ murrine_draw_list_view_header (cairo_t *cr,
if ((widget->ltr && !(header->order & MRN_ORDER_LAST)) ||
(!widget->ltr && !(header->order & MRN_ORDER_FIRST)) || header->resizable)
{
+ murrine_shade (&grip, widget->mrn_gradient.border_shades[0], &grip);
+
if (header->style == 1 && widget->glazestyle > 0)
{
cairo_translate (cr, width-0.5, 0);
- murrine_set_color_rgb (cr, border);
+ murrine_set_color_rgb (cr, &grip);
cairo_move_to (cr, 0, 0);
- cairo_line_to (cr, 0, height);
+ cairo_line_to (cr, 0, height-1);
cairo_stroke (cr);
}
else
@@ -1467,20 +1611,19 @@ murrine_draw_scrollbar_trough (cairo_t *cr,
}
/* Draw fill */
- murrine_set_color_rgb (cr, &fill);
- clearlooks_rounded_rectangle (cr, 0, 0, width, height, widget->roundness, widget->corners);
- cairo_fill (cr);
+ murrine_draw_trough (cr, &fill, 0, 0, width, height, widget->roundness, widget->corners, widget->mrn_gradient, 1.0, FALSE);
/* Draw border */
- murrine_set_color_rgb (cr, &border);
if (!scrollbar->within_bevel)
- murrine_rounded_rectangle (cr, 0.5, 0.5, width-1, height-1, widget->roundness, widget->corners);
+ murrine_draw_trough_border (cr, &border, 0.5, 0.5, width-1, height-1, widget->roundness, widget->corners, widget->mrn_gradient, 1.0, FALSE);
else
{
+ murrine_shade (&border, widget->mrn_gradient.trough_shades[0], &border);
+ murrine_set_color_rgb (cr, &border);
cairo_move_to (cr, 0.5, 0);
cairo_line_to (cr, 0.5, height);
+ cairo_stroke (cr);
}
- cairo_stroke (cr);
}
static void
@@ -1490,16 +1633,16 @@ murrine_draw_scrollbar_stepper (cairo_t *cr,
const ScrollBarParameters *scrollbar,
int x, int y, int width, int height)
{
- MurrineGradients mrn_gradient_custom = widget->mrn_gradient;
- double border_stop_mid = ((mrn_gradient_custom.border_shades[0])+
- (mrn_gradient_custom.border_shades[1]))/2.0;
+ MurrineGradients mrn_gradient_new = widget->mrn_gradient;
+ double border_stop_mid = ((mrn_gradient_new.border_shades[0])+
+ (mrn_gradient_new.border_shades[1]))/2.0;
const MurrineRGB *fill = &colors->bg[widget->state_type];
MurrineRGB border;
murrine_shade (&colors->shade[6], 0.95, &border);
- mrn_gradient_custom.border_shades[0] = border_stop_mid;
- mrn_gradient_custom.border_shades[1] = border_stop_mid;
+ mrn_gradient_new.border_shades[0] = border_stop_mid;
+ mrn_gradient_new.border_shades[1] = border_stop_mid;
if (!scrollbar->horizontal)
murrine_exchange_axis (cr, &x, &y, &width, &height);
@@ -1516,7 +1659,7 @@ murrine_draw_scrollbar_stepper (cairo_t *cr,
murrine_draw_glaze (cr, fill,
widget->glow_shade, widget->highlight_shade, widget->lightborder_shade,
- mrn_gradient_custom, widget, 1, 1, width-2, height-2,
+ mrn_gradient_new, widget, 1, 1, width-2, height-2,
widget->roundness, widget->corners, TRUE);
cairo_restore (cr);
@@ -1524,7 +1667,7 @@ murrine_draw_scrollbar_stepper (cairo_t *cr,
murrine_draw_border (cr, &border,
0.5, 0.5, width-1, height-1,
widget->roundness, widget->corners,
- mrn_gradient_custom, 1.0);
+ mrn_gradient_new, 1.0);
}
static void
@@ -1534,13 +1677,14 @@ murrine_draw_scrollbar_slider (cairo_t *cr,
const ScrollBarParameters *scrollbar,
int x, int y, int width, int height)
{
- MurrineGradients mrn_gradient_custom = widget->mrn_gradient;
- double border_stop_mid = ((mrn_gradient_custom.border_shades[0])+
- (mrn_gradient_custom.border_shades[1]))/2.0;
+ MurrineGradients mrn_gradient_new = widget->mrn_gradient;
+ double border_stop_mid = ((mrn_gradient_new.border_shades[0])+
+ (mrn_gradient_new.border_shades[1]))/2.0;
MurrineRGB fill = scrollbar->has_color ? scrollbar->color : colors->bg[0];
MurrineRGB border;
+ uint8 corners = widget->corners;
- if (scrollbar->stepperstyle < 1)
+ if (scrollbar->stepperstyle != 1)
{
if (scrollbar->junction & MRN_JUNCTION_BEGIN)
{
@@ -1564,10 +1708,28 @@ murrine_draw_scrollbar_slider (cairo_t *cr,
}
}
+ if (scrollbar->stepperstyle == 2)
+ {
+ if (scrollbar->junction & MRN_JUNCTION_BEGIN)
+ {
+ if (scrollbar->horizontal)
+ corners ^= MRN_CORNER_TOPLEFT | MRN_CORNER_BOTTOMLEFT;
+ else
+ corners ^= MRN_CORNER_TOPLEFT | MRN_CORNER_BOTTOMLEFT;
+ }
+ if (scrollbar->junction & MRN_JUNCTION_END)
+ {
+ if (scrollbar->horizontal)
+ corners ^= MRN_CORNER_TOPRIGHT | MRN_CORNER_BOTTOMRIGHT;
+ else
+ corners ^= MRN_CORNER_TOPRIGHT | MRN_CORNER_BOTTOMRIGHT;
+ }
+ }
+
murrine_shade (&colors->shade[6], 0.95, &border);
- mrn_gradient_custom.border_shades[0] = border_stop_mid;
- mrn_gradient_custom.border_shades[1] = border_stop_mid;
+ mrn_gradient_new.border_shades[0] = border_stop_mid;
+ mrn_gradient_new.border_shades[1] = border_stop_mid;
if (widget->prelight)
murrine_shade (&fill, 1.04, &fill);
@@ -1586,13 +1748,13 @@ murrine_draw_scrollbar_slider (cairo_t *cr,
cairo_save (cr);
- murrine_rounded_rectangle_closed (cr, 1, 1, width-2, height-2, widget->roundness-1, widget->corners);
+ murrine_rounded_rectangle_closed (cr, 1, 1, width-2, height-2, widget->roundness-1, corners);
cairo_clip_preserve (cr);
murrine_draw_glaze (cr, &fill,
widget->glow_shade, widget->highlight_shade, widget->lightborder_shade,
- mrn_gradient_custom, widget, 1, 1, width-2, height-2,
- widget->roundness, widget->corners, TRUE);
+ mrn_gradient_new, widget, 1, 1, width-2, height-2,
+ widget->roundness, corners, TRUE);
/* Draw the options */
MurrineRGB style;
@@ -1679,8 +1841,8 @@ murrine_draw_scrollbar_slider (cairo_t *cr,
murrine_draw_border (cr, &border,
0.5, 0.5, width-1, height-1,
- widget->roundness, widget->corners,
- mrn_gradient_custom, 1.0);
+ widget->roundness, corners,
+ mrn_gradient_new, 1.0);
}
static void
@@ -1750,8 +1912,6 @@ murrine_draw_menu_frame (cairo_t *cr,
cairo_rectangle (cr, 0.5, 0.5, width-1, height-1);
cairo_stroke (cr);
- /* Broken with RTL */
-
if (menustyle == 1)
{
MurrineRGB *fill = (MurrineRGB*)&colors->spot[1];
@@ -1774,9 +1934,9 @@ murrine_draw_tooltip (cairo_t *cr,
int x, int y, int width, int height)
{
MurrineRGB border;
- MurrineGradients mrn_gradient_custom = get_decreased_gradient_shades (widget->mrn_gradient, 2.0);
- double glow_shade_custom = get_decreased_shade (widget->glow_shade, 2.0);
- double highlight_shade_custom = get_decreased_shade (widget->highlight_shade, 2.0);
+ MurrineGradients mrn_gradient_new = get_decreased_gradient_shades (widget->mrn_gradient, 2.0);
+ double glow_shade_new = get_decreased_shade (widget->glow_shade, 2.0);
+ double highlight_shade_new = get_decreased_shade (widget->highlight_shade, 2.0);
murrine_shade (&colors->bg[widget->state_type], get_contrast(0.6, widget->contrast), &border);
@@ -1787,14 +1947,14 @@ murrine_draw_tooltip (cairo_t *cr,
cairo_rectangle (cr, 1, 1, width-2, height-2);
murrine_draw_glaze (cr, &colors->bg[widget->state_type],
- glow_shade_custom, highlight_shade_custom, widget->lightborder_shade,
- mrn_gradient_custom, widget, 1, 1, width-2, height-2,
+ glow_shade_new, highlight_shade_new, widget->lightborder_shade,
+ mrn_gradient_new, widget, 1, 1, width-2, height-2,
widget->roundness, widget->corners, TRUE);
murrine_draw_border (cr, &border,
0.5, 0.5, width-1, height-1,
widget->roundness, widget->corners,
- mrn_gradient_custom, 1.0);
+ mrn_gradient_new, 1.0);
cairo_restore (cr);
}
@@ -2031,9 +2191,9 @@ murrine_draw_radiobutton (cairo_t *cr,
gboolean inconsistent = FALSE;
gboolean draw_bullet = (checkbox->shadow_type == GTK_SHADOW_IN);
int roundness = 5;
- double highlight_shade_custom = widget->highlight_shade;
- double lightborder_shade_custom = widget->lightborder_shade;
- MurrineGradients mrn_gradient_custom = widget->mrn_gradient;
+ double highlight_shade_new = widget->highlight_shade;
+ double lightborder_shade_new = widget->lightborder_shade;
+ MurrineGradients mrn_gradient_new = widget->mrn_gradient;
inconsistent = (checkbox->shadow_type == GTK_SHADOW_ETCHED_IN);
draw_bullet |= inconsistent;
@@ -2046,11 +2206,11 @@ murrine_draw_radiobutton (cairo_t *cr,
dot = &colors->shade[3];
bg = &colors->bg[0];
- mrn_gradient_custom = get_decreased_gradient_shades (widget->mrn_gradient, 3.0);
- mrn_gradient_custom.border_shades[0] = get_decreased_shade (widget->mrn_gradient.border_shades[0], 3.0);
- mrn_gradient_custom.border_shades[1] = get_decreased_shade (widget->mrn_gradient.border_shades[1], 3.0);
- highlight_shade_custom = get_decreased_shade (widget->highlight_shade, 2.0);
- lightborder_shade_custom = get_decreased_shade (widget->lightborder_shade, 2.0);
+ mrn_gradient_new = get_decreased_gradient_shades (widget->mrn_gradient, 3.0);
+ mrn_gradient_new.border_shades[0] = get_decreased_shade (widget->mrn_gradient.border_shades[0], 3.0);
+ mrn_gradient_new.border_shades[1] = get_decreased_shade (widget->mrn_gradient.border_shades[1], 3.0);
+ highlight_shade_new = get_decreased_shade (widget->highlight_shade, 2.0);
+ lightborder_shade_new = get_decreased_shade (widget->lightborder_shade, 2.0);
}
else
{
@@ -2076,7 +2236,7 @@ murrine_draw_radiobutton (cairo_t *cr,
0.5, 0.5, width-1, height-1,
roundness+1, widget->corners,
widget->reliefstyle,
- mrn_gradient_custom, 0.08);
+ mrn_gradient_new, 0.08);
}
else if (widget->reliefstyle != 0)
murrine_draw_inset (cr, &widget->parentbg, 0.5, 0.5, width-1, height-1, roundness+1, widget->corners);
@@ -2090,8 +2250,8 @@ murrine_draw_radiobutton (cairo_t *cr,
if (draw_bullet)
{
murrine_draw_glaze (cr, bg,
- widget->glow_shade, highlight_shade_custom, lightborder_shade_custom,
- mrn_gradient_custom, widget, 2, 2, width-4, height-4,
+ widget->glow_shade, highlight_shade_new, lightborder_shade_new,
+ mrn_gradient_new, widget, 2, 2, width-4, height-4,
roundness, widget->corners, TRUE);
}
else
@@ -2104,18 +2264,21 @@ murrine_draw_radiobutton (cairo_t *cr,
if (checkbox->in_menu || checkbox->in_cell)
{
- mrn_gradient_custom.border_shades[0] = 1.0;
- mrn_gradient_custom.border_shades[1] = 1.0;
+ mrn_gradient_new.border_shades[0] = 1.0;
+ mrn_gradient_new.border_shades[1] = 1.0;
+ if (!draw_bullet)
+ mrn_gradient_new.has_border_colors = FALSE;
}
else if (!draw_bullet)
{
- mrn_gradient_custom = get_inverted_border_shades (mrn_gradient_custom);
+ mrn_gradient_new = get_inverted_border_shades (mrn_gradient_new);
+ mrn_gradient_new.has_border_colors = FALSE;
}
murrine_draw_border (cr, border,
1.5, 1.5, width-3, height-3,
roundness, widget->corners,
- mrn_gradient_custom, 1.0);
+ mrn_gradient_new, 1.0);
if (draw_bullet)
{
@@ -2154,9 +2317,9 @@ murrine_draw_checkbox (cairo_t *cr,
gboolean inconsistent = FALSE;
gboolean draw_bullet = (checkbox->shadow_type == GTK_SHADOW_IN);
int roundness = CLAMP (widget->roundness, 0, 2);
- double highlight_shade_custom = widget->highlight_shade;
- double lightborder_shade_custom = widget->lightborder_shade;
- MurrineGradients mrn_gradient_custom = widget->mrn_gradient;
+ double highlight_shade_new = widget->highlight_shade;
+ double lightborder_shade_new = widget->lightborder_shade;
+ MurrineGradients mrn_gradient_new = widget->mrn_gradient;
inconsistent = (checkbox->shadow_type == GTK_SHADOW_ETCHED_IN);
draw_bullet |= inconsistent;
@@ -2169,11 +2332,11 @@ murrine_draw_checkbox (cairo_t *cr,
dot = &colors->shade[3];
bg = &colors->bg[0];
- mrn_gradient_custom = get_decreased_gradient_shades (widget->mrn_gradient, 3.0);
- mrn_gradient_custom.border_shades[0] = get_decreased_shade (widget->mrn_gradient.border_shades[0], 3.0);
- mrn_gradient_custom.border_shades[1] = get_decreased_shade (widget->mrn_gradient.border_shades[1], 3.0);
- highlight_shade_custom = get_decreased_shade (widget->highlight_shade, 2.0);
- lightborder_shade_custom = get_decreased_shade (widget->lightborder_shade, 2.0);
+ mrn_gradient_new = get_decreased_gradient_shades (widget->mrn_gradient, 3.0);
+ mrn_gradient_new.border_shades[0] = get_decreased_shade (widget->mrn_gradient.border_shades[0], 3.0);
+ mrn_gradient_new.border_shades[1] = get_decreased_shade (widget->mrn_gradient.border_shades[1], 3.0);
+ highlight_shade_new = get_decreased_shade (widget->highlight_shade, 2.0);
+ lightborder_shade_new = get_decreased_shade (widget->lightborder_shade, 2.0);
}
else
{
@@ -2199,7 +2362,7 @@ murrine_draw_checkbox (cairo_t *cr,
0.5, 0.5, width-1, height-1,
roundness+1, widget->corners,
widget->reliefstyle,
- mrn_gradient_custom, 0.08);
+ mrn_gradient_new, 0.08);
}
else if (widget->reliefstyle != 0)
murrine_draw_inset (cr, &widget->parentbg, 0.5, 0.5, width-1, height-1, roundness+1, widget->corners);
@@ -2213,8 +2376,8 @@ murrine_draw_checkbox (cairo_t *cr,
if (draw_bullet)
{
murrine_draw_glaze (cr, bg,
- widget->glow_shade, highlight_shade_custom, lightborder_shade_custom,
- mrn_gradient_custom, widget, 2, 2, width-4, height-4,
+ widget->glow_shade, highlight_shade_new, lightborder_shade_new,
+ mrn_gradient_new, widget, 2, 2, width-4, height-4,
roundness, widget->corners, TRUE);
}
else
@@ -2227,18 +2390,21 @@ murrine_draw_checkbox (cairo_t *cr,
if (checkbox->in_menu || checkbox->in_cell)
{
- mrn_gradient_custom.border_shades[0] = 1.0;
- mrn_gradient_custom.border_shades[1] = 1.0;
+ mrn_gradient_new.border_shades[0] = 1.0;
+ mrn_gradient_new.border_shades[1] = 1.0;
+ if (!draw_bullet)
+ mrn_gradient_new.has_border_colors = FALSE;
}
else if (!draw_bullet)
{
- mrn_gradient_custom = get_inverted_border_shades (mrn_gradient_custom);
+ mrn_gradient_new = get_inverted_border_shades (mrn_gradient_new);
+ mrn_gradient_new.has_border_colors = FALSE;
}
murrine_draw_border (cr, border,
1.5, 1.5, width-3, height-3,
roundness, widget->corners,
- mrn_gradient_custom, 1.0);
+ mrn_gradient_new, 1.0);
if (draw_bullet)
{
@@ -2454,12 +2620,14 @@ murrine_register_style_murrine (MurrineStyleFunctions *functions)
g_assert (functions);
functions->draw_button = murrine_draw_button;
+ functions->draw_combobox = murrine_draw_combobox;
functions->draw_scale_trough = murrine_draw_scale_trough;
functions->draw_progressbar_trough = murrine_draw_progressbar_trough;
functions->draw_progressbar_fill = murrine_draw_progressbar_fill;
functions->draw_entry = murrine_draw_entry;
functions->draw_entry_progress = murrine_draw_entry_progress;
functions->draw_slider_handle = murrine_draw_slider_handle;
+ functions->draw_spinbutton = murrine_draw_spinbutton;
functions->draw_spinbutton_down = murrine_draw_spinbutton_down;
functions->draw_optionmenu = murrine_draw_optionmenu;
functions->draw_combo_separator = murrine_draw_combo_separator;
diff --git a/src/murrine_draw_rgba.c b/src/murrine_draw_rgba.c
index b0f9d36..8bfff13 100644
--- a/src/murrine_draw_rgba.c
+++ b/src/murrine_draw_rgba.c
@@ -147,23 +147,26 @@ murrine_rgba_draw_button (cairo_t *cr,
int x, int y, int width, int height,
boolean horizontal)
{
- double xos = widget->xthickness > 2 ? 1 : 0;
- double yos = widget->ythickness > 2 ? 1 : 0;
- double glow_shade_custom = widget->glow_shade;
- double highlight_shade_custom = widget->highlight_shade;
- double lightborder_shade_custom = widget->lightborder_shade;
- MurrineRGB fill = colors->bg[widget->state_type];
+ double os = (widget->xthickness > 2 && widget->ythickness > 2) ? 1.0 : 0.0;
+ double glow_shade_new = widget->glow_shade;
+ double highlight_shade_new = widget->highlight_shade;
+ double lightborder_shade_new = widget->lightborder_shade;
+ MurrineGradients mrn_gradient_new = widget->mrn_gradient;
MurrineRGB border = colors->shade[!widget->disabled ? 8 : 6];
- MurrineGradients mrn_gradient_custom = widget->mrn_gradient;
+ MurrineRGB fill = colors->bg[widget->state_type];
+ if (mrn_gradient_new.has_gradient_colors)
+ murrine_mix_color (&mrn_gradient_new.gradient_colors[0],
+ &mrn_gradient_new.gradient_colors[3],
+ 0.5, &fill);
if (widget->disabled)
{
- mrn_gradient_custom = get_decreased_gradient_shades (widget->mrn_gradient, 3.0);
- mrn_gradient_custom.border_shades[0] = get_decreased_shade (widget->mrn_gradient.border_shades[0], 2.0);
- mrn_gradient_custom.border_shades[1] = get_decreased_shade (widget->mrn_gradient.border_shades[1], 2.0);
- glow_shade_custom = get_decreased_shade (widget->glow_shade, 2.0);
- highlight_shade_custom = get_decreased_shade (widget->highlight_shade, 2.0);
- lightborder_shade_custom = get_decreased_shade (widget->lightborder_shade, 2.0);
+ mrn_gradient_new = get_decreased_gradient_shades (widget->mrn_gradient, 3.0);
+ mrn_gradient_new.border_shades[0] = get_decreased_shade (widget->mrn_gradient.border_shades[0], 2.0);
+ mrn_gradient_new.border_shades[1] = get_decreased_shade (widget->mrn_gradient.border_shades[1], 2.0);
+ glow_shade_new = get_decreased_shade (widget->glow_shade, 2.0);
+ highlight_shade_new = get_decreased_shade (widget->highlight_shade, 2.0);
+ lightborder_shade_new = get_decreased_shade (widget->lightborder_shade, 2.0);
}
else
murrine_shade (&colors->shade[8], 0.95, &border);
@@ -173,6 +176,12 @@ murrine_rgba_draw_button (cairo_t *cr,
{
murrine_shade (&border, 0.8, &border);
murrine_mix_color (&fill, &colors->spot[1], 0.2, &fill);
+
+ if (mrn_gradient_new.has_border_colors)
+ {
+ murrine_shade (&mrn_gradient_new.border_colors[0], 0.8, &mrn_gradient_new.border_colors[0]);
+ murrine_shade (&mrn_gradient_new.border_colors[1], 0.8, &mrn_gradient_new.border_colors[1]);
+ }
}
if (!horizontal)
@@ -180,19 +189,19 @@ murrine_rgba_draw_button (cairo_t *cr,
cairo_translate (cr, x, y);
- if (!widget->active && !widget->disabled && widget->reliefstyle > 1 && xos >= 0.5 && yos >= 0.5)
+ if (!widget->active && !widget->disabled && widget->reliefstyle > 1 && os > 0.5)
{
murrine_draw_shadow (cr, &border,
- xos-0.5, yos-0.5, width-(xos*2)+1, height-(yos*2)+1,
+ os-0.5, os-0.5, width-(os*2)+1, height-(os*2)+1,
widget->roundness+1, widget->corners,
widget->reliefstyle,
- mrn_gradient_custom, 0.08);
+ mrn_gradient_new, 0.08);
}
- else if (widget->reliefstyle != 0 && xos >= 0.5 && yos >= 0.5)
+ else if (widget->reliefstyle != 0 && os > 0.5)
{
- mrn_gradient_custom = get_inverted_border_shades (mrn_gradient_custom);
- murrine_draw_inset (cr, &widget->parentbg, xos-0.5, yos-0.5,
- width-(xos*2)+1, height-(yos*2)+1,
+ mrn_gradient_new = get_inverted_border_shades (mrn_gradient_new);
+ murrine_draw_inset (cr, &widget->parentbg, os-0.5, os-0.5,
+ width-(os*2)+1, height-(os*2)+1,
widget->roundness+1, widget->corners);
}
@@ -203,12 +212,13 @@ murrine_rgba_draw_button (cairo_t *cr,
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
- murrine_rounded_rectangle_closed (cr, xos+1, yos+1, width-(xos*2)-2, height-(yos*2)-2, widget->roundness-1, widget->corners);
+ murrine_rounded_rectangle_closed (cr, os+1, os+1, width-(os*2)-2, height-(os*2)-2, widget->roundness-1, widget->corners);
cairo_clip_preserve (cr);
murrine_draw_glaze (cr, &fill,
- glow_shade_custom, highlight_shade_custom, !widget->active ? lightborder_shade_custom : 1.0,
- mrn_gradient_custom, widget, xos+1, yos+1, width-(xos*2)-2, height-(yos*2)-2,
+ glow_shade_new, highlight_shade_new, !widget->active ? lightborder_shade_new : 1.0,
+ mrn_gradient_new, widget,
+ os+1, os+1, width-(os*2)-2, height-(os*2)-2,
widget->roundness, widget->corners, horizontal);
cairo_restore (cr);
@@ -223,20 +233,20 @@ murrine_rgba_draw_button (cairo_t *cr,
cairo_save (cr);
- murrine_rounded_rectangle_closed (cr, xos+1, yos+1, width-(xos*2)-2, height-(yos*2)-2, widget->roundness-1,
+ murrine_rounded_rectangle_closed (cr, os+1, os+1, width-(os*2)-2, height-(os*2)-2, widget->roundness-1,
widget->corners & (MRN_CORNER_TOPLEFT | MRN_CORNER_TOPRIGHT | MRN_CORNER_BOTTOMLEFT));
cairo_clip (cr);
- cairo_rectangle (cr, xos+1, yos+1, width-(xos*2)-2, 3);
- pat = cairo_pattern_create_linear (xos+1, yos+1, xos+1, yos+4);
+ cairo_rectangle (cr, os+1, os+1, width-(os*2)-2, 3);
+ pat = cairo_pattern_create_linear (os+1, os+1, os+1, os+4);
murrine_pattern_add_color_stop_rgba (pat, 0.0, &shadow, 0.58);
murrine_pattern_add_color_stop_rgba (pat, 1.0, &shadow, 0.0);
cairo_set_source (cr, pat);
cairo_fill (cr);
cairo_pattern_destroy (pat);
- cairo_rectangle (cr, xos+1, yos+1, 3, height-(yos*2)-2);
- pat = cairo_pattern_create_linear (xos+1, yos+1, xos+4, yos+1);
+ cairo_rectangle (cr, os+1, os+1, 3, height-(os*2)-2);
+ pat = cairo_pattern_create_linear (os+1, os+1, os+4, os+1);
murrine_pattern_add_color_stop_rgba (pat, 0.0, &shadow, 0.58);
murrine_pattern_add_color_stop_rgba (pat, 1.0, &shadow, 0.0);
cairo_set_source (cr, pat);
@@ -247,9 +257,9 @@ murrine_rgba_draw_button (cairo_t *cr,
}
murrine_draw_border (cr, &border,
- xos+0.5, yos+0.5, width-(xos*2)-1, height-(yos*2)-1,
+ os+0.5, os+0.5, width-(os*2)-1, height-(os*2)-1,
widget->roundness, widget->corners,
- mrn_gradient_custom, 1.0);
+ mrn_gradient_new, 1.0);
}
static void
@@ -259,7 +269,7 @@ murrine_rgba_draw_entry (cairo_t *cr,
const FocusParameters *focus,
int x, int y, int width, int height)
{
- MurrineGradients mrn_gradient_custom = widget->mrn_gradient;
+ MurrineGradients mrn_gradient_new = widget->mrn_gradient;
const MurrineRGB *base = &colors->base[widget->state_type];
MurrineRGB border = colors->shade[widget->disabled ? 4 : 5];
int radius = CLAMP (widget->roundness, 0, 3);
@@ -306,13 +316,13 @@ murrine_rgba_draw_entry (cairo_t *cr,
cairo_stroke (cr);
}
- mrn_gradient_custom = get_inverted_border_shades (mrn_gradient_custom);
+ mrn_gradient_new = get_inverted_border_shades (mrn_gradient_new);
/* Draw border */
murrine_draw_border (cr, &border,
1, 1, width-3, height-3,
radius, widget->corners,
- mrn_gradient_custom, 1.0);
+ mrn_gradient_new, 1.0);
}
static void
@@ -421,28 +431,91 @@ murrine_rgba_draw_scale_trough (cairo_t *cr,
}
static void
+murrine_rgba_draw_spinbutton (cairo_t *cr,
+ const MurrineColors *colors,
+ const WidgetParameters *widget,
+ const SpinbuttonParameters *spinbutton,
+ int x, int y, int width, int height,
+ boolean horizontal)
+{
+ widget->style_functions->draw_button (cr, colors, widget, x, y, width, height, horizontal);
+
+ switch (spinbutton->style)
+ {
+ default:
+ case 0:
+ break;
+ case 1:
+ {
+ MurrineRGB line = colors->shade[!widget->disabled ? 8 : 6];
+ MurrineRGB highlight = colors->bg[widget->state_type];
+ double lightborder_shade_new = widget->lightborder_shade;
+ MurrineGradients mrn_gradient_new = widget->mrn_gradient;
+
+ if (widget->disabled)
+ {
+ lightborder_shade_new = get_decreased_shade (widget->lightborder_shade, 2.0);
+ mrn_gradient_new.border_shades[0] = get_decreased_shade (widget->mrn_gradient.border_shades[0], 2.0);
+ mrn_gradient_new.border_shades[1] = get_decreased_shade (widget->mrn_gradient.border_shades[1], 2.0);
+ }
+ else
+ murrine_shade (&colors->shade[8], 0.95, &line);
+
+ /* adjust line accordingly to buttons */
+ if (widget->mrn_gradient.has_border_colors)
+ murrine_mix_color (&mrn_gradient_new.border_colors[0], &mrn_gradient_new.border_colors[1], 0.5, &line);
+ else
+ {
+ murrine_mix_color (&line, &widget->parentbg, 0.2, &line);
+ if (widget->mrn_gradient.has_gradient_colors)
+ murrine_mix_color (&line, &mrn_gradient_new.gradient_colors[2], 0.4, &line);
+ else
+ murrine_mix_color (&line, &colors->bg[widget->state_type], 0.25, &line);
+ }
+ murrine_shade (&line, (mrn_gradient_new.border_shades[0]+mrn_gradient_new.border_shades[1])/2.0, &line);
+
+ /* adjust highlight accordingly to buttons */
+ if (widget->mrn_gradient.has_gradient_colors)
+ murrine_shade (&mrn_gradient_new.gradient_colors[2], mrn_gradient_new.gradient_shades[2], &highlight);
+ murrine_shade (&highlight, lightborder_shade_new*mrn_gradient_new.gradient_shades[2], &highlight);
+
+ cairo_move_to (cr, x+3, y+height/2.0);
+ cairo_line_to (cr, width-2, y+height/2.0);
+ murrine_set_color_rgb (cr, &line);
+ cairo_stroke (cr);
+
+ cairo_move_to (cr, x+4, y+height/2.0+1);
+ cairo_line_to (cr, width-3, y+height/2.0+1);
+ murrine_set_color_rgba (cr, &highlight, 0.5);
+ cairo_stroke (cr);
+ break;
+ }
+ }
+}
+
+static void
murrine_rgba_draw_progressbar_trough (cairo_t *cr,
const MurrineColors *colors,
const WidgetParameters *widget,
+ const ProgressBarParameters *progressbar,
int x, int y, int width, int height)
{
MurrineRGB border, fill;
int roundness = MIN (widget->roundness, MIN ((height-2.0)/2.0, (width-2.0)/2.0));
+ boolean horizontal = progressbar->orientation < 2;
murrine_shade (&colors->bg[GTK_STATE_ACTIVE], 1.0, &fill);
murrine_shade (&colors->bg[GTK_STATE_ACTIVE], get_contrast(0.82, widget->contrast), &border);
/* Create trough box */
- murrine_rounded_rectangle_closed (cr, x+1, y+1, width-2, height-2, roundness, widget->corners);
- murrine_set_color_rgba (cr, &fill, 0.8);
- cairo_fill (cr);
+ murrine_draw_trough (cr, &fill, x+1, y+1, width-2, height-2, roundness-1, widget->corners, widget->mrn_gradient, 0.8, horizontal);
/* Draw border */
- murrine_rounded_rectangle (cr, x+0.5, y+0.5, width-1, height-1, roundness, widget->corners);
- murrine_set_color_rgba (cr, &border, 0.8);
- cairo_stroke (cr);
+ murrine_draw_trough_border (cr, &border, x+0.5, y+0.5, width-1, height-1, roundness, widget->corners, widget->mrn_gradient, 0.8, horizontal);
- if (widget->mrn_gradient.gradients)
+ if (widget->mrn_gradient.gradients &&
+ widget->mrn_gradient.trough_shades[0] == 1.0 &&
+ widget->mrn_gradient.trough_shades[1] == 1.0)
{
cairo_pattern_t *pat;
MurrineRGB shadow;
@@ -1001,14 +1074,14 @@ murrine_rgba_draw_tab (cairo_t *cr,
if (widget->active)
{
MurrineRGB shade1, shade2, shade3, shade4, highlight;
- MurrineGradients mrn_gradient_custom = mrn_gradient_custom = get_decreased_gradient_shades (widget->mrn_gradient, 3.0);
- double highlight_shade_custom = get_decreased_shade (widget->highlight_shade, 2.0);
- double lightborder_shade_custom = get_decreased_shade (widget->lightborder_shade, 2.0);
+ MurrineGradients mrn_gradient_new = mrn_gradient_new = get_decreased_gradient_shades (widget->mrn_gradient, 3.0);
+ double highlight_shade_new = get_decreased_shade (widget->highlight_shade, 2.0);
+ double lightborder_shade_new = get_decreased_shade (widget->lightborder_shade, 2.0);
- murrine_shade (fill, mrn_gradient_custom.gradient_shades[0]*highlight_shade_custom, &shade1);
- murrine_shade (fill, mrn_gradient_custom.gradient_shades[1]*highlight_shade_custom, &shade2);
- murrine_shade (fill, mrn_gradient_custom.gradient_shades[2], &shade3);
- murrine_shade (fill, mrn_gradient_custom.gradient_shades[3], &shade4);
+ murrine_shade (fill, mrn_gradient_new.gradient_shades[0]*highlight_shade_new, &shade1);
+ murrine_shade (fill, mrn_gradient_new.gradient_shades[1]*highlight_shade_new, &shade2);
+ murrine_shade (fill, mrn_gradient_new.gradient_shades[2], &shade3);
+ murrine_shade (fill, mrn_gradient_new.gradient_shades[3], &shade4);
switch (tab->gap_side)
{
@@ -1039,11 +1112,11 @@ murrine_rgba_draw_tab (cairo_t *cr,
/* Draw lightborder */
cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
- murrine_shade (fill, lightborder_shade_custom*highlight_shade_custom, &highlight);
- murrine_shade (&highlight, mrn_gradient_custom.gradient_shades[0]*highlight_shade_custom, &shade1);
- murrine_shade (&highlight, mrn_gradient_custom.gradient_shades[1]*highlight_shade_custom, &shade2);
- murrine_shade (&highlight, mrn_gradient_custom.gradient_shades[2], &shade3);
- murrine_shade (&highlight, mrn_gradient_custom.gradient_shades[3], &shade4);
+ murrine_shade (fill, lightborder_shade_new*highlight_shade_new, &highlight);
+ murrine_shade (&highlight, mrn_gradient_new.gradient_shades[0]*highlight_shade_new, &shade1);
+ murrine_shade (&highlight, mrn_gradient_new.gradient_shades[1]*highlight_shade_new, &shade2);
+ murrine_shade (&highlight, mrn_gradient_new.gradient_shades[2], &shade3);
+ murrine_shade (&highlight, mrn_gradient_new.gradient_shades[3], &shade4);
switch (tab->gap_side)
{
@@ -1074,12 +1147,12 @@ murrine_rgba_draw_tab (cairo_t *cr,
else
{
MurrineRGB shade1, shade2, shade3, shade4, highlight;
- MurrineGradients mrn_gradient_custom = mrn_gradient_custom = get_decreased_gradient_shades (widget->mrn_gradient, 3.0);
- double highlight_shade_custom = get_decreased_shade (widget->highlight_shade, 2.0);
+ MurrineGradients mrn_gradient_new = mrn_gradient_new = get_decreased_gradient_shades (widget->mrn_gradient, 3.0);
+ double highlight_shade_new = get_decreased_shade (widget->highlight_shade, 2.0);
- murrine_shade (fill, mrn_gradient_custom.gradient_shades[0]*highlight_shade_custom, &shade1);
- murrine_shade (fill, mrn_gradient_custom.gradient_shades[1]*highlight_shade_custom, &shade2);
- murrine_shade (fill, mrn_gradient_custom.gradient_shades[2], &shade3);
+ murrine_shade (fill, mrn_gradient_new.gradient_shades[0]*highlight_shade_new, &shade1);
+ murrine_shade (fill, mrn_gradient_new.gradient_shades[1]*highlight_shade_new, &shade2);
+ murrine_shade (fill, mrn_gradient_new.gradient_shades[2], &shade3);
murrine_shade (fill, 1.0, &shade4); /* this value should change as draw_frame */
/* Draw shade */
@@ -1112,10 +1185,10 @@ murrine_rgba_draw_tab (cairo_t *cr,
/* Draw lightborder */
cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
- murrine_shade (fill, widget->lightborder_shade*highlight_shade_custom, &highlight);
- murrine_shade (&highlight, mrn_gradient_custom.gradient_shades[0]*highlight_shade_custom, &shade1);
- murrine_shade (&highlight, mrn_gradient_custom.gradient_shades[1]*highlight_shade_custom, &shade2);
- murrine_shade (&highlight, mrn_gradient_custom.gradient_shades[2], &shade3);
+ murrine_shade (fill, widget->lightborder_shade*highlight_shade_new, &highlight);
+ murrine_shade (&highlight, mrn_gradient_new.gradient_shades[0]*highlight_shade_new, &shade1);
+ murrine_shade (&highlight, mrn_gradient_new.gradient_shades[1]*highlight_shade_new, &shade2);
+ murrine_shade (&highlight, mrn_gradient_new.gradient_shades[2], &shade3);
murrine_shade (fill, 1.15, &shade4); /* this value should change as draw_frame */
switch (tab->gap_side)
@@ -1178,14 +1251,19 @@ murrine_rgba_draw_scrollbar_trough (cairo_t *cr,
}
/* Draw fill */
- murrine_set_color_rgba (cr, &fill, 0.4);
- clearlooks_rounded_rectangle (cr, 1, 0, width-2, height, widget->roundness, widget->corners);
- cairo_fill (cr);
+ murrine_draw_trough (cr, &fill, 0, 0, width, height, widget->roundness, widget->corners, widget->mrn_gradient, 0.4, FALSE);
/* Draw border */
- murrine_set_color_rgba (cr, &border, 0.82);
- murrine_rounded_rectangle (cr, 0.5, 0.5, width-1, height-1, widget->roundness, widget->corners);
- cairo_stroke (cr);
+ if (!scrollbar->within_bevel)
+ murrine_draw_trough_border (cr, &border, 0.5, 0.5, width-1, height-1, widget->roundness, widget->corners, widget->mrn_gradient, 0.82, FALSE);
+ else
+ {
+ murrine_shade (&border, widget->mrn_gradient.trough_shades[0], &border);
+ murrine_set_color_rgba (cr, &border, 0.82);
+ cairo_move_to (cr, 0.5, 0);
+ cairo_line_to (cr, 0.5, height);
+ cairo_stroke (cr);
+ }
}
void
@@ -1195,16 +1273,16 @@ murrine_rgba_draw_scrollbar_stepper (cairo_t *cr,
const ScrollBarParameters *scrollbar,
int x, int y, int width, int height)
{
- MurrineGradients mrn_gradient_custom = widget->mrn_gradient;
- double border_stop_mid = ((mrn_gradient_custom.border_shades[0])+
- (mrn_gradient_custom.border_shades[1]))/2.0;
+ MurrineGradients mrn_gradient_new = widget->mrn_gradient;
+ double border_stop_mid = ((mrn_gradient_new.border_shades[0])+
+ (mrn_gradient_new.border_shades[1]))/2.0;
const MurrineRGB *fill = &colors->bg[widget->state_type];
MurrineRGB border;
murrine_shade (&colors->shade[7], 0.95, &border);
- mrn_gradient_custom.border_shades[0] = border_stop_mid;
- mrn_gradient_custom.border_shades[1] = border_stop_mid;
+ mrn_gradient_new.border_shades[0] = border_stop_mid;
+ mrn_gradient_new.border_shades[1] = border_stop_mid;
if (!scrollbar->horizontal)
murrine_exchange_axis (cr, &x, &y, &width, &height);
@@ -1231,7 +1309,7 @@ murrine_rgba_draw_scrollbar_stepper (cairo_t *cr,
murrine_draw_border (cr, &border,
0.5, 0.5, width-1, height-1,
widget->roundness, widget->corners,
- mrn_gradient_custom, 1.0);
+ mrn_gradient_new, 1.0);
}
void
@@ -1241,11 +1319,12 @@ murrine_rgba_draw_scrollbar_slider (cairo_t *cr,
const ScrollBarParameters *scrollbar,
int x, int y, int width, int height)
{
- MurrineGradients mrn_gradient_custom = widget->mrn_gradient;
- double border_stop_mid = ((mrn_gradient_custom.border_shades[0])+
- (mrn_gradient_custom.border_shades[1]))/2.0;
+ MurrineGradients mrn_gradient_new = widget->mrn_gradient;
+ double border_stop_mid = ((mrn_gradient_new.border_shades[0])+
+ (mrn_gradient_new.border_shades[1]))/2.0;
MurrineRGB fill = scrollbar->has_color ? scrollbar->color : colors->bg[0];
MurrineRGB border;
+ uint8 corners = widget->corners;
if (scrollbar->stepperstyle < 1)
{
@@ -1271,10 +1350,28 @@ murrine_rgba_draw_scrollbar_slider (cairo_t *cr,
}
}
+ if (scrollbar->stepperstyle == 2)
+ {
+ if (scrollbar->junction & MRN_JUNCTION_BEGIN)
+ {
+ if (scrollbar->horizontal)
+ corners ^= MRN_CORNER_TOPLEFT | MRN_CORNER_BOTTOMLEFT;
+ else
+ corners ^= MRN_CORNER_TOPLEFT | MRN_CORNER_BOTTOMLEFT;
+ }
+ if (scrollbar->junction & MRN_JUNCTION_END)
+ {
+ if (scrollbar->horizontal)
+ corners ^= MRN_CORNER_TOPRIGHT | MRN_CORNER_BOTTOMRIGHT;
+ else
+ corners ^= MRN_CORNER_TOPRIGHT | MRN_CORNER_BOTTOMRIGHT;
+ }
+ }
+
murrine_shade (&colors->shade[7], 0.95, &border);
- mrn_gradient_custom.border_shades[0] = border_stop_mid;
- mrn_gradient_custom.border_shades[1] = border_stop_mid;
+ mrn_gradient_new.border_shades[0] = border_stop_mid;
+ mrn_gradient_new.border_shades[1] = border_stop_mid;
if (widget->prelight)
murrine_shade (&fill, 1.04, &fill);
@@ -1295,13 +1392,13 @@ murrine_rgba_draw_scrollbar_slider (cairo_t *cr,
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
- murrine_rounded_rectangle_closed (cr, 1, 1, width-2, height-2, widget->roundness-1, widget->corners);
+ murrine_rounded_rectangle_closed (cr, 1, 1, width-2, height-2, widget->roundness-1, corners);
cairo_clip_preserve (cr);
murrine_draw_glaze (cr, &fill,
widget->glow_shade, widget->highlight_shade, widget->lightborder_shade,
widget->mrn_gradient, widget, 1, 1, width-2, height-2,
- widget->roundness, widget->corners, TRUE);
+ widget->roundness, corners, TRUE);
/* Draw the options */
MurrineRGB style;
@@ -1390,8 +1487,8 @@ murrine_rgba_draw_scrollbar_slider (cairo_t *cr,
murrine_draw_border (cr, &border,
0.5, 0.5, width-1, height-1,
- widget->roundness, widget->corners,
- mrn_gradient_custom, 1.0);
+ widget->roundness, corners,
+ mrn_gradient_new, 1.0);
}
static void
@@ -1401,9 +1498,9 @@ murrine_rgba_draw_tooltip (cairo_t *cr,
int x, int y, int width, int height)
{
MurrineRGB border;
- MurrineGradients mrn_gradient_custom = get_decreased_gradient_shades (widget->mrn_gradient, 2.0);
- double glow_shade_custom = get_decreased_shade (widget->glow_shade, 2.0);
- double highlight_shade_custom = get_decreased_shade (widget->highlight_shade, 2.0);
+ MurrineGradients mrn_gradient_new = get_decreased_gradient_shades (widget->mrn_gradient, 2.0);
+ double glow_shade_new = get_decreased_shade (widget->glow_shade, 2.0);
+ double highlight_shade_new = get_decreased_shade (widget->highlight_shade, 2.0);
murrine_shade (&colors->bg[widget->state_type], get_contrast(0.6, widget->contrast), &border);
@@ -1423,8 +1520,8 @@ murrine_rgba_draw_tooltip (cairo_t *cr,
cairo_clip_preserve (cr);
murrine_draw_glaze (cr, &colors->bg[widget->state_type],
- glow_shade_custom, highlight_shade_custom, widget->lightborder_shade,
- mrn_gradient_custom, widget, 1, 1, width-2, height-2,
+ glow_shade_new, highlight_shade_new, widget->lightborder_shade,
+ mrn_gradient_new, widget, 1, 1, width-2, height-2,
widget->roundness-1, widget->corners, TRUE);
cairo_restore (cr);
@@ -1434,7 +1531,7 @@ murrine_rgba_draw_tooltip (cairo_t *cr,
murrine_draw_border (cr, &border,
0.5, 0.5, width-1, height-1,
widget->roundness, widget->corners,
- mrn_gradient_custom, 1.0);
+ mrn_gradient_new, 1.0);
cairo_restore (cr);
}
@@ -1494,9 +1591,9 @@ murrine_rgba_draw_radiobutton (cairo_t *cr,
gboolean inconsistent = FALSE;
gboolean draw_bullet = (checkbox->shadow_type == GTK_SHADOW_IN);
int roundness = 5;
- double highlight_shade_custom = widget->highlight_shade;
- double lightborder_shade_custom = widget->lightborder_shade;
- MurrineGradients mrn_gradient_custom = widget->mrn_gradient;
+ double highlight_shade_new = widget->highlight_shade;
+ double lightborder_shade_new = widget->lightborder_shade;
+ MurrineGradients mrn_gradient_new = widget->mrn_gradient;
inconsistent = (checkbox->shadow_type == GTK_SHADOW_ETCHED_IN);
draw_bullet |= inconsistent;
@@ -1509,11 +1606,11 @@ murrine_rgba_draw_radiobutton (cairo_t *cr,
dot = &colors->shade[4];
bg = &colors->bg[0];
- mrn_gradient_custom = get_decreased_gradient_shades (widget->mrn_gradient, 3.0);
- mrn_gradient_custom.border_shades[0] = get_decreased_shade (widget->mrn_gradient.border_shades[0], 3.0);
- mrn_gradient_custom.border_shades[1] = get_decreased_shade (widget->mrn_gradient.border_shades[1], 3.0);
- highlight_shade_custom = get_decreased_shade (widget->highlight_shade, 2.0);
- lightborder_shade_custom = get_decreased_shade (widget->lightborder_shade, 2.0);
+ mrn_gradient_new = get_decreased_gradient_shades (widget->mrn_gradient, 3.0);
+ mrn_gradient_new.border_shades[0] = get_decreased_shade (widget->mrn_gradient.border_shades[0], 3.0);
+ mrn_gradient_new.border_shades[1] = get_decreased_shade (widget->mrn_gradient.border_shades[1], 3.0);
+ highlight_shade_new = get_decreased_shade (widget->highlight_shade, 2.0);
+ lightborder_shade_new = get_decreased_shade (widget->lightborder_shade, 2.0);
}
else
{
@@ -1541,7 +1638,7 @@ murrine_rgba_draw_radiobutton (cairo_t *cr,
0.5, 0.5, width-1, height-1,
roundness+1, widget->corners,
widget->reliefstyle,
- mrn_gradient_custom, 0.08);
+ mrn_gradient_new, 0.08);
}
else if (widget->reliefstyle != 0)
murrine_draw_inset (cr, &widget->parentbg, 0.5, 0.5, width-1, height-1, roundness+1, widget->corners);
@@ -1555,8 +1652,8 @@ murrine_rgba_draw_radiobutton (cairo_t *cr,
if (draw_bullet)
{
murrine_draw_glaze (cr, bg,
- widget->glow_shade, highlight_shade_custom, lightborder_shade_custom,
- mrn_gradient_custom, widget, 2, 2, width-4, height-4,
+ widget->glow_shade, highlight_shade_new, lightborder_shade_new,
+ mrn_gradient_new, widget, 2, 2, width-4, height-4,
roundness, widget->corners, TRUE);
}
else
@@ -1569,18 +1666,21 @@ murrine_rgba_draw_radiobutton (cairo_t *cr,
if (checkbox->in_menu || checkbox->in_cell)
{
- mrn_gradient_custom.border_shades[0] = 1.0;
- mrn_gradient_custom.border_shades[1] = 1.0;
+ mrn_gradient_new.border_shades[0] = 1.0;
+ mrn_gradient_new.border_shades[1] = 1.0;
+ if (!draw_bullet)
+ mrn_gradient_new.has_border_colors = FALSE;
}
else if (!draw_bullet)
{
- mrn_gradient_custom = get_inverted_border_shades (mrn_gradient_custom);
+ mrn_gradient_new = get_inverted_border_shades (mrn_gradient_new);
+ mrn_gradient_new.has_border_colors = FALSE;
}
murrine_draw_border (cr, &border,
1.5, 1.5, width-3, height-3,
roundness, widget->corners,
- mrn_gradient_custom, 1.0);
+ mrn_gradient_new, 1.0);
if (draw_bullet)
{
@@ -1619,9 +1719,9 @@ murrine_rgba_draw_checkbox (cairo_t *cr,
gboolean inconsistent = FALSE;
gboolean draw_bullet = (checkbox->shadow_type == GTK_SHADOW_IN);
int roundness = CLAMP (widget->roundness, 0, 2);
- double highlight_shade_custom = widget->highlight_shade;
- double lightborder_shade_custom = widget->lightborder_shade;
- MurrineGradients mrn_gradient_custom = widget->mrn_gradient;
+ double highlight_shade_new = widget->highlight_shade;
+ double lightborder_shade_new = widget->lightborder_shade;
+ MurrineGradients mrn_gradient_new = widget->mrn_gradient;
inconsistent = (checkbox->shadow_type == GTK_SHADOW_ETCHED_IN);
draw_bullet |= inconsistent;
@@ -1634,11 +1734,11 @@ murrine_rgba_draw_checkbox (cairo_t *cr,
dot = &colors->shade[4];
bg = &colors->bg[0];
- mrn_gradient_custom = get_decreased_gradient_shades (widget->mrn_gradient, 3.0);
- mrn_gradient_custom.border_shades[0] = get_decreased_shade (widget->mrn_gradient.border_shades[0], 3.0);
- mrn_gradient_custom.border_shades[1] = get_decreased_shade (widget->mrn_gradient.border_shades[1], 3.0);
- highlight_shade_custom = get_decreased_shade (widget->highlight_shade, 2.0);
- lightborder_shade_custom = get_decreased_shade (widget->lightborder_shade, 2.0);
+ mrn_gradient_new = get_decreased_gradient_shades (widget->mrn_gradient, 3.0);
+ mrn_gradient_new.border_shades[0] = get_decreased_shade (widget->mrn_gradient.border_shades[0], 3.0);
+ mrn_gradient_new.border_shades[1] = get_decreased_shade (widget->mrn_gradient.border_shades[1], 3.0);
+ highlight_shade_new = get_decreased_shade (widget->highlight_shade, 2.0);
+ lightborder_shade_new = get_decreased_shade (widget->lightborder_shade, 2.0);
}
else
{
@@ -1666,7 +1766,7 @@ murrine_rgba_draw_checkbox (cairo_t *cr,
0.5, 0.5, width-1, height-1,
roundness+1, widget->corners,
widget->reliefstyle,
- mrn_gradient_custom, 0.08);
+ mrn_gradient_new, 0.08);
}
else if (widget->reliefstyle != 0)
murrine_draw_inset (cr, &widget->parentbg, 0.5, 0.5, width-1, height-1, roundness+1, widget->corners);
@@ -1680,8 +1780,8 @@ murrine_rgba_draw_checkbox (cairo_t *cr,
if (draw_bullet)
{
murrine_draw_glaze (cr, bg,
- widget->glow_shade, highlight_shade_custom, lightborder_shade_custom,
- mrn_gradient_custom, widget, 2, 2, width-4, height-4,
+ widget->glow_shade, highlight_shade_new, lightborder_shade_new,
+ mrn_gradient_new, widget, 2, 2, width-4, height-4,
roundness, widget->corners, TRUE);
}
else
@@ -1694,18 +1794,21 @@ murrine_rgba_draw_checkbox (cairo_t *cr,
if (checkbox->in_menu || checkbox->in_cell)
{
- mrn_gradient_custom.border_shades[0] = 1.0;
- mrn_gradient_custom.border_shades[1] = 1.0;
+ mrn_gradient_new.border_shades[0] = 1.0;
+ mrn_gradient_new.border_shades[1] = 1.0;
+ if (!draw_bullet)
+ mrn_gradient_new.has_border_colors = FALSE;
}
else if (!draw_bullet)
{
- mrn_gradient_custom = get_inverted_border_shades (mrn_gradient_custom);
+ mrn_gradient_new = get_inverted_border_shades (mrn_gradient_new);
+ mrn_gradient_new.has_border_colors = FALSE;
}
murrine_draw_border (cr, &border,
1.5, 1.5, width-3, height-3,
roundness, widget->corners,
- mrn_gradient_custom, 1.0);
+ mrn_gradient_new, 1.0);
if (draw_bullet)
{
@@ -1803,6 +1906,7 @@ murrine_register_style_rgba (MurrineStyleFunctions *functions)
functions->draw_button = murrine_rgba_draw_button;
functions->draw_entry = murrine_rgba_draw_entry;
functions->draw_scale_trough = murrine_rgba_draw_scale_trough;
+ functions->draw_spinbutton = murrine_rgba_draw_spinbutton;
functions->draw_progressbar_trough = murrine_rgba_draw_progressbar_trough;
functions->draw_progressbar_fill = murrine_rgba_draw_progressbar_fill;
functions->draw_menubar = murrine_rgba_draw_menubar;
diff --git a/src/murrine_rc_style.c b/src/murrine_rc_style.c
index 975a39a..dd15121 100644
--- a/src/murrine_rc_style.c
+++ b/src/murrine_rc_style.c
@@ -37,15 +37,17 @@ enum
{
TOKEN_ANIMATION = G_TOKEN_LAST + 1,
TOKEN_ARROWSTYLE,
+ TOKEN_BORDER_COLORS,
TOKEN_BORDER_SHADES,
TOKEN_COLORIZE_SCROLLBAR,
+ TOKEN_COMBOBOXSTYLE,
TOKEN_CONTRAST,
TOKEN_FOCUS_COLOR,
TOKEN_GLAZESTYLE,
TOKEN_GLOW_SHADE,
TOKEN_GLOWSTYLE,
+ TOKEN_GRADIENT_COLORS,
TOKEN_GRADIENT_SHADES,
- TOKEN_GRADIENTS,
TOKEN_HIGHLIGHT_SHADE,
TOKEN_LIGHTBORDER_SHADE,
TOKEN_LIGHTBORDERSTYLE,
@@ -55,31 +57,28 @@ enum
TOKEN_MENUBARSTYLE,
TOKEN_MENUITEMSTYLE,
TOKEN_MENUSTYLE,
- TOKEN_PROFILE,
TOKEN_PROGRESSBARSTYLE,
TOKEN_RELIEFSTYLE,
TOKEN_RGBA,
TOKEN_ROUNDNESS,
- TOKEN_SCROLLBAR_COLOR,
TOKEN_SCROLLBARSTYLE,
TOKEN_SLIDERSTYLE,
+ TOKEN_SPINBUTTONSTYLE,
TOKEN_STEPPERSTYLE,
TOKEN_TEXTSTYLE,
TOKEN_TOOLBARSTYLE,
-
- TOKEN_CANDIDO,
- TOKEN_CLEARLOOKS,
- TOKEN_MIST,
- TOKEN_MURRINE,
- TOKEN_NODOKA,
+ TOKEN_TROUGH_SHADES,
TOKEN_TRUE,
TOKEN_FALSE,
/* stuff to ignore */
+ TOKEN_GRADIENTS,
TOKEN_HILIGHT_RATIO,
TOKEN_HIGHLIGHT_RATIO,
TOKEN_LIGHTBORDER_RATIO,
+ TOKEN_PROFILE,
+ TOKEN_SCROLLBAR_COLOR,
TOKEN_SQUAREDSTYLE,
TOKEN_STYLE
};
@@ -93,15 +92,17 @@ theme_symbols[] =
{
{ "animation", TOKEN_ANIMATION },
{ "arrowstyle", TOKEN_ARROWSTYLE },
+ { "border_colors", TOKEN_BORDER_COLORS },
{ "border_shades", TOKEN_BORDER_SHADES },
{ "colorize_scrollbar", TOKEN_COLORIZE_SCROLLBAR },
+ { "comboboxstyle", TOKEN_COMBOBOXSTYLE },
{ "contrast", TOKEN_CONTRAST },
{ "focus_color", TOKEN_FOCUS_COLOR },
{ "glazestyle", TOKEN_GLAZESTYLE },
{ "glow_shade", TOKEN_GLOW_SHADE },
{ "glowstyle", TOKEN_GLOWSTYLE },
+ { "gradient_colors", TOKEN_GRADIENT_COLORS },
{ "gradient_shades", TOKEN_GRADIENT_SHADES },
- { "gradients", TOKEN_GRADIENTS },
{ "highlight_shade", TOKEN_HIGHLIGHT_SHADE },
{ "lightborder_shade", TOKEN_LIGHTBORDER_SHADE },
{ "lightborderstyle", TOKEN_LIGHTBORDERSTYLE },
@@ -111,31 +112,28 @@ theme_symbols[] =
{ "menubarstyle", TOKEN_MENUBARSTYLE },
{ "menuitemstyle", TOKEN_MENUITEMSTYLE },
{ "menustyle", TOKEN_MENUSTYLE },
- { "profile", TOKEN_PROFILE },
{ "progressbarstyle", TOKEN_PROGRESSBARSTYLE },
{ "reliefstyle", TOKEN_RELIEFSTYLE },
{ "rgba", TOKEN_RGBA },
{ "roundness", TOKEN_ROUNDNESS },
- { "scrollbar_color", TOKEN_SCROLLBAR_COLOR },
{ "scrollbarstyle", TOKEN_SCROLLBARSTYLE },
{ "sliderstyle", TOKEN_SLIDERSTYLE },
+ { "spinbuttonstyle", TOKEN_SPINBUTTONSTYLE },
{ "stepperstyle", TOKEN_STEPPERSTYLE },
{ "textstyle", TOKEN_TEXTSTYLE },
{ "toolbarstyle", TOKEN_TOOLBARSTYLE },
-
- { "CANDIDO", TOKEN_CANDIDO },
- { "CLEARLOOKS", TOKEN_CLEARLOOKS },
- { "MIST", TOKEN_MIST },
- { "MURRINE", TOKEN_MURRINE },
- { "NODOKA", TOKEN_NODOKA },
+ { "trough_shades", TOKEN_TROUGH_SHADES },
{ "TRUE", TOKEN_TRUE },
{ "FALSE", TOKEN_FALSE },
/* stuff to ignore */
+ { "gradients", TOKEN_GRADIENTS },
{ "hilight_ratio", TOKEN_HILIGHT_RATIO },
{ "highlight_ratio", TOKEN_HIGHLIGHT_RATIO },
{ "lightborder_ratio", TOKEN_LIGHTBORDER_RATIO },
+ { "profile", TOKEN_PROFILE },
+ { "scrollbar_color", TOKEN_SCROLLBAR_COLOR },
{ "squaredstyle", TOKEN_SQUAREDSTYLE },
{ "style", TOKEN_STYLE }
};
@@ -158,8 +156,10 @@ murrine_rc_style_init (MurrineRcStyle *murrine_rc)
murrine_rc->border_shades[0] = 1.0;
murrine_rc->border_shades[1] = 1.0;
murrine_rc->colorize_scrollbar = TRUE;
+ murrine_rc->comboboxstyle = 0;
murrine_rc->contrast = 1.0;
- murrine_rc->has_focus_color = FALSE;
+ murrine_rc->has_border_colors = FALSE;
+ murrine_rc->has_gradient_colors = FALSE;
murrine_rc->glazestyle = 1;
murrine_rc->glow_shade = 1.0;
murrine_rc->glowstyle = 0;
@@ -167,8 +167,6 @@ murrine_rc_style_init (MurrineRcStyle *murrine_rc)
murrine_rc->gradient_shades[1] = 1.0;
murrine_rc->gradient_shades[2] = 1.0;
murrine_rc->gradient_shades[3] = 1.1;
- murrine_rc->gradients = TRUE;
- murrine_rc->has_scrollbar_color = FALSE;
murrine_rc->highlight_shade = 1.1;
murrine_rc->lightborder_shade = 1.1;
murrine_rc->lightborderstyle = 0;
@@ -184,10 +182,12 @@ murrine_rc_style_init (MurrineRcStyle *murrine_rc)
murrine_rc->roundness = 1;
murrine_rc->scrollbarstyle = 0;
murrine_rc->sliderstyle = 0;
+ murrine_rc->spinbuttonstyle = 0;
murrine_rc->stepperstyle = 0;
- murrine_rc->profile = MRN_PROFILE_MURRINE;
murrine_rc->textstyle = 0;
murrine_rc->toolbarstyle = 0;
+ murrine_rc->trough_shades[0] = 1.0;
+ murrine_rc->trough_shades[1] = 1.0;
}
#ifdef HAVE_ANIMATION
@@ -228,7 +228,7 @@ murrine_rc_style_class_finalize (MurrineRcStyleClass *klass)
static guint
theme_parse_boolean (GtkSettings *settings,
GScanner *scanner,
- gboolean *retval)
+ gboolean *retval)
{
guint token;
@@ -269,6 +269,30 @@ theme_parse_color (GtkSettings *settings,
}
static guint
+murrine_gtk2_rc_parse_dummy_color (GtkSettings *settings,
+ GScanner *scanner,
+ gchar *name,
+ GtkRcStyle *style,
+ GdkColor *color)
+{
+ guint token;
+
+ /* Skip option */
+ token = g_scanner_get_next_token (scanner);
+
+ /* print a warning. Isn't there a way to get the string from the scanner? */
+ g_scanner_warn (scanner, "Murrine configuration option \"%s\" is no longer supported and will be ignored.", name);
+
+ /* equal sign */
+ /* Skip 'blah_color' */
+ token = g_scanner_get_next_token(scanner);
+ if (token != G_TOKEN_EQUAL_SIGN)
+ return G_TOKEN_EQUAL_SIGN;
+
+ return gtk_rc_parse_color_full (scanner, style, color);
+}
+
+static guint
theme_parse_shade (GtkSettings *settings,
GScanner *scanner,
double *ratio)
@@ -315,48 +339,6 @@ theme_parse_int (GtkSettings *settings,
}
static guint
-theme_parse_profile (GtkSettings *settings,
- GScanner *scanner,
- MurrineProfiles *profile)
-{
- guint token;
-
- g_assert (MRN_NUM_PROFILES == MRN_PROFILE_CLEARLOOKS + 1); /* so that people don't forget ;-) */
-
- /* Skip 'profile' */
- token = g_scanner_get_next_token (scanner);
-
- token = g_scanner_get_next_token (scanner);
- if (token != G_TOKEN_EQUAL_SIGN)
- return G_TOKEN_EQUAL_SIGN;
-
- token = g_scanner_get_next_token (scanner);
-
- switch (token)
- {
- case TOKEN_MURRINE:
- *profile = MRN_PROFILE_MURRINE;
- break;
- case TOKEN_NODOKA:
- *profile = MRN_PROFILE_NODOKA;
- break;
- case TOKEN_MIST:
- *profile = MRN_PROFILE_MIST;
- break;
- case TOKEN_CANDIDO:
- *profile = MRN_PROFILE_CANDIDO;
- break;
- case TOKEN_CLEARLOOKS:
- *profile = MRN_PROFILE_CLEARLOOKS;
- break;
- default:
- return TOKEN_MURRINE;
- }
-
- return G_TOKEN_NONE;
-}
-
-static guint
theme_parse_gradient (GtkSettings *settings,
GScanner *scanner,
double gradient_shades[4])
@@ -413,6 +395,100 @@ theme_parse_gradient (GtkSettings *settings,
}
static guint
+theme_parse_gradient_colors (GtkSettings *settings,
+ GScanner *scanner,
+ GtkRcStyle *style,
+ gboolean *retval,
+ GdkColor gradient_colors[4])
+{
+ guint token;
+ *retval = TRUE;
+
+ /* Skip 'blah_border' */
+ token = g_scanner_get_next_token(scanner);
+
+ token = g_scanner_get_next_token(scanner);
+ if (token != G_TOKEN_EQUAL_SIGN)
+ return G_TOKEN_EQUAL_SIGN;
+
+ token = g_scanner_get_next_token(scanner);
+ if (token == TOKEN_FALSE)
+ {
+ *retval = FALSE;
+ return G_TOKEN_NONE;
+ }
+ else if (token != G_TOKEN_LEFT_CURLY)
+ return G_TOKEN_LEFT_CURLY;
+
+ gtk_rc_parse_color_full (scanner, style, &gradient_colors[0]);
+ token = g_scanner_get_next_token(scanner);
+ if (token != G_TOKEN_COMMA)
+ return G_TOKEN_COMMA;
+
+ gtk_rc_parse_color_full (scanner, style, &gradient_colors[1]);
+ token = g_scanner_get_next_token(scanner);
+ if (token != G_TOKEN_COMMA)
+ return G_TOKEN_COMMA;
+
+ gtk_rc_parse_color_full (scanner, style, &gradient_colors[2]);
+ token = g_scanner_get_next_token(scanner);
+ if (token != G_TOKEN_COMMA)
+ return G_TOKEN_COMMA;
+
+ gtk_rc_parse_color_full (scanner, style, &gradient_colors[3]);
+
+ token = g_scanner_get_next_token(scanner);
+ if (token != G_TOKEN_RIGHT_CURLY)
+ return G_TOKEN_RIGHT_CURLY;
+
+ /* save those values */
+
+ return G_TOKEN_NONE;
+}
+
+static guint
+theme_parse_border_colors (GtkSettings *settings,
+ GScanner *scanner,
+ GtkRcStyle *style,
+ gboolean *retval,
+ GdkColor border_colors[2])
+{
+ guint token;
+ *retval = TRUE;
+
+ /* Skip 'blah_border' */
+ token = g_scanner_get_next_token(scanner);
+
+ token = g_scanner_get_next_token(scanner);
+ if (token != G_TOKEN_EQUAL_SIGN)
+ return G_TOKEN_EQUAL_SIGN;
+
+ token = g_scanner_get_next_token(scanner);
+ if (token == TOKEN_FALSE)
+ {
+ *retval = FALSE;
+ return G_TOKEN_NONE;
+ }
+ else if (token != G_TOKEN_LEFT_CURLY)
+ return G_TOKEN_LEFT_CURLY;
+
+ gtk_rc_parse_color_full (scanner, style, &border_colors[0]);
+ token = g_scanner_get_next_token(scanner);
+ if (token != G_TOKEN_COMMA)
+ return G_TOKEN_COMMA;
+
+ gtk_rc_parse_color_full (scanner, style, &border_colors[1]);
+
+ token = g_scanner_get_next_token(scanner);
+ if (token != G_TOKEN_RIGHT_CURLY)
+ return G_TOKEN_RIGHT_CURLY;
+
+ /* save those values */
+
+ return G_TOKEN_NONE;
+}
+
+static guint
theme_parse_border (GtkSettings *settings,
GScanner *scanner,
double border_shades[2])
@@ -463,7 +539,7 @@ murrine_gtk2_rc_parse_dummy (GtkSettings *settings,
token = g_scanner_get_next_token (scanner);
/* print a warning. Isn't there a way to get the string from the scanner? */
- g_scanner_warn (scanner, "Murrine configuration option \"%s\" is not supported and will be ignored.", name);
+ g_scanner_warn (scanner, "Murrine configuration option \"%s\" is no longer supported and will be ignored.", name);
/* equal sign */
token = g_scanner_get_next_token (scanner);
@@ -525,14 +601,22 @@ murrine_rc_style_parse (GtkRcStyle *rc_style,
token = theme_parse_int (settings, scanner, &murrine_style->arrowstyle);
murrine_style->flags |= MRN_FLAG_ARROWSTYLE;
break;
+ case TOKEN_BORDER_COLORS:
+ token = theme_parse_border_colors (settings, scanner, rc_style, &murrine_style->has_border_colors, murrine_style->border_colors);
+ murrine_style->gflags |= MRN_FLAG_BORDER_COLORS;
+ break;
case TOKEN_BORDER_SHADES:
token = theme_parse_border (settings, scanner, murrine_style->border_shades);
- murrine_style->flags |= MRN_FLAG_BORDER_SHADES;
+ murrine_style->gflags |= MRN_FLAG_BORDER_SHADES;
break;
case TOKEN_COLORIZE_SCROLLBAR:
token = theme_parse_boolean (settings, scanner, &murrine_style->colorize_scrollbar);
murrine_style->flags |= MRN_FLAG_COLORIZE_SCROLLBAR;
break;
+ case TOKEN_COMBOBOXSTYLE:
+ token = theme_parse_int (settings, scanner, &murrine_style->comboboxstyle);
+ murrine_style->flags |= MRN_FLAG_COMBOBOXSTYLE;
+ break;
case TOKEN_CONTRAST:
token = theme_parse_shade (settings, scanner, &murrine_style->contrast);
murrine_style->flags |= MRN_FLAG_CONTRAST;
@@ -540,7 +624,6 @@ murrine_rc_style_parse (GtkRcStyle *rc_style,
case TOKEN_FOCUS_COLOR:
token = theme_parse_color (settings, scanner, rc_style, &murrine_style->focus_color);
murrine_style->flags |= MRN_FLAG_FOCUS_COLOR;
- murrine_style->has_focus_color = TRUE;
break;
case TOKEN_GLAZESTYLE:
token = theme_parse_int (settings, scanner, &murrine_style->glazestyle);
@@ -554,13 +637,13 @@ murrine_rc_style_parse (GtkRcStyle *rc_style,
token = theme_parse_int (settings, scanner, &murrine_style->glowstyle);
murrine_style->flags |= MRN_FLAG_GLOWSTYLE;
break;
+ case TOKEN_GRADIENT_COLORS:
+ token = theme_parse_gradient_colors (settings, scanner, rc_style, &murrine_style->has_gradient_colors, murrine_style->gradient_colors);
+ murrine_style->gflags |= MRN_FLAG_GRADIENT_COLORS;
+ break;
case TOKEN_GRADIENT_SHADES:
token = theme_parse_gradient (settings, scanner, murrine_style->gradient_shades);
- murrine_style->flags |= MRN_FLAG_GRADIENT_SHADES;
- break;
- case TOKEN_GRADIENTS:
- token = theme_parse_boolean (settings, scanner, &murrine_style->gradients);
- murrine_style->flags |= MRN_FLAG_GRADIENTS;
+ murrine_style->gflags |= MRN_FLAG_GRADIENT_SHADES;
break;
case TOKEN_HIGHLIGHT_SHADE:
token = theme_parse_shade (settings, scanner, &murrine_style->highlight_shade);
@@ -598,10 +681,6 @@ murrine_rc_style_parse (GtkRcStyle *rc_style,
token = theme_parse_int (settings, scanner, &murrine_style->menustyle);
murrine_style->flags |= MRN_FLAG_MENUSTYLE;
break;
- case TOKEN_PROFILE:
- token = theme_parse_profile (settings, scanner, &murrine_style->profile);
- murrine_style->flags |= MRN_FLAG_PROFILE;
- break;
case TOKEN_PROGRESSBARSTYLE:
token = theme_parse_int (settings, scanner, &murrine_style->progressbarstyle);
murrine_style->flags |= MRN_FLAG_PROGRESSBARSTYLE;
@@ -618,11 +697,6 @@ murrine_rc_style_parse (GtkRcStyle *rc_style,
token = theme_parse_int (settings, scanner, &murrine_style->roundness);
murrine_style->flags |= MRN_FLAG_ROUNDNESS;
break;
- case TOKEN_SCROLLBAR_COLOR:
- token = theme_parse_color (settings, scanner, rc_style, &murrine_style->scrollbar_color);
- murrine_style->flags |= MRN_FLAG_SCROLLBAR_COLOR;
- murrine_style->has_scrollbar_color = TRUE;
- break;
case TOKEN_SCROLLBARSTYLE:
token = theme_parse_int (settings, scanner, &murrine_style->scrollbarstyle);
murrine_style->flags |= MRN_FLAG_SCROLLBARSTYLE;
@@ -631,6 +705,10 @@ murrine_rc_style_parse (GtkRcStyle *rc_style,
token = theme_parse_int (settings, scanner, &murrine_style->sliderstyle);
murrine_style->flags |= MRN_FLAG_SLIDERSTYLE;
break;
+ case TOKEN_SPINBUTTONSTYLE:
+ token = theme_parse_int (settings, scanner, &murrine_style->spinbuttonstyle);
+ murrine_style->flags |= MRN_FLAG_SPINBUTTONSTYLE;
+ break;
case TOKEN_STEPPERSTYLE:
token = theme_parse_int (settings, scanner, &murrine_style->stepperstyle);
murrine_style->flags |= MRN_FLAG_STEPPERSTYLE;
@@ -643,8 +721,15 @@ murrine_rc_style_parse (GtkRcStyle *rc_style,
token = theme_parse_int (settings, scanner, &murrine_style->toolbarstyle);
murrine_style->flags |= MRN_FLAG_TOOLBARSTYLE;
break;
+ case TOKEN_TROUGH_SHADES:
+ token = theme_parse_border (settings, scanner, murrine_style->trough_shades);
+ murrine_style->gflags |= MRN_FLAG_TROUGH_SHADES;
+ break;
/* stuff to ignore */
+ case TOKEN_GRADIENTS:
+ token = murrine_gtk2_rc_parse_dummy (settings, scanner, "gradients");
+ break;
case TOKEN_HILIGHT_RATIO:
g_scanner_warn (scanner, "Murrine configuration option \"hilight_ratio\" will be deprecated in future releases. Please use \"highlight_shade\" instead.", "hilight_ratio");
double hilight_ratio;
@@ -662,6 +747,15 @@ murrine_rc_style_parse (GtkRcStyle *rc_style,
token = theme_parse_shade (settings, scanner, &murrine_style->lightborder_shade);
murrine_style->flags |= MRN_FLAG_LIGHTBORDER_SHADE;
break;
+ case TOKEN_PROFILE:
+ token = murrine_gtk2_rc_parse_dummy (settings, scanner, "profile");
+ break;
+ case TOKEN_SCROLLBAR_COLOR:
+ {
+ GdkColor dummy_color;
+ token = murrine_gtk2_rc_parse_dummy_color (settings, scanner, "scrollbar_color", rc_style, &dummy_color);
+ break;
+ }
case TOKEN_SQUAREDSTYLE:
token = murrine_gtk2_rc_parse_dummy (settings, scanner, "squaredstyle");
break;
@@ -694,6 +788,7 @@ murrine_rc_style_merge (GtkRcStyle *dest,
{
MurrineRcStyle *dest_w, *src_w;
MurrineRcFlags flags;
+ MurrineRcGradientFlags gflags;
GTK_RC_STYLE_CLASS (murrine_rc_style_parent_class)->merge (dest, src);
@@ -709,35 +804,20 @@ murrine_rc_style_merge (GtkRcStyle *dest,
dest_w->animation = src_w->animation;
if (flags & MRN_FLAG_ARROWSTYLE)
dest_w->arrowstyle = src_w->arrowstyle;
- if (flags & MRN_FLAG_BORDER_SHADES)
- {
- dest_w->border_shades[0] = src_w->border_shades[0];
- dest_w->border_shades[1] = src_w->border_shades[1];
- }
if (flags & MRN_FLAG_COLORIZE_SCROLLBAR)
dest_w->colorize_scrollbar = src_w->colorize_scrollbar;
+ if (flags & MRN_FLAG_COMBOBOXSTYLE)
+ dest_w->comboboxstyle = src_w->comboboxstyle;
if (flags & MRN_FLAG_CONTRAST)
dest_w->contrast = src_w->contrast;
if (flags & MRN_FLAG_FOCUS_COLOR)
- {
- dest_w->has_focus_color = TRUE;
dest_w->focus_color = src_w->focus_color;
- }
if (flags & MRN_FLAG_GLAZESTYLE)
dest_w->glazestyle = src_w->glazestyle;
if (flags & MRN_FLAG_GLOW_SHADE)
dest_w->glow_shade = src_w->glow_shade;
if (flags & MRN_FLAG_GLOWSTYLE)
dest_w->glowstyle = src_w->glowstyle;
- if (flags & MRN_FLAG_GRADIENT_SHADES)
- {
- dest_w->gradient_shades[0] = src_w->gradient_shades[0];
- dest_w->gradient_shades[1] = src_w->gradient_shades[1];
- dest_w->gradient_shades[2] = src_w->gradient_shades[2];
- dest_w->gradient_shades[3] = src_w->gradient_shades[3];
- }
- if (flags & MRN_FLAG_GRADIENTS)
- dest_w->gradients = src_w->gradients;
if (flags & MRN_FLAG_HIGHLIGHT_SHADE)
dest_w->highlight_shade = src_w->highlight_shade;
if (flags & MRN_FLAG_LIGHTBORDER_SHADE)
@@ -756,8 +836,6 @@ murrine_rc_style_merge (GtkRcStyle *dest,
dest_w->menuitemstyle = src_w->menuitemstyle;
if (flags & MRN_FLAG_MENUSTYLE)
dest_w->menustyle = src_w->menustyle;
- if (flags & MRN_FLAG_PROFILE)
- dest_w->profile = src_w->profile;
if (flags & MRN_FLAG_PROGRESSBARSTYLE)
dest_w->progressbarstyle = src_w->progressbarstyle;
if (flags & MRN_FLAG_RELIEFSTYLE)
@@ -766,15 +844,12 @@ murrine_rc_style_merge (GtkRcStyle *dest,
dest_w->rgba = src_w->rgba;
if (flags & MRN_FLAG_ROUNDNESS)
dest_w->roundness = src_w->roundness;
- if (flags & MRN_FLAG_SCROLLBAR_COLOR)
- {
- dest_w->has_scrollbar_color = TRUE;
- dest_w->scrollbar_color = src_w->scrollbar_color;
- }
if (flags & MRN_FLAG_SCROLLBARSTYLE)
dest_w->scrollbarstyle = src_w->scrollbarstyle;
if (flags & MRN_FLAG_SLIDERSTYLE)
dest_w->sliderstyle = src_w->sliderstyle;
+ if (flags & MRN_FLAG_SPINBUTTONSTYLE)
+ dest_w->spinbuttonstyle = src_w->spinbuttonstyle;
if (flags & MRN_FLAG_STEPPERSTYLE)
dest_w->stepperstyle = src_w->stepperstyle;
if (flags & MRN_FLAG_TEXTSTYLE)
@@ -783,6 +858,42 @@ murrine_rc_style_merge (GtkRcStyle *dest,
dest_w->toolbarstyle = src_w->toolbarstyle;
dest_w->flags |= src_w->flags;
+
+ gflags = (~dest_w->gflags) & src_w->gflags;
+
+ if (gflags & MRN_FLAG_BORDER_COLORS)
+ {
+ dest_w->has_border_colors = src_w->has_border_colors;
+ dest_w->border_colors[0] = src_w->border_colors[0];
+ dest_w->border_colors[1] = src_w->border_colors[1];
+ }
+ if (gflags & MRN_FLAG_BORDER_SHADES)
+ {
+ dest_w->border_shades[0] = src_w->border_shades[0];
+ dest_w->border_shades[1] = src_w->border_shades[1];
+ }
+ if (gflags & MRN_FLAG_GRADIENT_COLORS)
+ {
+ dest_w->has_gradient_colors = src_w->has_gradient_colors;
+ dest_w->gradient_colors[0] = src_w->gradient_colors[0];
+ dest_w->gradient_colors[1] = src_w->gradient_colors[1];
+ dest_w->gradient_colors[2] = src_w->gradient_colors[2];
+ dest_w->gradient_colors[3] = src_w->gradient_colors[3];
+ }
+ if (gflags & MRN_FLAG_GRADIENT_SHADES)
+ {
+ dest_w->gradient_shades[0] = src_w->gradient_shades[0];
+ dest_w->gradient_shades[1] = src_w->gradient_shades[1];
+ dest_w->gradient_shades[2] = src_w->gradient_shades[2];
+ dest_w->gradient_shades[3] = src_w->gradient_shades[3];
+ }
+ if (gflags & MRN_FLAG_TROUGH_SHADES)
+ {
+ dest_w->trough_shades[0] = src_w->trough_shades[0];
+ dest_w->trough_shades[1] = src_w->trough_shades[1];
+ }
+
+ dest_w->gflags |= src_w->gflags;
}
/* Create an empty style suitable to this RC style
diff --git a/src/murrine_rc_style.h b/src/murrine_rc_style.h
index 7b11e72..12b34c1 100644
--- a/src/murrine_rc_style.h
+++ b/src/murrine_rc_style.h
@@ -37,42 +37,49 @@ typedef enum
{
MRN_FLAG_ANIMATION = 1 << 0,
MRN_FLAG_ARROWSTYLE = 1 << 1,
- MRN_FLAG_BORDER_SHADES = 1 << 2,
- MRN_FLAG_COLORIZE_SCROLLBAR = 1 << 3,
+ MRN_FLAG_COLORIZE_SCROLLBAR = 1 << 2,
+ MRN_FLAG_COMBOBOXSTYLE = 1 << 3,
MRN_FLAG_CONTRAST = 1 << 4,
MRN_FLAG_FOCUS_COLOR = 1 << 5,
MRN_FLAG_GLAZESTYLE = 1 << 6,
MRN_FLAG_GLOW_SHADE = 1 << 7,
MRN_FLAG_GLOWSTYLE = 1 << 8,
- MRN_FLAG_GRADIENT_SHADES = 1 << 9,
- MRN_FLAG_GRADIENTS = 1 << 10,
- MRN_FLAG_HIGHLIGHT_SHADE = 1 << 11,
- MRN_FLAG_LIGHTBORDER_SHADE = 1 << 12,
- MRN_FLAG_LIGHTBORDERSTYLE= 1 << 13,
- MRN_FLAG_LISTVIEWHEADERSTYLE = 1 << 14,
- MRN_FLAG_LISTVIEWSTYLE = 1 << 15,
- MRN_FLAG_MENUBARITEMSTYLE = 1 << 16,
- MRN_FLAG_MENUBARSTYLE = 1 << 17,
- MRN_FLAG_MENUITEMSTYLE = 1 << 18,
- MRN_FLAG_MENUSTYLE = 1 << 19,
- MRN_FLAG_PROFILE = 1 << 20,
- MRN_FLAG_PROGRESSBARSTYLE = 1 << 21,
- MRN_FLAG_RELIEFSTYLE = 1 << 22,
- MRN_FLAG_RGBA = 1 << 23,
- MRN_FLAG_ROUNDNESS = 1 << 24,
- MRN_FLAG_SCROLLBAR_COLOR = 1 << 25,
- MRN_FLAG_SCROLLBARSTYLE = 1 << 26,
- MRN_FLAG_SLIDERSTYLE = 1 << 27,
- MRN_FLAG_STEPPERSTYLE = 1 << 28,
- MRN_FLAG_TEXTSTYLE = 1 << 29,
- MRN_FLAG_TOOLBARSTYLE = 1 << 30
+ MRN_FLAG_HIGHLIGHT_SHADE = 1 << 9,
+ MRN_FLAG_LIGHTBORDER_SHADE = 1 << 10,
+ MRN_FLAG_LIGHTBORDERSTYLE= 1 << 11,
+ MRN_FLAG_LISTVIEWHEADERSTYLE = 1 << 12,
+ MRN_FLAG_LISTVIEWSTYLE = 1 << 13,
+ MRN_FLAG_MENUBARITEMSTYLE = 1 << 14,
+ MRN_FLAG_MENUBARSTYLE = 1 << 15,
+ MRN_FLAG_MENUITEMSTYLE = 1 << 16,
+ MRN_FLAG_MENUSTYLE = 1 << 17,
+ MRN_FLAG_PROGRESSBARSTYLE = 1 << 18,
+ MRN_FLAG_RELIEFSTYLE = 1 << 19,
+ MRN_FLAG_RGBA = 1 << 20,
+ MRN_FLAG_ROUNDNESS = 1 << 21,
+ MRN_FLAG_SCROLLBARSTYLE = 1 << 22,
+ MRN_FLAG_SLIDERSTYLE = 1 << 23,
+ MRN_FLAG_SPINBUTTONSTYLE = 1 << 24,
+ MRN_FLAG_STEPPERSTYLE = 1 << 25,
+ MRN_FLAG_TEXTSTYLE = 1 << 26,
+ MRN_FLAG_TOOLBARSTYLE = 1 << 27,
} MurrineRcFlags;
+typedef enum
+{
+ MRN_FLAG_BORDER_COLORS = 1 << 1,
+ MRN_FLAG_BORDER_SHADES = 1 << 2,
+ MRN_FLAG_GRADIENT_COLORS = 1 << 3,
+ MRN_FLAG_GRADIENT_SHADES = 1 << 4,
+ MRN_FLAG_TROUGH_SHADES = 1 << 5
+} MurrineRcGradientFlags;
+
struct _MurrineRcStyle
{
GtkRcStyle parent_instance;
MurrineRcFlags flags;
+ MurrineRcGradientFlags gflags;
double border_shades[2];
double contrast;
@@ -80,8 +87,10 @@ struct _MurrineRcStyle
double gradient_shades[4];
double highlight_shade;
double lightborder_shade;
+ double trough_shades[2];
guint8 arrowstyle;
+ guint8 comboboxstyle;
guint8 glazestyle;
guint8 glowstyle;
guint8 lightborderstyle;
@@ -96,21 +105,20 @@ struct _MurrineRcStyle
guint8 roundness;
guint8 scrollbarstyle;
guint8 sliderstyle;
+ guint8 spinbuttonstyle;
guint8 stepperstyle;
guint8 textstyle;
guint8 toolbarstyle;
gboolean animation;
gboolean colorize_scrollbar;
- gboolean gradients;
- gboolean has_focus_color;
- gboolean has_scrollbar_color;
+ gboolean has_border_colors;
+ gboolean has_gradient_colors;
gboolean rgba;
+ GdkColor border_colors[2];
GdkColor focus_color;
- GdkColor scrollbar_color;
-
- MurrineProfiles profile;
+ GdkColor gradient_colors[4];
};
struct _MurrineRcStyleClass
diff --git a/src/murrine_style.c b/src/murrine_style.c
index fc31203..773549c 100644
--- a/src/murrine_style.c
+++ b/src/murrine_style.c
@@ -144,36 +144,76 @@ murrine_set_widget_parameters (const GtkWidget *widget,
params->roundness = murrine_style->roundness;
MurrineGradients mrn_gradient;
- if (murrine_style->gradients)
- {
- mrn_gradient.border_shades[0] = murrine_style->border_shades[0];
- mrn_gradient.border_shades[1] = murrine_style->border_shades[1];
-
- mrn_gradient.gradient_shades[0] = murrine_style->gradient_shades[0];
- mrn_gradient.gradient_shades[1] = murrine_style->gradient_shades[1];
- mrn_gradient.gradient_shades[2] = murrine_style->gradient_shades[2];
- mrn_gradient.gradient_shades[3] = murrine_style->gradient_shades[3];
+ mrn_gradient.border_shades[0] = murrine_style->border_shades[0];
+ mrn_gradient.border_shades[1] = murrine_style->border_shades[1];
+
+ mrn_gradient.gradient_shades[0] = murrine_style->gradient_shades[0];
+ mrn_gradient.gradient_shades[1] = murrine_style->gradient_shades[1];
+ mrn_gradient.gradient_shades[2] = murrine_style->gradient_shades[2];
+ mrn_gradient.gradient_shades[3] = murrine_style->gradient_shades[3];
+
+ if (murrine_style->has_gradient_colors && !params->disabled)
+ {
+ mrn_gradient.has_gradient_colors = TRUE;
+ murrine_gdk_color_to_rgb (&murrine_style->gradient_colors[0], &mrn_gradient.gradient_colors[0].r,
+ &mrn_gradient.gradient_colors[0].g,
+ &mrn_gradient.gradient_colors[0].b);
+ murrine_gdk_color_to_rgb (&murrine_style->gradient_colors[1], &mrn_gradient.gradient_colors[1].r,
+ &mrn_gradient.gradient_colors[1].g,
+ &mrn_gradient.gradient_colors[1].b);
+ murrine_gdk_color_to_rgb (&murrine_style->gradient_colors[2], &mrn_gradient.gradient_colors[2].r,
+ &mrn_gradient.gradient_colors[2].g,
+ &mrn_gradient.gradient_colors[2].b);
+ murrine_gdk_color_to_rgb (&murrine_style->gradient_colors[3], &mrn_gradient.gradient_colors[3].r,
+ &mrn_gradient.gradient_colors[3].g,
+ &mrn_gradient.gradient_colors[3].b);
+ if (params->prelight && !MRN_IS_PROGRESS_BAR(widget)) //progressbar is prelight, no change in shade
+ {
+ mrn_gradient.gradient_shades[0] *= 1.1;
+ mrn_gradient.gradient_shades[1] *= 1.1;
+ mrn_gradient.gradient_shades[2] *= 1.1;
+ mrn_gradient.gradient_shades[3] *= 1.1;
+ }
}
else
- {
- mrn_gradient.border_shades[0] = 1.0;
- mrn_gradient.border_shades[1] = 1.0;
+ mrn_gradient.has_gradient_colors = FALSE;
- mrn_gradient.gradient_shades[0] = 1.0;
- mrn_gradient.gradient_shades[1] = 1.0;
- mrn_gradient.gradient_shades[2] = 1.0;
- mrn_gradient.gradient_shades[3] = 1.0;
+ if (murrine_style->has_border_colors && !params->disabled)
+ {
+ mrn_gradient.has_border_colors = TRUE;
+ murrine_gdk_color_to_rgb (&murrine_style->border_colors[0], &mrn_gradient.border_colors[0].r,
+ &mrn_gradient.border_colors[0].g,
+ &mrn_gradient.border_colors[0].b);
+ murrine_gdk_color_to_rgb (&murrine_style->border_colors[1], &mrn_gradient.border_colors[1].r,
+ &mrn_gradient.border_colors[1].g,
+ &mrn_gradient.border_colors[1].b);
}
- mrn_gradient.gradients = murrine_style->gradients;
+ else
+ mrn_gradient.has_border_colors = FALSE;
+
+ mrn_gradient.trough_shades[0] = murrine_style->trough_shades[0];
+ mrn_gradient.trough_shades[1] = murrine_style->trough_shades[1];
+
+ if (murrine_style->border_shades[0] != 1.0 ||
+ murrine_style->border_shades[1] != 1.0 ||
+ murrine_style->gradient_shades[0] != 1.0 ||
+ murrine_style->gradient_shades[1] != 1.0 ||
+ murrine_style->gradient_shades[2] != 1.0 ||
+ murrine_style->gradient_shades[3] != 1.0 ||
+ murrine_style->trough_shades[0] != 1.0 ||
+ murrine_style->trough_shades[0] != 1.0)
+ mrn_gradient.gradients = TRUE;
+ else
+ mrn_gradient.gradients = FALSE;
+
mrn_gradient.use_rgba = (murrine_widget_is_rgba ((GtkWidget*) widget) &&
murrine_style->rgba);
mrn_gradient.rgba_opacity = GRADIENT_OPACITY;
MurrineStyles mrn_style = MRN_STYLE_MURRINE;
if (mrn_gradient.use_rgba)
- {
mrn_style = MRN_STYLE_RGBA;
- }
+
params->mrn_gradient = mrn_gradient;
params->style = mrn_style;
params->style_functions = &(MURRINE_STYLE_GET_CLASS (style)->style_functions[mrn_style]);
@@ -827,7 +867,17 @@ murrine_style_draw_box (DRAW_ARGS)
params.reliefstyle = 1;
}
- STYLE_FUNCTION(draw_button) (cr, &murrine_style->colors, ¶ms, x, y, width, height, horizontal);
+ if (!MRN_IS_COMBO_BOX(widget->parent) ||
+ MRN_IS_COMBO_BOX_ENTRY (widget->parent) ||
+ MRN_IS_COMBO (widget->parent))
+ STYLE_FUNCTION(draw_button) (cr, &murrine_style->colors, ¶ms, x, y, width, height, horizontal);
+ else
+ {
+ ComboBoxParameters combobox;
+ combobox.box_w = 24;
+ combobox.style = murrine_style->comboboxstyle;
+ STYLE_FUNCTION(draw_combobox) (cr, murrine_style->colors, params, &combobox, x, y, width, height, horizontal);
+ }
}
else if (DETAIL ("spinbutton_up") || DETAIL ("spinbutton_down"))
{
@@ -853,6 +903,8 @@ murrine_style_draw_box (DRAW_ARGS)
}
else
{
+ y--;
+ height++;
if (params.ltr)
params.corners = MRN_CORNER_BOTTOMRIGHT;
else
@@ -868,6 +920,7 @@ murrine_style_draw_box (DRAW_ARGS)
else if (DETAIL ("spinbutton"))
{
WidgetParameters params;
+ SpinbuttonParameters spinbutton;
/* The "spinbutton" box is always drawn with state NORMAL, even if it is insensitive.
* So work around this here. */
@@ -876,6 +929,8 @@ murrine_style_draw_box (DRAW_ARGS)
murrine_set_widget_parameters (widget, style, state_type, ¶ms);
+ spinbutton.style = murrine_style->spinbuttonstyle;
+
boolean horizontal = TRUE;
if (((float)width/height<0.5)|| (murrine_style->glazestyle > 0 && width<height))
horizontal = FALSE;
@@ -913,8 +968,7 @@ murrine_style_draw_box (DRAW_ARGS)
cairo_fill (cr);
}
- /* draw_spinbutton (cr, &murrine_style->colors, ¶ms, x, y, width, height); */
- STYLE_FUNCTION(draw_button) (cr, &murrine_style->colors, ¶ms, x, y, width, height, horizontal);
+ STYLE_FUNCTION(draw_spinbutton) (cr, &murrine_style->colors, ¶ms, &spinbutton, x, y, width, height, horizontal);
}
else if (detail && g_str_has_prefix (detail, "trough") && widget && MRN_IS_SCALE (widget))
{
@@ -935,6 +989,7 @@ murrine_style_draw_box (DRAW_ARGS)
else if (DETAIL ("trough") && widget && MRN_IS_PROGRESS_BAR (widget))
{
WidgetParameters params;
+ ProgressBarParameters progressbar;
murrine_set_widget_parameters (widget, style, state_type, ¶ms);
@@ -959,7 +1014,20 @@ murrine_style_draw_box (DRAW_ARGS)
}
}
- STYLE_FUNCTION(draw_progressbar_trough) (cr, colors, ¶ms, x, y, width, height);
+ if (widget && MRN_IS_PROGRESS_BAR (widget))
+ progressbar.orientation = gtk_progress_bar_get_orientation (GTK_PROGRESS_BAR (widget));
+ else
+ progressbar.orientation = MRN_ORIENTATION_LEFT_TO_RIGHT;
+
+ if (!params.ltr)
+ {
+ if (progressbar.orientation == GTK_PROGRESS_LEFT_TO_RIGHT)
+ progressbar.orientation = GTK_PROGRESS_RIGHT_TO_LEFT;
+ else if (progressbar.orientation == GTK_PROGRESS_RIGHT_TO_LEFT)
+ progressbar.orientation = GTK_PROGRESS_LEFT_TO_RIGHT;
+ }
+
+ STYLE_FUNCTION(draw_progressbar_trough) (cr, colors, ¶ms, &progressbar, x, y, width, height);
}
else if (DETAIL ("trough") && widget && (MRN_IS_VSCROLLBAR (widget) || MRN_IS_HSCROLLBAR (widget)))
{
@@ -1206,7 +1274,15 @@ murrine_style_draw_box (DRAW_ARGS)
murrine_set_widget_parameters (widget, style, state_type, ¶ms);
- STYLE_FUNCTION(draw_optionmenu) (cr, colors, ¶ms, &optionmenu, x, y, width, height);
+ if (murrine_style->comboboxstyle > 0)
+ {
+ ComboBoxParameters combobox;
+ combobox.box_w = indicator_size.width+indicator_spacing.left+indicator_spacing.right+3;
+ combobox.style = murrine_style->comboboxstyle;
+ STYLE_FUNCTION(draw_combobox) (cr, murrine_style->colors, params, &combobox, x, y, width, height, TRUE);
+ }
+ else
+ STYLE_FUNCTION(draw_optionmenu) (cr, colors, ¶ms, &optionmenu, x, y, width, height);
}
else if (DETAIL ("menuitem"))
{
@@ -1219,7 +1295,6 @@ murrine_style_draw_box (DRAW_ARGS)
if (murrine_style->menustyle != 1 || (MRN_IS_MENU_BAR (widget->parent) && !murrine_style->menubaritemstyle))
STYLE_FUNCTION(draw_menuitem) (cr, colors, ¶ms, x, y, width, height, murrine_style->menuitemstyle);
else
- /* little translation */ /* XXX: RTL */
STYLE_FUNCTION(draw_menuitem) (cr, colors, ¶ms, x+3, y, width-3, height, murrine_style->menuitemstyle);
}
@@ -1262,14 +1337,6 @@ murrine_style_draw_box (DRAW_ARGS)
if (!scrollbar.has_color)
scrollbar.color = colors->bg[0];
- if (murrine_style->has_scrollbar_color)
- {
- murrine_gdk_color_to_rgb (&murrine_style->scrollbar_color, &scrollbar.color.r,
- &scrollbar.color.g,
- &scrollbar.color.b);
- scrollbar.has_color = TRUE;
- }
-
murrine_set_widget_parameters (widget, style, state_type, ¶ms);
params.corners = MRN_CORNER_NONE;
@@ -1285,6 +1352,7 @@ murrine_style_draw_box (DRAW_ARGS)
if (trough_border > 0 ||
trough_under_steppers == 0 ||
+ scrollbar.stepperstyle == 2 ||
murrine_style->roundness == 1)
params.corners = MRN_CORNER_ALL;
else
@@ -1327,6 +1395,9 @@ murrine_style_draw_box (DRAW_ARGS)
if (within_bevel)
params.corners = MRN_CORNER_NONE;
+ if (scrollbar.stepperstyle == 2)
+ params.corners = MRN_CORNER_NONE;
+
if (murrine_style->stepperstyle != 1)
STYLE_FUNCTION(draw_scrollbar_stepper) (cr, colors, ¶ms, &scrollbar, x, y, width, height);
}
@@ -1564,8 +1635,6 @@ murrine_style_draw_vline (GtkStyle *style,
{
STYLE_FUNCTION(draw_separator) (cr, colors, NULL, &separator, x, y1, 2, y2-y1);
}
-/* else*/
-/* STYLE_FUNCTION(draw_combo_separator) (cr, colors, NULL, x, y1, 2, y2-y1);*/
cairo_destroy (cr);
}
@@ -1781,6 +1850,11 @@ murrine_style_draw_arrow (GtkStyle *style,
x = x + width / 2 - 2;
y = y + height / 2 - 1;
height = 4; width = 5;
+
+ if (arrow.direction == MRN_DIRECTION_UP)
+ y--;
+ if (arrow.direction == MRN_DIRECTION_DOWN)
+ y++;
}
else if (arrow.direction == MRN_DIRECTION_UP || arrow.direction == MRN_DIRECTION_DOWN)
{
@@ -1835,6 +1909,8 @@ murrine_style_draw_layout (GtkStyle *style,
if (GTK_WIDGET_NO_WINDOW (widget))
murrine_shade (¶ms.parentbg, 1.12, &temp);
+ else if (DETAIL ("cellrenderertext"))
+ murrine_shade (&colors->base[widget->state], 1.12, &temp);
else
murrine_shade (&colors->bg[widget->state], 1.12, &temp);
@@ -1845,7 +1921,7 @@ murrine_style_draw_layout (GtkStyle *style,
gdk_draw_layout_with_colors (window, gc, x+1, y+1, layout, &etched, NULL);
gdk_draw_layout (window, gc, x, y, layout);
}
- else
+ else
{
MurrineStyle *murrine_style = MURRINE_STYLE (style);
MurrineColors *colors = &murrine_style->colors;
@@ -1860,9 +1936,9 @@ murrine_style_draw_layout (GtkStyle *style,
MurrineRGB temp;
if (GTK_WIDGET_NO_WINDOW (widget))
- murrine_shade (¶ms.parentbg, 1.05, &temp);
+ murrine_shade (¶ms.parentbg, 1.06, &temp);
else
- murrine_shade (&colors->bg[widget->state], 1.05, &temp);
+ murrine_shade (&colors->bg[widget->state], 1.06, &temp);
etched.red = (int) (temp.r*65535);
etched.green = (int) (temp.g*65535);
@@ -2151,6 +2227,8 @@ murrine_style_init_from_rc (GtkStyle *style,
/* Adjust lightborder_shade reading contrast */
murrine_style->lightborder_shade = get_contrast(MURRINE_RC_STYLE (rc_style)->lightborder_shade,
MURRINE_RC_STYLE (rc_style)->contrast);
+ murrine_style->trough_shades[0] = MURRINE_RC_STYLE (rc_style)->trough_shades[0];
+ murrine_style->trough_shades[1] = MURRINE_RC_STYLE (rc_style)->trough_shades[1];
/* Widget styles */
murrine_style->glazestyle = MURRINE_RC_STYLE (rc_style)->glazestyle;
@@ -2165,12 +2243,13 @@ murrine_style_init_from_rc (GtkStyle *style,
murrine_style->roundness = MURRINE_RC_STYLE (rc_style)->roundness;
murrine_style->animation = MURRINE_RC_STYLE (rc_style)->animation;
murrine_style->arrowstyle = MURRINE_RC_STYLE (rc_style)->arrowstyle;
+ murrine_style->comboboxstyle = MURRINE_RC_STYLE (rc_style)->comboboxstyle;
murrine_style->contrast = MURRINE_RC_STYLE (rc_style)->contrast;
murrine_style->colorize_scrollbar = MURRINE_RC_STYLE (rc_style)->colorize_scrollbar;
- murrine_style->has_focus_color = MURRINE_RC_STYLE (rc_style)->has_focus_color;
+ murrine_style->has_border_colors = MURRINE_RC_STYLE (rc_style)->has_border_colors;
+ murrine_style->has_focus_color = MURRINE_RC_STYLE (rc_style)->flags & MRN_FLAG_FOCUS_COLOR;
+ murrine_style->has_gradient_colors = MURRINE_RC_STYLE (rc_style)->has_gradient_colors;
murrine_style->glowstyle = MURRINE_RC_STYLE (rc_style)->glowstyle;
- murrine_style->gradients = MURRINE_RC_STYLE (rc_style)->gradients;
- murrine_style->has_scrollbar_color = MURRINE_RC_STYLE (rc_style)->has_scrollbar_color;
murrine_style->lightborderstyle = MURRINE_RC_STYLE (rc_style)->lightborderstyle;
murrine_style->listviewheaderstyle = MURRINE_RC_STYLE (rc_style)->listviewheaderstyle;
murrine_style->listviewstyle = MURRINE_RC_STYLE (rc_style)->listviewstyle;
@@ -2183,78 +2262,25 @@ murrine_style_init_from_rc (GtkStyle *style,
murrine_style->rgba = MURRINE_RC_STYLE (rc_style)->rgba;
murrine_style->scrollbarstyle = MURRINE_RC_STYLE (rc_style)->scrollbarstyle;
murrine_style->sliderstyle = MURRINE_RC_STYLE (rc_style)->sliderstyle;
+ murrine_style->spinbuttonstyle = MURRINE_RC_STYLE (rc_style)->spinbuttonstyle;
murrine_style->stepperstyle = MURRINE_RC_STYLE (rc_style)->stepperstyle;
- murrine_style->textstyle = MURRINE_RC_STYLE (rc_style)->textstyle;
+ murrine_style->textstyle = MURRINE_RC_STYLE (rc_style)->textstyle;
murrine_style->toolbarstyle = MURRINE_RC_STYLE (rc_style)->toolbarstyle;
+ if (murrine_style->has_border_colors)
+ {
+ murrine_style->border_colors[0] = MURRINE_RC_STYLE (rc_style)->border_colors[0];
+ murrine_style->border_colors[1] = MURRINE_RC_STYLE (rc_style)->border_colors[1];
+ }
if (murrine_style->has_focus_color)
murrine_style->focus_color = MURRINE_RC_STYLE (rc_style)->focus_color;
- if (murrine_style->has_scrollbar_color)
- murrine_style->scrollbar_color = MURRINE_RC_STYLE (rc_style)->scrollbar_color;
-
- g_assert ((MURRINE_RC_STYLE (rc_style)->profile >= 0) &&
- (MURRINE_RC_STYLE (rc_style)->profile < MRN_NUM_PROFILES));
- murrine_style->profile = MURRINE_RC_STYLE (rc_style)->profile;
-
- switch (murrine_style->profile)
- {
- case (MRN_PROFILE_NODOKA):
- murrine_style->highlight_shade = 1.0;
- murrine_style->gradients = TRUE;
- murrine_style->gradient_shades[0] = 1.1;
- murrine_style->gradient_shades[1] = 1.0;
- murrine_style->gradient_shades[2] = 1.0;
- murrine_style->gradient_shades[3] = 1.1;
- murrine_style->sliderstyle = 1;
- murrine_style->scrollbarstyle = 2;
- murrine_style->stepperstyle = 0;
- murrine_style->colorize_scrollbar = FALSE;
- murrine_style->has_scrollbar_color = FALSE;
- break;
- case (MRN_PROFILE_MIST):
- murrine_style->highlight_shade = 1.0;
- murrine_style->glazestyle = 0;
- murrine_style->gradients = FALSE;
- murrine_style->gradient_shades[0] = 1.0;
- murrine_style->gradient_shades[1] = 1.0;
- murrine_style->gradient_shades[2] = 1.0;
- murrine_style->gradient_shades[3] = 1.0;
- murrine_style->lightborder_shade = 1.00;
- murrine_style->sliderstyle = 1;
- murrine_style->scrollbarstyle = 0;
- murrine_style->stepperstyle = 0;
- murrine_style->colorize_scrollbar = FALSE;
- murrine_style->has_scrollbar_color = FALSE;
- murrine_style->reliefstyle = 0;
- murrine_style->roundness = 0;
- break;
- case (MRN_PROFILE_CANDIDO):
- murrine_style->highlight_shade = 1.0;
- murrine_style->lightborder_shade = 1.06;
- murrine_style->glazestyle = 0;
- murrine_style->gradients = TRUE;
- murrine_style->gradient_shades[0] = 1.01;
- murrine_style->gradient_shades[1] = 0.99;
- murrine_style->gradient_shades[2] = 0.99;
- murrine_style->gradient_shades[3] = 0.97;
- murrine_style->reliefstyle = 0;
- break;
- case (MRN_PROFILE_CLEARLOOKS):
- murrine_style->glazestyle = 0;
- murrine_style->gradient_shades[0] = 1.08;
- murrine_style->gradient_shades[1] = 1.02;
- murrine_style->gradient_shades[2] = 1.00;
- murrine_style->gradient_shades[3] = 0.94;
- murrine_style->gradients = TRUE;
- murrine_style->highlight_shade = 1.0;
- murrine_style->toolbarstyle = 1;
- murrine_style->lightborder_shade = 1.02;
- murrine_style->listviewheaderstyle = 1;
- murrine_style->menustyle = 0;
- murrine_style->sliderstyle = 1;
- murrine_style->scrollbarstyle = 2;
- break;
- };
+ if (murrine_style->has_gradient_colors)
+ {
+ murrine_style->gradient_colors[0] = MURRINE_RC_STYLE (rc_style)->gradient_colors[0];
+ murrine_style->gradient_colors[1] = MURRINE_RC_STYLE (rc_style)->gradient_colors[1];
+ murrine_style->gradient_colors[2] = MURRINE_RC_STYLE (rc_style)->gradient_colors[2];
+ murrine_style->gradient_colors[3] = MURRINE_RC_STYLE (rc_style)->gradient_colors[3];
+ }
}
static void
@@ -2340,22 +2366,29 @@ murrine_style_copy (GtkStyle *style, GtkStyle *src)
mrn_style->animation = mrn_src->animation;
mrn_style->arrowstyle = mrn_src->arrowstyle;
+ mrn_style->border_colors[0] = mrn_src->border_colors[0];
+ mrn_style->border_colors[1] = mrn_src->border_colors[1];
mrn_style->border_shades[0] = mrn_src->border_shades[0];
mrn_style->border_shades[1] = mrn_src->border_shades[1];
mrn_style->colorize_scrollbar = mrn_src->colorize_scrollbar;
mrn_style->colors = mrn_src->colors;
+ mrn_style->comboboxstyle = mrn_src->comboboxstyle;
mrn_style->contrast = mrn_src->contrast;
mrn_style->focus_color = mrn_src->focus_color;
mrn_style->glazestyle = mrn_src->glazestyle;
mrn_style->glow_shade = mrn_src->glow_shade;
mrn_style->glowstyle = mrn_src->glowstyle;
+ mrn_style->gradient_colors[0] = mrn_src->gradient_colors[0];
+ mrn_style->gradient_colors[1] = mrn_src->gradient_colors[1];
+ mrn_style->gradient_colors[2] = mrn_src->gradient_colors[2];
+ mrn_style->gradient_colors[3] = mrn_src->gradient_colors[3];
mrn_style->gradient_shades[0] = mrn_src->gradient_shades[0];
mrn_style->gradient_shades[1] = mrn_src->gradient_shades[1];
mrn_style->gradient_shades[2] = mrn_src->gradient_shades[2];
mrn_style->gradient_shades[3] = mrn_src->gradient_shades[3];
- mrn_style->gradients = mrn_src->gradients;
+ mrn_style->has_border_colors = mrn_src->has_border_colors;
mrn_style->has_focus_color = mrn_src->has_focus_color;
- mrn_style->has_scrollbar_color = mrn_src->has_scrollbar_color;
+ mrn_style->has_gradient_colors = mrn_src->has_gradient_colors;
mrn_style->highlight_shade = mrn_src->highlight_shade;
mrn_style->lightborder_shade = mrn_src->lightborder_shade;
mrn_style->lightborderstyle = mrn_src->lightborderstyle;
@@ -2365,17 +2398,18 @@ murrine_style_copy (GtkStyle *style, GtkStyle *src)
mrn_style->menubarstyle = mrn_src->menubarstyle;
mrn_style->menuitemstyle = mrn_src->menuitemstyle;
mrn_style->menustyle = mrn_src->menustyle;
- mrn_style->profile = mrn_src->profile;
mrn_style->progressbarstyle = mrn_src->progressbarstyle;
mrn_style->reliefstyle = mrn_src->reliefstyle;
mrn_style->rgba = mrn_src->rgba;
mrn_style->roundness = mrn_src->roundness;
- mrn_style->scrollbar_color = mrn_src->scrollbar_color;
mrn_style->scrollbarstyle = mrn_src->scrollbarstyle;
mrn_style->sliderstyle = mrn_src->sliderstyle;
+ mrn_style->spinbuttonstyle = mrn_src->spinbuttonstyle;
mrn_style->stepperstyle = mrn_src->stepperstyle;
mrn_style->textstyle = mrn_src->textstyle;
mrn_style->toolbarstyle = mrn_src->toolbarstyle;
+ mrn_style->trough_shades[0] = mrn_src->trough_shades[0];
+ mrn_style->trough_shades[1] = mrn_src->trough_shades[1];
GTK_STYLE_CLASS (murrine_style_parent_class)->copy (style, src);
}
diff --git a/src/murrine_style.h b/src/murrine_style.h
index 70d8d08..baeb895 100644
--- a/src/murrine_style.h
+++ b/src/murrine_style.h
@@ -42,16 +42,16 @@ struct _MurrineStyle
MurrineColors colors;
- MurrineProfiles profile;
-
double border_shades[2];
double contrast;
double glow_shade;
double gradient_shades[4];
double highlight_shade;
double lightborder_shade;
+ double trough_shades[2];
guint8 arrowstyle;
+ guint8 comboboxstyle;
guint8 glazestyle;
guint8 glowstyle;
guint8 lightborderstyle;
@@ -66,19 +66,21 @@ struct _MurrineStyle
guint8 roundness;
guint8 scrollbarstyle;
guint8 sliderstyle;
+ guint8 spinbuttonstyle;
guint8 stepperstyle;
guint8 textstyle;
guint8 toolbarstyle;
gboolean animation;
gboolean colorize_scrollbar;
- gboolean gradients;
+ gboolean has_border_colors;
gboolean has_focus_color;
- gboolean has_scrollbar_color;
+ gboolean has_gradient_colors;
gboolean rgba;
+ GdkColor border_colors[2];
GdkColor focus_color;
- GdkColor scrollbar_color;
+ GdkColor gradient_colors[4];
};
struct _MurrineStyleClass
diff --git a/src/murrine_theme_main.c b/src/murrine_theme_main.c
index f8d81ad..e4a24a9 100644
--- a/src/murrine_theme_main.c
+++ b/src/murrine_theme_main.c
@@ -27,6 +27,7 @@
G_MODULE_EXPORT void
theme_init (GTypeModule *module)
{
+ printf ("Murrine 0.91.x Development Snapshot, Copyright Andrea Cimitan\n");
murrine_rc_style_register_types (module);
murrine_style_register_types (module);
}
diff --git a/src/murrine_types.h b/src/murrine_types.h
index da22b96..033a5b4 100644
--- a/src/murrine_types.h
+++ b/src/murrine_types.h
@@ -27,16 +27,6 @@ typedef struct _MurrineStyleFunctions MurrineStyleFunctions;
typedef enum
{
- MRN_PROFILE_MURRINE = 0,
- MRN_PROFILE_NODOKA = 1,
- MRN_PROFILE_MIST = 2,
- MRN_PROFILE_CANDIDO = 3,
- MRN_PROFILE_CLEARLOOKS = 4,
- MRN_NUM_PROFILES = 5
-} MurrineProfiles;
-
-typedef enum
-{
MRN_STYLE_MURRINE = 0,
MRN_STYLE_RGBA = 1,
MRN_NUM_DRAW_STYLES = 2
@@ -194,9 +184,15 @@ typedef struct
{
double border_shades[2];
double gradient_shades[4];
+ double trough_shades[4];
double rgba_opacity;
+ MurrineRGB border_colors[4];
+ MurrineRGB gradient_colors[4];
+
+ boolean has_border_colors;
boolean gradients;
+ boolean has_gradient_colors;
boolean use_rgba;
} MurrineGradients;
@@ -232,6 +228,12 @@ typedef struct
typedef struct
{
+ int box_w;
+ int style;
+} ComboBoxParameters;
+
+typedef struct
+{
MurrineFocusType type;
MurrineContinue continue_side;
MurrineRGB color;
@@ -337,6 +339,11 @@ typedef struct
typedef struct
{
+ int style;
+} SpinbuttonParameters;
+
+typedef struct
+{
MurrineArrowType type;
MurrineDirection direction;
int style;
@@ -361,6 +368,13 @@ struct _MurrineStyleFunctions
int x, int y, int width, int height,
boolean vertical);
+ void (*draw_combobox) (cairo_t *cr,
+ MurrineColors colors,
+ WidgetParameters widget,
+ const ComboBoxParameters *combobox,
+ int x, int y, int width, int height,
+ boolean vertical);
+
void (*draw_scale_trough) (cairo_t *cr,
const MurrineColors *colors,
const WidgetParameters *widget,
@@ -376,6 +390,7 @@ struct _MurrineStyleFunctions
void (*draw_progressbar_trough) (cairo_t *cr,
const MurrineColors *colors,
const WidgetParameters *widget,
+ const ProgressBarParameters *progressbar,
int x, int y, int width, int height);
void (*draw_progressbar_fill) (cairo_t *cr,
@@ -400,7 +415,9 @@ struct _MurrineStyleFunctions
void (*draw_spinbutton) (cairo_t *cr,
const MurrineColors *colors,
const WidgetParameters *widget,
- int x, int y, int width, int height);
+ const SpinbuttonParameters *spinbutton,
+ int x, int y, int width, int height,
+ boolean horizontal);
void (*draw_spinbutton_down) (cairo_t *cr,
const MurrineColors *colors,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]