gtk-engines r1213 - in trunk: . engines/clearlooks/src



Author: bberg
Date: Mon Jun 16 18:48:44 2008
New Revision: 1213
URL: http://svn.gnome.org/viewvc/gtk-engines?rev=1213&view=rev

Log:
2008-06-16  Benjamin Berg  <benjamin sipsolutions net>

	* engines/clearlooks/src/clearlooks_draw*.c:
	(*_draw_list_view_header):
	* engines/clearlooks/src/clearlooks_style.c:
	(clearlooks_style_draw_box):
	* engines/clearlooks/src/clearlooks_types.h:
	Change the header button position enum to be a bitfield.
	(Bug #511958, Marcus Brinkmann)


Modified:
   trunk/ChangeLog
   trunk/engines/clearlooks/src/clearlooks_draw.c
   trunk/engines/clearlooks/src/clearlooks_draw_glossy.c
   trunk/engines/clearlooks/src/clearlooks_draw_gummy.c
   trunk/engines/clearlooks/src/clearlooks_draw_inverted.c
   trunk/engines/clearlooks/src/clearlooks_style.c
   trunk/engines/clearlooks/src/clearlooks_types.h

Modified: trunk/engines/clearlooks/src/clearlooks_draw.c
==============================================================================
--- trunk/engines/clearlooks/src/clearlooks_draw.c	(original)
+++ trunk/engines/clearlooks/src/clearlooks_draw.c	Mon Jun 16 18:48:44 2008
@@ -1437,7 +1437,7 @@
 	cairo_set_line_width (cr, 1.0);
 
 	/* Draw highlight */
-	if (header->order == CL_ORDER_FIRST)
+	if (header->order & CL_ORDER_FIRST)
 	{
 		cairo_move_to (cr, 0.5, height-1);
 		cairo_line_to (cr, 0.5, 0.5);
@@ -1457,8 +1457,8 @@
 	cairo_stroke (cr);
 
 	/* Draw resize grip */
-	if ((params->ltr && header->order != CL_ORDER_LAST) ||
-	    (!params->ltr && header->order != CL_ORDER_FIRST) || header->resizable)
+	if ((params->ltr && !(header->order & CL_ORDER_LAST)) ||
+	    (!params->ltr && !(header->order & CL_ORDER_FIRST)) || header->resizable)
 	{
 		SeparatorParameters separator;
 		separator.horizontal = FALSE;

Modified: trunk/engines/clearlooks/src/clearlooks_draw_glossy.c
==============================================================================
--- trunk/engines/clearlooks/src/clearlooks_draw_glossy.c	(original)
+++ trunk/engines/clearlooks/src/clearlooks_draw_glossy.c	Mon Jun 16 18:48:44 2008
@@ -1097,7 +1097,7 @@
 	cairo_pattern_destroy (pattern);
 	
 	/* Draw highlight */
-	if (header->order == CL_ORDER_FIRST)
+	if (header->order & CL_ORDER_FIRST)
 	{
 		cairo_move_to (cr, 0.5, height-1);
 		cairo_line_to (cr, 0.5, 0.5);
@@ -1111,8 +1111,8 @@
 	cairo_stroke (cr);
 	
 	/* Draw resize grip */
-	if ((params->ltr && header->order != CL_ORDER_LAST) ||
-	    (!params->ltr && header->order != CL_ORDER_FIRST) || header->resizable)
+	if ((params->ltr && !(header->order & CL_ORDER_LAST)) ||
+	    (!params->ltr && !(header->order & CL_ORDER_FIRST)) || header->resizable)
 	{
 		SeparatorParameters separator;
 		separator.horizontal = FALSE;

Modified: trunk/engines/clearlooks/src/clearlooks_draw_gummy.c
==============================================================================
--- trunk/engines/clearlooks/src/clearlooks_draw_gummy.c	(original)
+++ trunk/engines/clearlooks/src/clearlooks_draw_gummy.c	Mon Jun 16 18:48:44 2008
@@ -1186,7 +1186,7 @@
 	cairo_pattern_destroy (pattern);
 
 	/* Draw highlight */
-	if (header->order == CL_ORDER_FIRST)
+	if (header->order & CL_ORDER_FIRST)
 	{
 		cairo_move_to (cr, 0.5, height-1.5);
 		cairo_line_to (cr, 0.5, 0.5);
@@ -1200,8 +1200,8 @@
 	cairo_stroke (cr);
 
 	/* Draw resize grip */
-	if ((params->ltr && header->order != CL_ORDER_LAST) ||
-	    (!params->ltr && header->order != CL_ORDER_FIRST) || header->resizable)
+	if ((params->ltr && !(header->order & CL_ORDER_LAST)) ||
+	    (!params->ltr && !(header->order & CL_ORDER_FIRST)) || header->resizable)
 	{
 		SeparatorParameters separator;
 		separator.horizontal = FALSE;

Modified: trunk/engines/clearlooks/src/clearlooks_draw_inverted.c
==============================================================================
--- trunk/engines/clearlooks/src/clearlooks_draw_inverted.c	(original)
+++ trunk/engines/clearlooks/src/clearlooks_draw_inverted.c	Mon Jun 16 18:48:44 2008
@@ -701,7 +701,7 @@
 	cairo_set_line_width (cr, 1.0);
 	
 	/* Draw highlight */
-	if (header->order == CL_ORDER_FIRST)
+	if (header->order & CL_ORDER_FIRST)
 	{
 		cairo_move_to (cr, 0.5, height-1);
 		cairo_line_to (cr, 0.5, 0.5);
@@ -731,8 +731,8 @@
 	cairo_pattern_destroy (pattern);
 	
 	/* Draw resize grip */
-	if ((params->ltr && header->order != CL_ORDER_LAST) ||
-	    (!params->ltr && header->order != CL_ORDER_FIRST) || header->resizable)
+	if ((params->ltr && !(header->order & CL_ORDER_LAST)) ||
+	    (!params->ltr && !(header->order & CL_ORDER_FIRST)) || header->resizable)
 	{
 		SeparatorParameters separator;
 		separator.horizontal = FALSE;

Modified: trunk/engines/clearlooks/src/clearlooks_style.c
==============================================================================
--- trunk/engines/clearlooks/src/clearlooks_style.c	(original)
+++ trunk/engines/clearlooks/src/clearlooks_style.c	Mon Jun 16 18:48:44 2008
@@ -494,7 +494,7 @@
 		gint columns, column_index;
 		gboolean resizable = TRUE;
 
-		/* XXX: This makes unknown treeview header CL_ORDER_MIDDLE, in need for something nicer */
+		/* XXX: This makes unknown treeview header "middle", in need for something nicer */
 		columns = 3;
 		column_index = 1;
 
@@ -516,12 +516,11 @@
 
 		header.resizable = resizable;
 
+		header.order = 0;
 		if (column_index == 0)
-			header.order = params.ltr ? CL_ORDER_FIRST : CL_ORDER_LAST;
-		else if (column_index == columns-1)
-			header.order = params.ltr ? CL_ORDER_LAST : CL_ORDER_FIRST;
-		else
-			header.order = CL_ORDER_MIDDLE;
+			header.order |= params.ltr ? CL_ORDER_FIRST : CL_ORDER_LAST;
+		if (column_index == columns-1)
+			header.order |= params.ltr ? CL_ORDER_LAST : CL_ORDER_FIRST;
 
 		gtk_style_apply_default_background (style, window, FALSE, state_type, area, x, y, width, height);
 

Modified: trunk/engines/clearlooks/src/clearlooks_types.h
==============================================================================
--- trunk/engines/clearlooks/src/clearlooks_types.h	(original)
+++ trunk/engines/clearlooks/src/clearlooks_types.h	Mon Jun 16 18:48:44 2008
@@ -43,9 +43,8 @@
 
 typedef enum
 {
-	CL_ORDER_FIRST,
-	CL_ORDER_MIDDLE,
-	CL_ORDER_LAST
+	CL_ORDER_FIRST    = 1 << 0,
+	CL_ORDER_LAST     = 1 << 1,
 } ClearlooksOrder;
 
 typedef enum



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]