[murrine] textstyle = 2 for an inverted inset on the text (use carefully). textstyle = 3 for a subtle shadow o
- From: Andrea Cimitan <acimitan src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [murrine] textstyle = 2 for an inverted inset on the text (use carefully). textstyle = 3 for a subtle shadow o
- Date: Fri, 19 Mar 2010 11:47:12 +0000 (UTC)
commit e46c189ebe2372319b40e2301df0cdebf601c8e4
Author: Andrea <andrea cimitan gmail com>
Date: Fri Mar 19 13:46:45 2010 +0100
textstyle = 2 for an inverted inset on the text (use carefully).
textstyle = 3 for a subtle shadow on the text (use carefully).
NEWS | 4 +++-
schema/murrine.xml.in.in | 6 ++++++
src/murrine_style.c | 37 +++++++++++++++++++++++++++++--------
3 files changed, 38 insertions(+), 9 deletions(-)
---
diff --git a/NEWS b/NEWS
index e04ac76..cfd4851 100644
--- a/NEWS
+++ b/NEWS
@@ -19,7 +19,9 @@ Changes in this release:
- New option: shadow_shades = { 1.0, 1.0 } to draw a gradient on
the shadow of some widgets.
- New option: spinbuttonstyle = 1 to add a separator on the GtkSpinButton.
-- New option: textstyle = 1 to draw an inset on the text (use carefully).
+- New option: textstyle = 1 for an inset on the text (use carefully).
+ textstyle = 2 for an inverted inset on the text (use carefully).
+ textstyle = 3 for a subtle shadow on the text (use carefully).
- New option: trough_shades = { 1.0, 1.0 } to draw a gradient on
the trough of GtkScrollbar and GtkProgressBar.
- Changed option: listviewstyle = 2 for a solid line.
diff --git a/schema/murrine.xml.in.in b/schema/murrine.xml.in.in
index 64d4bc8..06a227b 100644
--- a/schema/murrine.xml.in.in
+++ b/schema/murrine.xml.in.in
@@ -355,6 +355,12 @@
<enumeration value="1">
<label>Add inset</label>
</enumeration>
+ <enumeration value="2">
+ <label>Add inverted inset</label>
+ </enumeration>
+ <enumeration value="3">
+ <label>Add shadow</label>
+ </enumeration>
</option>
<option type="enumeration" name="toolbarstyle" default="0">
diff --git a/src/murrine_style.c b/src/murrine_style.c
index 9ea78f2..e34b65a 100644
--- a/src/murrine_style.c
+++ b/src/murrine_style.c
@@ -1965,11 +1965,11 @@ murrine_style_draw_layout (GtkStyle *style,
}
else
{
- MurrineStyle *murrine_style = MURRINE_STYLE (style);
- MurrineColors *colors = &murrine_style->colors;
-
- if (murrine_style->textstyle != 0 && state_type != GTK_STATE_PRELIGHT)
+ if (&MURRINE_STYLE (style)->textstyle != 0 && state_type != GTK_STATE_PRELIGHT)
{
+ MurrineStyle *murrine_style = MURRINE_STYLE (style);
+ MurrineColors *colors = &murrine_style->colors;
+
WidgetParameters params;
murrine_set_widget_parameters (widget, style, state_type, ¶ms);
@@ -1977,6 +1977,27 @@ murrine_style_draw_layout (GtkStyle *style,
GdkColor etched;
MurrineRGB temp;
+ double shade_level = 1.0;
+ int xos = 0;
+ int yos = 0;
+
+ switch (murrine_style->textstyle)
+ {
+ case 1:
+ shade_level = 1.06;
+ yos = 1;
+ break;
+ case 2:
+ shade_level = 0.6;
+ yos = -1;
+ break;
+ case 3:
+ shade_level = 0.82;
+ xos = 1;
+ yos = 1;
+ break;
+ }
+
GtkReliefStyle relief = GTK_RELIEF_NORMAL;
/* Check for the shadow type. */
if (widget->parent && MRN_IS_BUTTON (widget->parent))
@@ -1992,17 +2013,17 @@ murrine_style_draw_layout (GtkStyle *style,
MRN_IS_CHECK_BUTTON(widget->parent) ||
MRN_IS_RADIO_BUTTON(widget->parent) ||
(relief == GTK_RELIEF_NONE && state_type == GTK_STATE_NORMAL)))
- murrine_shade (¶ms.parentbg, 1.06, &temp);
+ murrine_shade (¶ms.parentbg, shade_level, &temp);
else if (DETAIL ("cellrenderertext"))
- murrine_shade (&colors->base[state_type], 1.06, &temp);
+ murrine_shade (&colors->base[state_type], shade_level, &temp);
else
- murrine_shade (&colors->bg[state_type], 1.06, &temp);
+ murrine_shade (&colors->bg[state_type], shade_level, &temp);
etched.red = (int) (temp.r*65535);
etched.green = (int) (temp.g*65535);
etched.blue = (int) (temp.b*65535);
- gdk_draw_layout_with_colors (window, gc, x, y+1, layout, &etched, NULL);
+ gdk_draw_layout_with_colors (window, gc, x+xos, y+yos, layout, &etched, NULL);
//printf( "draw_layout: %s %s\n", detail, G_OBJECT_TYPE_NAME (widget->parent));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]