murrine r34 - in trunk: . src
- From: acimitan svn gnome org
- To: svn-commits-list gnome org
- Subject: murrine r34 - in trunk: . src
- Date: Wed, 9 Apr 2008 23:26:20 +0100 (BST)
Author: acimitan
Date: Wed Apr 9 23:26:20 2008
New Revision: 34
URL: http://svn.gnome.org/viewvc/murrine?rev=34&view=rev
Log:
2008-04-10 Andrea Cimitan <andrea cimitan gmail com>
* src/cairo-support.c: (murrine_draw_lightborder):
* src/murrine_rc_style.c: (murrine_rc_style_init),
(murrine_rc_style_parse), (murrine_rc_style_merge):
* src/murrine_rc_style.h:
* src/murrine_style.c: (murrine_set_widget_parameters),
(murrine_style_init_from_rc), (murrine_style_copy):
* src/murrine_style.h:
A lot of changes in the gradient code,
it should look as before but I'm deprecating code.
Bugs could occures.
* src/support.c: (murrine_scrollbar_get_junction):
http://bugzilla.gnome.org/show_bug.cgi?id=526890
Modified:
trunk/ChangeLog
trunk/src/cairo-support.c
trunk/src/murrine_rc_style.c
trunk/src/murrine_rc_style.h
trunk/src/murrine_style.c
trunk/src/murrine_style.h
trunk/src/support.c
Modified: trunk/src/cairo-support.c
==============================================================================
--- trunk/src/cairo-support.c (original)
+++ trunk/src/cairo-support.c Wed Apr 9 23:26:20 2008
@@ -490,20 +490,10 @@
alpha_value = mrn_gradient.rgba_opacity;
}
- if (gradients)
- {
- murrine_shade (highlight_color, mrn_gradient.gradient_stop_1, &shade1);
- murrine_shade (highlight_color, mrn_gradient.gradient_stop_2, &shade2);
- murrine_shade (highlight_color, mrn_gradient.gradient_stop_3, &shade3);
- murrine_shade (highlight_color, mrn_gradient.gradient_stop_4, &shade4);
- }
- else
- {
- murrine_shade (highlight_color, 1.0, &shade1);
- murrine_shade (highlight_color, 1.0, &shade2);
- murrine_shade (highlight_color, 1.0, &shade3);
- murrine_shade (highlight_color, 1.0, &shade4);
- }
+ murrine_shade (highlight_color, mrn_gradient.gradient_stop_1, &shade1);
+ murrine_shade (highlight_color, mrn_gradient.gradient_stop_2, &shade2);
+ murrine_shade (highlight_color, mrn_gradient.gradient_stop_3, &shade3);
+ murrine_shade (highlight_color, mrn_gradient.gradient_stop_4, &shade4);
double fill_pos = 1.0-(1.0/(!horizontal ? (double)(width) : (double)(height)));
if (corners == MRN_CORNER_ALL && radius > 2)
Modified: trunk/src/murrine_rc_style.c
==============================================================================
--- trunk/src/murrine_rc_style.c (original)
+++ trunk/src/murrine_rc_style.c Wed Apr 9 23:26:20 2008
@@ -164,13 +164,12 @@
murrine_rc->colorize_scrollbar = TRUE;
murrine_rc->contrast = 1.0;
murrine_rc->glazestyle = 1;
- murrine_rc->gradient_stop_1 = 1.0;
+ murrine_rc->gradient_stop_1 = 1.1;
murrine_rc->gradient_stop_2 = 1.0;
murrine_rc->gradient_stop_3 = 1.0;
- murrine_rc->gradient_stop_4 = 1.0;
+ murrine_rc->gradient_stop_4 = 1.1;
murrine_rc->gradients = TRUE;
murrine_rc->has_scrollbar_color = FALSE;
- murrine_rc->has_gradient_stop = FALSE;
murrine_rc->highlight_ratio = 1.1;
murrine_rc->lightborder_ratio = 1.1;
murrine_rc->lightborderstyle = 0;
@@ -436,22 +435,18 @@
case TOKEN_GRADIENT_STOP_1:
token = theme_parse_ratio (settings, scanner, &murrine_style->gradient_stop_1);
murrine_style->flags |= MRN_FLAG_GRADIENT_STOP_1;
- murrine_style->has_gradient_stop = TRUE;
break;
case TOKEN_GRADIENT_STOP_2:
token = theme_parse_ratio (settings, scanner, &murrine_style->gradient_stop_2);
murrine_style->flags |= MRN_FLAG_GRADIENT_STOP_2;
- murrine_style->has_gradient_stop = TRUE;
break;
case TOKEN_GRADIENT_STOP_3:
token = theme_parse_ratio (settings, scanner, &murrine_style->gradient_stop_3);
murrine_style->flags |= MRN_FLAG_GRADIENT_STOP_3;
- murrine_style->has_gradient_stop = TRUE;
break;
case TOKEN_GRADIENT_STOP_4:
token = theme_parse_ratio (settings, scanner, &murrine_style->gradient_stop_4);
- murrine_style->flags |= MRN_FLAG_GRADIENT_STOP_4;
- murrine_style->has_gradient_stop = TRUE;
+ murrine_style->flags |= MRN_FLAG_GRADIENT_STOP_4;;
break;
case TOKEN_GRADIENTS:
token = theme_parse_boolean (settings, scanner, &murrine_style->gradients);
@@ -588,25 +583,13 @@
if (flags & MRN_FLAG_GLAZESTYLE)
dest_w->glazestyle = src_w->glazestyle;
if (flags & MRN_FLAG_GRADIENT_STOP_1)
- {
- dest_w->has_gradient_stop = TRUE;
dest_w->gradient_stop_1 = src_w->gradient_stop_1;
- }
if (flags & MRN_FLAG_GRADIENT_STOP_2)
- {
- dest_w->has_gradient_stop = TRUE;
dest_w->gradient_stop_2 = src_w->gradient_stop_2;
- }
if (flags & MRN_FLAG_GRADIENT_STOP_3)
- {
- dest_w->has_gradient_stop = TRUE;
dest_w->gradient_stop_3 = src_w->gradient_stop_3;
- }
if (flags & MRN_FLAG_GRADIENT_STOP_4)
- {
- dest_w->has_gradient_stop = TRUE;
dest_w->gradient_stop_4 = src_w->gradient_stop_4;
- }
if (flags & MRN_FLAG_GRADIENTS)
dest_w->gradients = src_w->gradients;
if (flags & MRN_FLAG_HIGHLIGHT_RATIO)
Modified: trunk/src/murrine_rc_style.h
==============================================================================
--- trunk/src/murrine_rc_style.h (original)
+++ trunk/src/murrine_rc_style.h Wed Apr 9 23:26:20 2008
@@ -95,7 +95,6 @@
gboolean animation;
gboolean gradients;
gboolean colorize_scrollbar;
- gboolean has_gradient_stop;
gboolean has_scrollbar_color;
gboolean rgba;
Modified: trunk/src/murrine_style.c
==============================================================================
--- trunk/src/murrine_style.c (original)
+++ trunk/src/murrine_style.c Wed Apr 9 23:26:20 2008
@@ -142,20 +142,13 @@
params->highlight_ratio = murrine_style->highlight_ratio;
MurrineGradients mrn_gradient;
- if (murrine_style->has_gradient_stop)
+ if (murrine_style->gradients)
{
mrn_gradient.gradient_stop_1 = murrine_style->gradient_stop_1;
mrn_gradient.gradient_stop_2 = murrine_style->gradient_stop_2;
mrn_gradient.gradient_stop_3 = murrine_style->gradient_stop_3;
mrn_gradient.gradient_stop_4 = murrine_style->gradient_stop_4;
}
- else if (murrine_style->gradients)
- {
- mrn_gradient.gradient_stop_1 = 1.1;
- mrn_gradient.gradient_stop_2 = 1.0;
- mrn_gradient.gradient_stop_3 = 1.0;
- mrn_gradient.gradient_stop_4 = 1.1;
- }
else
{
mrn_gradient.gradient_stop_1 = 1.0;
@@ -1618,13 +1611,11 @@
murrine_style->gradient_stop_2 = MURRINE_RC_STYLE (rc_style)->gradient_stop_2;
murrine_style->gradient_stop_3 = MURRINE_RC_STYLE (rc_style)->gradient_stop_3;
murrine_style->gradient_stop_4 = MURRINE_RC_STYLE (rc_style)->gradient_stop_4;
- murrine_style->has_gradient_stop = MURRINE_RC_STYLE (rc_style)->has_gradient_stop;
murrine_style->highlight_ratio = MURRINE_RC_STYLE (rc_style)->highlight_ratio;
murrine_style->lightborder_ratio = MURRINE_RC_STYLE (rc_style)->lightborder_ratio;
murrine_style->glazestyle = MURRINE_RC_STYLE (rc_style)->glazestyle;
- if (murrine_style->has_gradient_stop &&
- murrine_style->glazestyle != 0)
+ if (murrine_style->glazestyle != 0)
{
double gradient_stop_mid = ((murrine_style->gradient_stop_2)+(murrine_style->gradient_stop_2))/2.0;
murrine_style->gradient_stop_2 = gradient_stop_mid;
@@ -1675,13 +1666,11 @@
murrine_style->stepperstyle = 0;
murrine_style->colorize_scrollbar = FALSE;
murrine_style->has_scrollbar_color = FALSE;
- murrine_style->has_gradient_stop = FALSE;
break;
case (MRN_STYLE_MIST):
murrine_style->highlight_ratio = 1.0;
murrine_style->glazestyle = 0;
murrine_style->gradients = FALSE;
- murrine_style->has_gradient_stop = FALSE;
murrine_style->lightborder_ratio = 1.00;
murrine_style->sliderstyle = 1;
murrine_style->scrollbarstyle = 0;
@@ -1700,7 +1689,6 @@
murrine_style->gradient_stop_2 = 0.99;
murrine_style->gradient_stop_3 = 0.99;
murrine_style->gradient_stop_4 = 0.97;
- murrine_style->has_gradient_stop = TRUE;
murrine_style->reliefstyle = 0;
break;
case (MRN_STYLE_CLEARLOOKS):
@@ -1709,7 +1697,6 @@
murrine_style->gradient_stop_2 = 1.02;
murrine_style->gradient_stop_3 = 1.00;
murrine_style->gradient_stop_4 = 0.94;
- murrine_style->has_gradient_stop = TRUE;
murrine_style->gradients = TRUE;
murrine_style->highlight_ratio = 1.0;
murrine_style->toolbarstyle = 1;
@@ -1890,7 +1877,6 @@
mrn_style->gradient_stop_3 = mrn_src->gradient_stop_3;
mrn_style->gradient_stop_4 = mrn_src->gradient_stop_4;
mrn_style->gradients = mrn_src->gradients;
- mrn_style->has_gradient_stop = mrn_src->has_gradient_stop;
mrn_style->has_scrollbar_color = mrn_src->has_scrollbar_color;
mrn_style->highlight_ratio = mrn_src->highlight_ratio;
mrn_style->lightborder_ratio = mrn_src->lightborder_ratio;
Modified: trunk/src/murrine_style.h
==============================================================================
--- trunk/src/murrine_style.h (original)
+++ trunk/src/murrine_style.h Wed Apr 9 23:26:20 2008
@@ -72,7 +72,6 @@
gboolean animation;
gboolean gradients;
gboolean colorize_scrollbar;
- gboolean has_gradient_stop;
gboolean has_scrollbar_color;
gboolean rgba;
Modified: trunk/src/support.c
==============================================================================
--- trunk/src/support.c (original)
+++ trunk/src/support.c Wed Apr 9 23:26:20 2008
@@ -25,12 +25,12 @@
murrine_get_direction (GtkWidget *widget)
{
GtkTextDirection dir;
-
+
if (widget)
dir = gtk_widget_get_direction (widget);
else
dir = GTK_TEXT_DIR_LTR;
-
+
return dir;
}
@@ -62,7 +62,7 @@
{
int i;
*columns = clist->columns;
-
+
for (i=0; i<*columns; i++)
{
if (clist->column[i].button == button)
@@ -83,11 +83,11 @@
{
GtkRequisition *tmp_size = NULL;
GtkBorder *tmp_spacing = NULL;
-
+
if (widget)
gtk_widget_style_get (widget, "indicator_size", &tmp_size,
"indicator_spacing", &tmp_spacing, NULL);
-
+
if (tmp_size)
{
*indicator_size = *tmp_size;
@@ -95,7 +95,7 @@
}
else
*indicator_size = default_option_indicator_size;
-
+
if (tmp_spacing)
{
*indicator_spacing = *tmp_spacing;
@@ -162,7 +162,7 @@
murrine_widget_is_ltr (GtkWidget *widget)
{
GtkTextDirection dir = GTK_TEXT_DIR_NONE;
-
+
if (MRN_IS_WIDGET (widget))
dir = gtk_widget_get_direction (widget);
@@ -179,7 +179,7 @@
murrine_find_combo_box_widget (GtkWidget * widget)
{
GtkWidget *result = NULL;
-
+
if (widget && !GTK_IS_COMBO_BOX_ENTRY (widget))
{
if (GTK_IS_COMBO_BOX (widget))
@@ -187,7 +187,7 @@
else
result = murrine_find_combo_box_widget(widget->parent);
}
-
+
return result;
}
@@ -212,12 +212,12 @@
check_rectangle.y = widget->allocation.y;
check_rectangle.width = stepper->width;
check_rectangle.height = stepper->height;
-
+
orientation = GTK_RANGE (widget)->orientation;
-
+
if (widget->allocation.x == -1 && widget->allocation.y == -1)
return MRN_STEPPER_UNKNOWN;
-
+
if (gdk_rectangle_intersect (stepper, &check_rectangle, &tmp))
value = MRN_STEPPER_A;
@@ -227,7 +227,7 @@
check_rectangle.x = widget->allocation.x + stepper->width;
else
check_rectangle.y = widget->allocation.y + stepper->height;
-
+
if (gdk_rectangle_intersect (stepper, &check_rectangle, &tmp))
value = MRN_STEPPER_B;
}
@@ -238,7 +238,7 @@
check_rectangle.x = widget->allocation.x + widget->allocation.width - (stepper->width * 2);
else
check_rectangle.y = widget->allocation.y + widget->allocation.height - (stepper->height * 2);
-
+
if (gdk_rectangle_intersect (stepper, &check_rectangle, &tmp))
value = MRN_STEPPER_C;
}
@@ -249,11 +249,11 @@
check_rectangle.x = widget->allocation.x + widget->allocation.width - stepper->width;
else
check_rectangle.y = widget->allocation.y + widget->allocation.height - stepper->height;
-
+
if (gdk_rectangle_intersect (stepper, &check_rectangle, &tmp))
value = MRN_STEPPER_D;
}
-
+
return value;
}
@@ -261,12 +261,12 @@
murrine_scrollbar_visible_steppers (GtkWidget *widget)
{
MurrineStepper steppers = 0;
-
+
g_return_val_if_fail (GTK_IS_RANGE (widget), MRN_STEPPER_UNKNOWN);
-
+
if (GTK_RANGE (widget)->has_stepper_a)
steppers |= MRN_STEPPER_A;
-
+
if (GTK_RANGE (widget)->has_stepper_b)
steppers |= MRN_STEPPER_B;
@@ -279,26 +279,32 @@
MurrineJunction
murrine_scrollbar_get_junction (GtkWidget *widget)
-{
+{
GtkAdjustment *adj;
MurrineJunction junction = MRN_JUNCTION_NONE;
-
+
g_return_val_if_fail (GTK_IS_RANGE (widget), MRN_JUNCTION_NONE);
adj = GTK_RANGE (widget)->adjustment;
-
+
if (adj->value <= adj->lower &&
(GTK_RANGE (widget)->has_stepper_a || GTK_RANGE (widget)->has_stepper_b))
{
- junction |= MRN_JUNCTION_BEGIN;
+ if (!gtk_range_get_inverted (GTK_RANGE (widget)))
+ junction |= MRN_JUNCTION_BEGIN;
+ else
+ junction |= MRN_JUNCTION_END;
}
-
+
if (adj->value >= adj->upper - adj->page_size &&
(GTK_RANGE (widget)->has_stepper_c || GTK_RANGE (widget)->has_stepper_d))
{
- junction |= MRN_JUNCTION_END;
+ if (!gtk_range_get_inverted (GTK_RANGE (widget)))
+ junction |= MRN_JUNCTION_END;
+ else
+ junction |= MRN_JUNCTION_BEGIN;
}
-
+
return junction;
}
@@ -364,7 +370,7 @@
GtkWidget *tab_label;
gboolean expand;
GtkPackType pack_type;
-
+
tab_child = gtk_notebook_get_nth_page (notebook, i);
/* Skip invisible tabs */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]