Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
ChangeLog
Browse files Browse the repository at this point in the history
  • Loading branch information
cimitan committed Sep 10, 2009
1 parent c878158 commit c386137
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 45 deletions.
8 changes: 4 additions & 4 deletions schema/murrine.xml.in.in
Expand Up @@ -28,7 +28,7 @@
<section>General</section>
<minimum>0</minimum>
<maximum>2</maximum>
<precision>0.1</precision>
<precision>2</precision>
</option>

<option type="color" name="focus_color" default="#000000">
Expand Down Expand Up @@ -64,7 +64,7 @@
<section>General</section>
<minimum>0</minimum>
<maximum>2</maximum>
<precision>0.1</precision>
<precision>2</precision>
</option>

<option type="enumeration" name="glowstyle" default="0">
Expand Down Expand Up @@ -99,7 +99,7 @@
<section>General</section>
<minimum>0</minimum>
<maximum>2</maximum>
<precision>0.01</precision>
<precision>2</precision>
</option>

<option type="real" name="lightborder_shade" default="1.1">
Expand All @@ -108,7 +108,7 @@
<section>General</section>
<minimum>0</minimum>
<maximum>2</maximum>
<precision>0.01</precision>
<precision>2</precision>
</option>

<option type="enumeration" name="lightborderstyle" default="0">
Expand Down
61 changes: 40 additions & 21 deletions src/murrine_draw.c
Expand Up @@ -397,13 +397,13 @@ murrine_scale_draw_gradient (cairo_t *cr,
const MurrineRGB *c2,
double lightborder_shade,
int x, int y, int width, int height,
boolean alpha, boolean horizontal)
boolean horizontal)
{
murrine_set_color_rgba (cr, c1, alpha ? 0.44 : 1.0);
murrine_set_color_rgb (cr, c1);
cairo_rectangle (cr, x, y, width, height);
cairo_fill (cr);

murrine_set_color_rgba (cr, c2, 0.8);
murrine_set_color_rgb (cr, c2);
cairo_rectangle (cr, x, y, width, height);
cairo_stroke (cr);

Expand Down Expand Up @@ -468,20 +468,21 @@ murrine_draw_scale_trough (cairo_t *cr,

if (!slider->lower && !slider->fill_level)
{
MurrineRGB fill;
murrine_shade (&widget->parentbg, 0.95, &fill);
MurrineRGB fill, border;
murrine_shade (&colors->bg[widget->state_type], 1.0, &fill);
murrine_shade (&colors->bg[GTK_STATE_ACTIVE], get_contrast(0.82, widget->contrast), &border);

murrine_scale_draw_gradient (cr, &fill, &colors->shade[4],
murrine_scale_draw_gradient (cr, &fill, &border,
1.0,
1.0, 1.0, trough_width-2, trough_height-2,
TRUE, slider->horizontal);
slider->horizontal);
}
else
{
murrine_scale_draw_gradient (cr, &colors->spot[1], &colors->spot[2],
widget->disabled ? 1.0 : widget->lightborder_shade,
1.0, 1.0, trough_width-2, trough_height-2,
FALSE, slider->horizontal);
slider->horizontal);
}

cairo_restore (cr);
Expand Down Expand Up @@ -527,28 +528,28 @@ murrine_draw_progressbar_trough (cairo_t *cr,
const WidgetParameters *widget,
int x, int y, int width, int height)
{
const MurrineRGB *border = &colors->shade[4];
MurrineRGB fill;
MurrineRGB border, fill;
int roundness = MIN (widget->roundness, MIN ((height-2.0)/2.0, (width-2.0)/2.0));

murrine_shade (&widget->parentbg, 0.95, &fill);
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.44);
murrine_set_color_rgb (cr, &fill);
cairo_fill (cr);

/* 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.74);
murrine_set_color_rgb (cr, &border);
cairo_stroke (cr);

if (widget->mrn_gradient.gradients)
{
cairo_pattern_t *pat;
MurrineRGB shadow;

murrine_shade (border, 0.94, &shadow);
murrine_shade (&border, 0.94, &shadow);

/* clip the corners of the shadows */
murrine_rounded_rectangle_closed (cr, x+1, y+1, width-2, height-2, roundness, widget->corners);
Expand Down Expand Up @@ -1414,11 +1415,21 @@ murrine_draw_scrollbar_trough (cairo_t *cr,
const ScrollBarParameters *scrollbar,
int x, int y, int width, int height)
{
const MurrineRGB *border = &colors->shade[scrollbar->stepperstyle < 1 ? 3 : 4];
MurrineRGB border;
MurrineRGB fill;

murrine_shade (&widget->parentbg, scrollbar->stepperstyle < 1 ? 0.95 : 1.065, &fill);

murrine_shade (&widget->parentbg,
get_contrast (scrollbar->stepperstyle < 1 ? 0.86 : 0.8, widget->contrast),
&border);
murrine_shade (&widget->parentbg, scrollbar->stepperstyle < 1 ? 0.97 : 1.026, &fill);
/*
murrine_shade (&colors->bg[widget->state_type],
get_contrast (scrollbar->stepperstyle < 1 ? 0.86 : 0.8, widget->contrast),
&border_bg);
murrine_shade (&colors->bg[widget->state_type], scrollbar->stepperstyle < 1 ? 0.97 : 1.026, &fill_bg);
murrine_mix_color (&border_bg, &border, 0.5, &border);
murrine_mix_color (&fill_bg, &fill, 0.5, &fill);
*/
if (!scrollbar->horizontal)
{
cairo_translate (cr, x, y);
Expand All @@ -1432,13 +1443,21 @@ murrine_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);
murrine_set_color_rgb (cr, &fill);
clearlooks_rounded_rectangle (cr, 0, 0, width, height, widget->roundness, widget->corners);
cairo_fill (cr);

/* Draw border */
murrine_set_color_rgba (cr, border, 0.8);
murrine_rounded_rectangle (cr, 0.5, 0.5, width-1, height-1, widget->roundness, widget->corners);
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);
else
{
cairo_move_to (cr, 0.5, 0);
cairo_line_to (cr, 0.5, height);
/* cairo_move_to (cr, width-0.5, 0);*/
/* cairo_line_to (cr, width-0.5, height);*/
}
cairo_stroke (cr);
}

Expand Down
34 changes: 19 additions & 15 deletions src/murrine_draw_rgba.c
Expand Up @@ -309,13 +309,13 @@ murrine_scale_draw_gradient (cairo_t *cr,
const MurrineRGB *c2,
double lightborder_shade,
int x, int y, int width, int height,
boolean alpha, boolean horizontal)
boolean horizontal)
{
murrine_set_color_rgba (cr, c1, alpha ? 0.46 : 1.0);
murrine_set_color_rgb (cr, c1);
cairo_rectangle (cr, x, y, width, height);
cairo_fill (cr);

murrine_set_color_rgba (cr, c2, 0.82);
murrine_set_color_rgb (cr, c2);
cairo_rectangle (cr, x, y, width, height);
cairo_stroke (cr);

Expand Down Expand Up @@ -380,20 +380,21 @@ murrine_rgba_draw_scale_trough (cairo_t *cr,

if (!slider->lower && !slider->fill_level)
{
MurrineRGB fill;
murrine_shade (&widget->parentbg, 0.95, &fill);
MurrineRGB fill, border;
murrine_shade (&colors->bg[widget->state_type], 1.0, &fill);
murrine_shade (&colors->bg[GTK_STATE_ACTIVE], get_contrast(0.82, widget->contrast), &border);

murrine_scale_draw_gradient (cr, &fill, &colors->shade[5],
murrine_scale_draw_gradient (cr, &fill, &border,
1.0,
1.0, 1.0, trough_width-2, trough_height-2,
TRUE, slider->horizontal);
slider->horizontal);
}
else
{
murrine_scale_draw_gradient (cr, &colors->spot[1], &colors->spot[2],
widget->disabled ? 1.0 : widget->lightborder_shade,
1.0, 1.0, trough_width-2, trough_height-2,
FALSE, slider->horizontal);
slider->horizontal);
}

cairo_restore (cr);
Expand All @@ -405,11 +406,11 @@ murrine_rgba_draw_progressbar_trough (cairo_t *cr,
const WidgetParameters *widget,
int x, int y, int width, int height)
{
const MurrineRGB *border = &colors->shade[4];
MurrineRGB fill;
MurrineRGB border, fill;
int roundness = MIN (widget->roundness, MIN ((height-2.0)/2.0, (width-2.0)/2.0));

murrine_shade (&widget->parentbg, 0.95, &fill);
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);
Expand All @@ -418,15 +419,15 @@ murrine_rgba_draw_progressbar_trough (cairo_t *cr,

/* 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);
murrine_set_color_rgba (cr, &border, 0.8);
cairo_stroke (cr);

if (widget->mrn_gradient.gradients)
{
cairo_pattern_t *pat;
MurrineRGB shadow;

murrine_shade (border, 0.94, &shadow);
murrine_shade (&border, 0.94, &shadow);

/* clip the corners of the shadows */
murrine_rounded_rectangle_closed (cr, x+1, y+1, width-2, height-2, roundness, widget->corners);
Expand Down Expand Up @@ -1136,9 +1137,12 @@ murrine_rgba_draw_scrollbar_trough (cairo_t *cr,
const ScrollBarParameters *scrollbar,
int x, int y, int width, int height)
{
const MurrineRGB *border = &colors->shade[scrollbar->stepperstyle < 1 ? 4 : 5];
MurrineRGB border;
MurrineRGB fill;

murrine_shade (&widget->parentbg,
get_contrast (scrollbar->stepperstyle < 1 ? 0.82 : 0.75, widget->contrast),
&border);
murrine_shade (&widget->parentbg, scrollbar->stepperstyle < 1 ? 0.95 : 1.065, &fill);

if (!scrollbar->horizontal)
Expand All @@ -1159,7 +1163,7 @@ murrine_rgba_draw_scrollbar_trough (cairo_t *cr,
cairo_fill (cr);

/* Draw border */
murrine_set_color_rgba (cr, border, 0.82);
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);
}
Expand Down
23 changes: 19 additions & 4 deletions src/murrine_style.c
Expand Up @@ -130,12 +130,10 @@ murrine_set_widget_parameters (const GtkWidget *widget,
params->focus = widget && GTK_WIDGET_HAS_FOCUS (widget);
params->is_default = widget && GTK_WIDGET_HAS_DEFAULT (widget);

if (!params->active && widget && MRN_IS_TOGGLE_BUTTON (widget))
params->active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));

params->xthickness = style->xthickness;
params->ythickness = style->ythickness;

params->contrast = murrine_style->contrast;
params->glazestyle = murrine_style->glazestyle;
params->glow_shade = murrine_style->glow_shade;
params->glowstyle = murrine_style->glowstyle;
Expand Down Expand Up @@ -957,14 +955,22 @@ murrine_style_draw_box (DRAW_ARGS)
{
WidgetParameters params;
ScrollBarParameters scrollbar;
boolean within_bevel = FALSE;

if (widget->parent && MRN_IS_SCROLLED_WINDOW (widget->parent))
gtk_widget_style_get (widget->parent, "scrollbars-within-bevel", &within_bevel, NULL);

scrollbar.horizontal = TRUE;
scrollbar.junction = murrine_scrollbar_get_junction (widget);
scrollbar.steppers = murrine_scrollbar_visible_steppers (widget);
scrollbar.stepperstyle = murrine_style->stepperstyle;
scrollbar.within_bevel = within_bevel;

murrine_set_widget_parameters (widget, style, state_type, &params);

if (within_bevel)
params.corners = MRN_CORNER_NONE;

if (MRN_IS_RANGE (widget))
scrollbar.horizontal = GTK_RANGE (widget)->orientation == GTK_ORIENTATION_HORIZONTAL;

Expand Down Expand Up @@ -1225,6 +1231,7 @@ murrine_style_draw_box (DRAW_ARGS)
{
WidgetParameters params;
ScrollBarParameters scrollbar;
boolean within_bevel = FALSE;

scrollbar.has_color = FALSE;
scrollbar.horizontal = TRUE;
Expand Down Expand Up @@ -1304,6 +1311,12 @@ murrine_style_draw_box (DRAW_ARGS)
else
params.corners = MRN_CORNER_NONE;

if (widget->parent && MRN_IS_SCROLLED_WINDOW (widget->parent))
gtk_widget_style_get (widget->parent, "scrollbars-within-bevel", &within_bevel, NULL);

if (within_bevel)
params.corners = MRN_CORNER_NONE;

if (murrine_style->stepperstyle != 1)
STYLE_FUNCTION(draw_scrollbar_stepper) (cr, colors, &params, &scrollbar, x, y, width, height);
}
Expand Down Expand Up @@ -1819,6 +1832,7 @@ murrine_style_init_from_rc (GtkStyle *style,
else
murrine_style->roundness = MURRINE_RC_STYLE (rc_style)->roundness;
murrine_style->animation = MURRINE_RC_STYLE (rc_style)->animation;
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->glowstyle = MURRINE_RC_STYLE (rc_style)->glowstyle;
Expand Down Expand Up @@ -2164,7 +2178,8 @@ murrine_style_copy (GtkStyle *style, GtkStyle *src)
mrn_style->animation = mrn_src->animation;
mrn_style->colorize_scrollbar = mrn_src->colorize_scrollbar;
mrn_style->colors = mrn_src->colors;
mrn_style->focus_color = mrn_src->focus_color;
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;
Expand Down
2 changes: 2 additions & 0 deletions src/murrine_types.h
Expand Up @@ -219,6 +219,7 @@ typedef struct
int lightborderstyle;
int reliefstyle;
int roundness;
double contrast;
double glow_shade;
double highlight_shade;
double lightborder_shade;
Expand Down Expand Up @@ -317,6 +318,7 @@ typedef struct
MurrineStepper steppers; /* The visible steppers */
boolean horizontal;
boolean has_color;
boolean within_bevel;
int style;
int stepperstyle;
} ScrollBarParameters;
Expand Down
4 changes: 3 additions & 1 deletion src/support.h
Expand Up @@ -84,7 +84,9 @@
#define MRN_IS_CHECK_MENU_ITEM(object) ((object) && murrine_object_is_a ((GObject*)(object), "GtkCheckMenuItem"))

#define MRN_IS_RANGE(object) ((object) && murrine_object_is_a ((GObject*)(object), "GtkRange"))


#define MRN_IS_SCROLLED_WINDOW(object) ((object) && murrine_object_is_a ((GObject*)(object), "GtkScrolledWindow"))

#define MRN_IS_SCROLLBAR(object) ((object) && murrine_object_is_a ((GObject*)(object), "GtkScrollbar"))
#define MRN_IS_VSCROLLBAR(object) ((object) && murrine_object_is_a ((GObject*)(object), "GtkVScrollbar"))
#define MRN_IS_HSCROLLBAR(object) ((object) && murrine_object_is_a ((GObject*)(object), "GtkHScrollbar"))
Expand Down

0 comments on commit c386137

Please sign in to comment.