rpms/gtk2-engines/devel gtk-engines-2.7.4-fixes.patch, NONE, 1.1 gtk2-engines.spec, 1.35, 1.36

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Fri Feb 24 05:24:24 UTC 2006


Author: mclasen

Update of /cvs/dist/rpms/gtk2-engines/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv4104

Modified Files:
	gtk2-engines.spec 
Added Files:
	gtk-engines-2.7.4-fixes.patch 
Log Message:
Add important bits from upstream


gtk-engines-2.7.4-fixes.patch:
 clearlooks_draw.c  |   20 +++++-
 clearlooks_style.c |  176 +++++++++++++++++++++++++++--------------------------
 2 files changed, 110 insertions(+), 86 deletions(-)

--- NEW FILE gtk-engines-2.7.4-fixes.patch ---
--- gtk-engines-2.7.4/engines/clearlooks/src/clearlooks_draw.c.fixes	2006-02-24 00:03:24.000000000 -0500
+++ gtk-engines-2.7.4/engines/clearlooks/src/clearlooks_draw.c	2006-02-24 00:05:52.000000000 -0500
@@ -290,6 +290,23 @@
 		cairo_pattern_destroy (pattern);
 	}
 	
+
+        /* Drawing the border */
+
+        if (!params->active && params->is_default)
+        {
+                CairoColor *l = &colors->shade[4];
+                CairoColor *d = &colors->shade[4];
+                cairo_set_source_rgb(cr, l->r, l->g, l->b);
+                cairo_rectangle (cr, 2.5, 2.5, width-5, height-5);
+                cairo_stroke (cr);
+
+                cairo_set_source_rgb(cr, d->r, d->g, d->b);
+                cairo_rectangle (cr, 3.5, 3.5, width-7, height-7);
+                cairo_stroke (cr);
+        }
+
+
 	if (params->disabled)
 	{
 		cairo_set_source_rgb (cr, border_disabled->r,
@@ -307,7 +324,8 @@
                                   width-(xoffset*2)-1, height-(yoffset*2)-1,
                                   3.0, params->corners);
 	cairo_stroke (cr);
-	
+
+        /* Draw the "shadow" */	
 	if (!params->active)
 	{
 		cairo_translate (cr, 0.5, 0.5);
--- gtk-engines-2.7.4/engines/clearlooks/src/clearlooks_style.c.fixes	2006-02-23 23:58:50.000000000 -0500
+++ gtk-engines-2.7.4/engines/clearlooks/src/clearlooks_style.c	2006-02-24 00:02:28.000000000 -0500
@@ -833,101 +833,107 @@
 	cairo_destroy (cr);
 }
 
-static void
 draw_check (DRAW_ARGS)
 {
-	ClearlooksStyle *clearlooks_style = CLEARLOOKS_STYLE (style);
-	CairoColor *border;
-	CairoColor *dot;
-	double trans = 1.0;
-	gboolean draw_bullet = (shadow_type == GTK_SHADOW_IN);
+        ClearlooksStyle *clearlooks_style = CLEARLOOKS_STYLE (style);
+        CairoColor *border;
+        CairoColor *dot;
+        double trans = 1.0;
+        gboolean draw_bullet = (shadow_type == GTK_SHADOW_IN || shadow_type == GTK_SHADOW_ETCHED_IN);
 
-	cairo_t *cr = clearlooks_begin_paint (window, area);
-	cairo_pattern_t *pt;
+        cairo_t *cr = clearlooks_begin_paint (window, area);
+        cairo_pattern_t *pt;
 
 #ifdef HAVE_ANIMATION
-	if(clearlooks_style->animation && GTK_IS_CHECK_BUTTON (widget) && !cl_async_animation_lookup((gconstpointer)widget)  && !g_slist_find (signaled_widgets, (gconstpointer)widget))
-	{
-			signaled_widgets = g_slist_append (signaled_widgets, widget);
-			g_signal_connect ((GObject*)widget, "toggled", G_CALLBACK (cl_checkbox_toggle), widget);
-	}
+        if (clearlooks_style->animation)
+                clearlooks_animation_connect_checkbox (widget);
 #endif
-	
-	if (state_type == GTK_STATE_INSENSITIVE)
-	{
-		border = &clearlooks_style->colors.shade[2];
-		dot    = &clearlooks_style->colors.shade[2];
-	}
-	else
-	{
-		border = &clearlooks_style->colors.shade[7];
-		dot    = &clearlooks_style->colors.spot[1];
-	}
 
-	cairo_translate (cr, x, y);
-	cairo_set_line_width (cr, 1);
-	
-	if (style->xthickness > 2 && style->ythickness > 2)
-	{
-		/* Draw a gradient around the box so it appears sunken. */
-		pt = cairo_pattern_create_linear (0, 0, 0, 13);
-		cairo_pattern_add_color_stop_rgba (pt, 0.0, 0, 0, 0, 0.04);
-		cairo_pattern_add_color_stop_rgba (pt, 0.5, 0, 0, 0, 0);
-		cairo_pattern_add_color_stop_rgba (pt, 0.5, 1, 1, 1, 0);
-		cairo_pattern_add_color_stop_rgba (pt, 1.0, 1, 1, 1, 0.4);
-		
-		cairo_rectangle (cr, 0.5, 0.5, width-1, height-1);
-		cairo_set_source (cr, pt);
-		cairo_stroke (cr);
-		cairo_pattern_destroy (pt);
-		
-		/* Draw the rectangle for the checkbox itself */
-		cairo_rectangle (cr, 1.5, 1.5, width-3, height-3);
-	}
-	else
-	{
-		cairo_rectangle (cr, 0.5, 0.5, width-1, height-1);
-	}
-	
-	if (state_type != GTK_STATE_INSENSITIVE)
-	{
-		CairoColor *bg = &clearlooks_style->colors.base[0];
-		cairo_set_source_rgb (cr, bg->r, bg->g, bg->b);
-		cairo_fill_preserve (cr);
-	}
-	
-	cairo_set_source_rgb (cr, border->r, border->g, border->b);
-	cairo_stroke (cr);
-		
+        if (state_type == GTK_STATE_INSENSITIVE)
+        {
+                border = &clearlooks_style->colors.shade[2];
+                dot    = &clearlooks_style->colors.shade[2];
+        }
+        else
+        {
+                border = &clearlooks_style->colors.shade[7];
+                dot    = &clearlooks_style->colors.spot[1];
+        }
+
+        cairo_translate (cr, x, y);
+        cairo_set_line_width (cr, 1);
+
+        if (style->xthickness > 2 && style->ythickness > 2)
+        {
+                /* Draw a gradient around the box so it appears sunken. */
+                pt = cairo_pattern_create_linear (0, 0, 0, 13);
+                cairo_pattern_add_color_stop_rgba (pt, 0.0, 0, 0, 0, 0.04);
+                cairo_pattern_add_color_stop_rgba (pt, 0.5, 0, 0, 0, 0);
+                cairo_pattern_add_color_stop_rgba (pt, 0.5, 1, 1, 1, 0);
+                cairo_pattern_add_color_stop_rgba (pt, 1.0, 1, 1, 1, 0.4);
+
+                cairo_rectangle (cr, 0.5, 0.5, width-1, height-1);
+                cairo_set_source (cr, pt);
+                cairo_stroke (cr);
+                cairo_pattern_destroy (pt);
+
+                /* Draw the rectangle for the checkbox itself */
+                cairo_rectangle (cr, 1.5, 1.5, width-3, height-3);
+        }
+        else
+        {
+                cairo_rectangle (cr, 0.5, 0.5, width-1, height-1);
+        }
+
+        if (state_type != GTK_STATE_INSENSITIVE)
+        {
+                CairoColor *bg = &clearlooks_style->colors.base[0];
+                cairo_set_source_rgb (cr, bg->r, bg->g, bg->b);
+                cairo_fill_preserve (cr);
+        }
+
+        cairo_set_source_rgb (cr, border->r, border->g, border->b);
+        cairo_stroke (cr);
+
 #ifdef HAVE_ANIMATION
-	if (clearlooks_style->animation && cl_async_animation_lookup((gconstpointer)widget))
-	{
-		int value = cl_async_animation_getdata((gpointer)widget).frame;
-		
-		if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)))
-			trans = (float)(5-value)/5;
-		else
-			trans = (float)value/5;
-		
-		draw_bullet = TRUE;
-	}
+        if (clearlooks_style->animation && GTK_IS_CHECK_BUTTON (widget) &&
+            clearlooks_animation_is_animated(widget) &&
+            !gtk_toggle_button_get_inconsistent (GTK_TOGGLE_BUTTON (widget)))
+        {
+                gfloat elapsed = clearlooks_animation_elapsed (widget);
+
+                if (draw_bullet)
+                        trans = sqrt (sqrt (MIN(elapsed / CHECK_ANIMATION_TIME, 1.0)));
+                else
+                        trans = 1.0 - sqrt (sqrt (MIN(elapsed / CHECK_ANIMATION_TIME, 1.0)));
+
+                draw_bullet = TRUE;
+        }
 #endif
 
-	if (draw_bullet)
-	{
-		cairo_set_line_width (cr, 1.7);
-		cairo_move_to (cr, 0.5 + (width*0.2), (height*0.5));
-		cairo_line_to (cr, 0.5 + (width*0.4), (height*0.7));
-		
-		cairo_curve_to (cr, 0.5 + (width*0.4), (height*0.7),
-		                    0.5 + (width*0.5), (height*0.4),
-		                    0.5 + (width*0.70), (height*0.25));
-		
-		
-		cairo_set_source_rgba (cr, dot->r, dot->g, dot->b, trans);
-		cairo_stroke (cr);
-	}
-	cairo_destroy (cr);
+        if (draw_bullet)
+        {
+                if (shadow_type == GTK_SHADOW_ETCHED_IN) /* Inconsistent */
+                {
+                        cairo_set_line_width (cr, 2.0);
+                        cairo_move_to (cr, 3, height*0.5);
+                        cairo_line_to (cr, width-3, height*0.5);
+                }
+                else
+                {
+                        cairo_set_line_width (cr, 1.7);
+                        cairo_move_to (cr, 0.5 + (width*0.2), (height*0.5));
+                        cairo_line_to (cr, 0.5 + (width*0.4), (height*0.7));
+
+                        cairo_curve_to (cr, 0.5 + (width*0.4), (height*0.7),
+                                            0.5 + (width*0.5), (height*0.4),
+                                            0.5 + (width*0.70), (height*0.25));
+                }
+
+                cairo_set_source_rgba (cr, dot->r, dot->g, dot->b, trans);
+                cairo_stroke (cr);
+        }
+        cairo_destroy (cr);
 }
 
 static void


Index: gtk2-engines.spec
===================================================================
RCS file: /cvs/dist/rpms/gtk2-engines/devel/gtk2-engines.spec,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- gtk2-engines.spec	11 Feb 2006 03:22:07 -0000	1.35
+++ gtk2-engines.spec	24 Feb 2006 05:24:20 -0000	1.36
@@ -1,10 +1,12 @@
 Summary:        Theme engines for GTK+ 2.0
 Name:           gtk2-engines
 Version:        2.7.4
-Release:	1.2
+Release:	2
 License:        GPL
 Group:          System Environment/Libraries
 Source:         gtk-engines-%{version}.tar.bz2
+# backport of default button and inconsistant state from cvs
+Patch0:		gtk-engines-2.7.4-fixes.patch
 
 Requires:       gtk2 >= 2.2.0
 Conflicts:  	gnome-themes < 2.9.0
@@ -23,6 +25,7 @@
 
 %prep
 %setup -q -n gtk-engines-%{version}
+%patch0 -p1 -b .fixes
 
 %build
 %configure
@@ -60,6 +63,10 @@
 %{_datadir}/themes
 
 %changelog
+* Fri Feb 24 2006 Matthias Clasen <mclasen at redhat.com> - 2.7.4-2
+- Backport patches to draw default buttons and
+  inconsistent checkboxes
+
 * Fri Feb 10 2006 Jesse Keating <jkeating at redhat.com> - 2.7.4-1.2
 - bump again for double-long bug on ppc(64)
 




More information about the fedora-cvs-commits mailing list