gtk-engines r1265 - in trunk: . engines/clearlooks/src schema



Author: bberg
Date: Tue Oct  7 18:53:17 2008
New Revision: 1265
URL: http://svn.gnome.org/viewvc/gtk-engines?rev=1265&view=rev

Log:
2008-10-07  Benjamin Berg  <benjamin sipsolutions net>

	* engines/clearlooks/src/clearlooks_rc_style.c:
	(clearlooks_rc_style_init), (clearlooks_rc_style_parse),
	(clearlooks_rc_style_merge):
	* engines/clearlooks/src/clearlooks_rc_style.h:
	* engines/clearlooks/src/clearlooks_style.c:
	(clearlooks_set_widget_parameters),
	(clearlooks_style_init_from_rc), (clearlooks_style_draw_focus),
	(clearlooks_style_copy):
	* engines/clearlooks/src/clearlooks_style.h:
	* schema/clearlooks.xml.in.in:
	Added a disable_focus option for documentation purpose.


Modified:
   trunk/ChangeLog
   trunk/engines/clearlooks/src/clearlooks_rc_style.c
   trunk/engines/clearlooks/src/clearlooks_rc_style.h
   trunk/engines/clearlooks/src/clearlooks_style.c
   trunk/engines/clearlooks/src/clearlooks_style.h
   trunk/schema/clearlooks.xml.in.in

Modified: trunk/engines/clearlooks/src/clearlooks_rc_style.c
==============================================================================
--- trunk/engines/clearlooks/src/clearlooks_rc_style.c	(original)
+++ trunk/engines/clearlooks/src/clearlooks_rc_style.c	Tue Oct  7 18:53:17 2008
@@ -58,6 +58,7 @@
 	TOKEN_STYLE,
 	TOKEN_RADIUS,
 	TOKEN_HINT,
+	TOKEN_DISABLE_FOCUS,
 
 	TOKEN_CLASSIC,
 	TOKEN_GLOSSY,
@@ -86,6 +87,7 @@
 	"style\0"
 	"radius\0"
 	"hint\0"
+	"disable_focus\0"
 
 	"CLASSIC\0"
 	"GLOSSY\0"
@@ -118,6 +120,7 @@
 	clearlooks_rc->colorize_scrollbar = FALSE;
 	clearlooks_rc->radius = 3.0;
 	clearlooks_rc->hint = 0;
+	clearlooks_rc->disable_focus = FALSE;
 }
 
 #ifdef HAVE_ANIMATION
@@ -395,6 +398,10 @@
 				token = ge_rc_parse_hint (scanner, &clearlooks_style->hint);
 				clearlooks_style->flags |= CL_FLAG_HINT;
 				break;
+			case TOKEN_DISABLE_FOCUS:
+				token = clearlooks_gtk2_rc_parse_boolean (settings, scanner, &clearlooks_style->disable_focus);
+				clearlooks_style->flags |= CL_FLAG_DISABLE_FOCUS;
+				break;
 
 			/* stuff to ignore */
 			case TOKEN_SUNKENMENU:
@@ -468,6 +475,8 @@
 		dest_w->radius = src_w->radius;
 	if (flags & CL_FLAG_HINT)
 		dest_w->hint = src_w->hint;
+	if (flags & CL_FLAG_DISABLE_FOCUS)
+		dest_w->disable_focus = src_w->disable_focus;
 
 	dest_w->flags |= src_w->flags;
 }

Modified: trunk/engines/clearlooks/src/clearlooks_rc_style.h
==============================================================================
--- trunk/engines/clearlooks/src/clearlooks_rc_style.h	(original)
+++ trunk/engines/clearlooks/src/clearlooks_rc_style.h	Tue Oct  7 18:53:17 2008
@@ -52,7 +52,8 @@
 	CL_FLAG_TOOLBARSTYLE       = 1 <<  7,
 	CL_FLAG_ANIMATION          = 1 <<  8,
 	CL_FLAG_RADIUS             = 1 <<  9,
-	CL_FLAG_HINT               = 1 <<  10
+	CL_FLAG_HINT               = 1 <<  10,
+	CL_FLAG_DISABLE_FOCUS      = 1 <<  11
 } ClearlooksRcFlags;
 
 
@@ -74,6 +75,7 @@
 	gboolean animation;
 	double radius;
 	GQuark hint;
+	gboolean disable_focus;
 };
 
 struct _ClearlooksRcStyleClass

Modified: trunk/engines/clearlooks/src/clearlooks_style.c
==============================================================================
--- trunk/engines/clearlooks/src/clearlooks_style.c	(original)
+++ trunk/engines/clearlooks/src/clearlooks_style.c	Tue Oct  7 18:53:17 2008
@@ -71,7 +71,7 @@
 	params->state_type    = (ClearlooksStateType)state_type;
 	params->corners       = CR_CORNER_ALL;
 	params->ltr           = ge_widget_is_ltr ((GtkWidget*)widget);
-	params->focus         = widget && GTK_WIDGET_HAS_FOCUS (widget);
+	params->focus         = !CLEARLOOKS_STYLE (style)->disable_focus && widget && GTK_WIDGET_HAS_FOCUS (widget);
 	params->is_default    = widget && GE_WIDGET_HAS_DEFAULT (widget);
 	params->enable_shadow = FALSE;
 	params->radius        = CLEARLOOKS_STYLE (style)->radius;
@@ -1340,6 +1340,7 @@
 	clearlooks_style->colorize_scrollbar  = CLEARLOOKS_RC_STYLE (rc_style)->colorize_scrollbar;
 	clearlooks_style->animation           = CLEARLOOKS_RC_STYLE (rc_style)->animation;
 	clearlooks_style->radius              = CLAMP (CLEARLOOKS_RC_STYLE (rc_style)->radius, 0.0, 10.0);
+	clearlooks_style->disable_focus       = CLEARLOOKS_RC_STYLE (rc_style)->disable_focus;
 
 	if (clearlooks_style->has_focus_color)
 		clearlooks_style->focus_color     = CLEARLOOKS_RC_STYLE (rc_style)->focus_color;
@@ -1412,6 +1413,10 @@
 	CHECK_ARGS
 	SANITIZE_SIZE
 
+	/* Just return if focus drawing is disabled. */
+	if (clearlooks_style->disable_focus)
+		return;
+
 	cr = gdk_cairo_create (window);
 
 	clearlooks_set_widget_parameters (widget, style, state_type, &params);
@@ -1586,6 +1591,7 @@
 	cl_style->animation           = cl_src->animation;
 	cl_style->radius              = cl_src->radius;
 	cl_style->style               = cl_src->style;
+	cl_style->disable_focus       = cl_src->disable_focus;
 
 	GTK_STYLE_CLASS (clearlooks_style_parent_class)->copy (style, src);
 }

Modified: trunk/engines/clearlooks/src/clearlooks_style.h
==============================================================================
--- trunk/engines/clearlooks/src/clearlooks_style.h	(original)
+++ trunk/engines/clearlooks/src/clearlooks_style.h	Tue Oct  7 18:53:17 2008
@@ -59,6 +59,7 @@
 	gboolean has_scrollbar_color;
 	gboolean animation;
 	gfloat   radius;
+	gboolean disable_focus;
 };
 
 struct _ClearlooksStyleClass

Modified: trunk/schema/clearlooks.xml.in.in
==============================================================================
--- trunk/schema/clearlooks.xml.in.in	(original)
+++ trunk/schema/clearlooks.xml.in.in	Tue Oct  7 18:53:17 2008
@@ -88,6 +88,11 @@
     <_long_name>Animations</_long_name>
     <_description>Enable Animations on Progressbars</_description>
   </option>
+
+  <option name="disable_focus" type="boolean" default="FALSE">
+    <_long_name>Disable focus drawing</_long_name>
+    <_description>This option allows to disable the focus drawing. The primary purpose is to create screenshots for documentation.</_description>
+  </option>
   
   <option name="contrast" type="real" default="1.0">
     <minimum>0</minimum>



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