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



Author: acimitan
Date: Tue Mar 10 18:52:15 2009
New Revision: 1338
URL: http://svn.gnome.org/viewvc/gtk-engines?rev=1338&view=rev

Log:
2009-03-10  Andrea Cimitan  <andrea cimitan gmail com

	* engines/clearlooks/src/clearlooks_draw.c
	(clearlooks_draw_entry_progress):
	* engines/clearlooks/src/clearlooks_style.c
	(clearlooks_style_draw_box):
	Coding style.


Modified:
   trunk/ChangeLog
   trunk/engines/clearlooks/src/clearlooks_draw.c
   trunk/engines/clearlooks/src/clearlooks_style.c

Modified: trunk/engines/clearlooks/src/clearlooks_draw.c
==============================================================================
--- trunk/engines/clearlooks/src/clearlooks_draw.c	(original)
+++ trunk/engines/clearlooks/src/clearlooks_draw.c	Tue Mar 10 18:52:15 2009
@@ -485,18 +485,22 @@
 	fill = colors->bg[params->state_type];
 	ge_shade_color (&fill, 0.9, &border);
 
-	if (progress->max_size_known) {
+	if (progress->max_size_known)
+	{
 		entry_width = progress->max_size.width + progress->border.left + progress->border.right;
 		entry_height = progress->max_size.height + progress->border.top + progress->border.bottom;
 		entry_radius = MIN (params->radius, MIN ((entry_width - 4.0) / 2.0, (entry_height - 4.0) / 2.0));
-	} else {
+	}
+	else
+	{
 		entry_radius = params->radius;
 	}
 
 	radius = MAX (0, entry_radius + 1.0 - MAX (MAX (progress->border.left, progress->border.right),
 	                                           MAX (progress->border.top, progress->border.bottom)));
 
-	if (progress->max_size_known) {
+	if (progress->max_size_known)
+	{
 		/* Clip to the max size, and then draw a (larger) rectangle ... */
 		ge_cairo_rounded_rectangle (cr, progress->max_size.x,
 		                                progress->max_size.y,
@@ -515,13 +519,14 @@
 		ge_cairo_set_color (cr, &border);
 		ge_cairo_inner_rectangle (cr, x - 1, y, width + 2, height);
 		cairo_stroke (cr);
-	} else {
+	}
+	else
+	{
 		ge_cairo_rounded_rectangle (cr, x, y, width + 10, height + 10, radius, CR_CORNER_ALL);
 		cairo_clip (cr);
 		ge_cairo_rounded_rectangle (cr, x - 10, y - 10, width + 10, height + 10, radius, CR_CORNER_ALL);
 		cairo_clip (cr);
 
-
 		ge_cairo_set_color (cr, &fill);
 		ge_cairo_rounded_rectangle (cr, x + 1, y + 1, width - 2, height - 2, radius, CR_CORNER_ALL);
 		cairo_fill (cr);

Modified: trunk/engines/clearlooks/src/clearlooks_style.c
==============================================================================
--- trunk/engines/clearlooks/src/clearlooks_style.c	(original)
+++ trunk/engines/clearlooks/src/clearlooks_style.c	Tue Mar 10 18:52:15 2009
@@ -875,14 +875,16 @@
 		progress.border.top = style->ythickness;
 		progress.border.bottom = style->ythickness;
 
-		if (GE_IS_ENTRY (widget)) {
+		if (GE_IS_ENTRY (widget))
+		{
 			GtkBorder *border;
 			/* Try to retrieve the style property. */
 			gtk_widget_style_get (widget,
 			                      "progress-border", &border,
 			                      NULL);
 
-			if (border) {
+			if (border)
+			{
 				progress.border = *border;
 				gtk_border_free (border);
 			}
@@ -892,7 +894,8 @@
 			 * Also, we need to be drawing on a window obviously ... */
 			if (GTK_WIDGET_REALIZED (widget) &&
 			    GDK_IS_WINDOW (window) &&
-			    gdk_window_is_visible (widget->window)) {
+			    gdk_window_is_visible (widget->window))
+			{
 				/* Assumptions done by this code:
 				 *  - GtkEntry has some nested windows.
 				 *  - widget->window is the entries window
@@ -902,16 +905,20 @@
 				 * These should be true with any GTK+ 2.x version.
 				 */
 
-				if (widget->window == window) {
+				if (widget->window == window)
+				{
 					progress.max_size_known = TRUE;
 					gdk_drawable_get_size (widget->window,
 					                       &progress.max_size.width,
 					                       &progress.max_size.height);
 
-				} else {
+				}
+				else
+				{
 					GdkWindow *parent;
 					parent = gdk_window_get_parent (window);
-					if (widget->window == parent) {
+					if (widget->window == parent)
+					{
 						gint pos_x, pos_y;
 						/* widget->window is the parent window
 						 * of the current one. This means we can
@@ -929,7 +936,8 @@
 
 				/* Now, one more thing needs to be done. If interior-focus
 				 * is off, then the entry may be a bit smaller. */
-				if (progress.max_size_known && GTK_WIDGET_HAS_FOCUS (widget)) {
+				if (progress.max_size_known && GTK_WIDGET_HAS_FOCUS (widget))
+				{
 					gboolean interior_focus = TRUE;
 					gint focus_line_width = 1;
 
@@ -938,7 +946,8 @@
 					                      "focus-line-width", &focus_line_width,
 					                      NULL);
 
-					if (!interior_focus) {
+					if (!interior_focus)
+					{
 						progress.max_size.x += focus_line_width;
 						progress.max_size.y += focus_line_width;
 						progress.max_size.width -= 2*focus_line_width;
@@ -946,7 +955,8 @@
 					}
 				}
 				
-				if (progress.max_size_known) {
+				if (progress.max_size_known)
+				{
 					progress.max_size.x += progress.border.left;
 					progress.max_size.y += progress.border.top;
 					progress.max_size.width -= progress.border.left + progress.border.right;
@@ -955,7 +965,8 @@
 					/* Now test that max_size.height == height, if that
 					 * fails, something has gone wrong ... so then throw away
 					 * the max_size information. */
-					if (progress.max_size.height != height) {
+					if (progress.max_size.height != height)
+					{
 						progress.max_size_known = FALSE;
 						progress.max_size.x = 0;
 						progress.max_size.y = 0;



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