Enlightenment CVS committal

Author  : pfritz
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_range.h ewl_range.c 


Log Message:
some minor changes

===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_range.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- ewl_range.h 18 May 2007 18:08:24 -0000      1.9
+++ ewl_range.h 18 May 2007 18:25:43 -0000      1.10
@@ -49,8 +49,8 @@
        double min_val; /**< Minimal valide value */
        double max_val; /**< Maximal valide value */
        double step; /**< Size of increments in the range */
-       unsigned int invert; /**< Invert the axis */
-       unsigned int unknown_range; /**< Unknown range */
+       unsigned int invert:1; /**< Invert the axis */
+       unsigned int unknown_range:1; /**< Unknown range */
 };
 
 int            ewl_range_init(Ewl_Range *r);
===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_range.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- ewl_range.c 18 May 2007 18:08:24 -0000      1.8
+++ ewl_range.c 18 May 2007 18:25:43 -0000      1.9
@@ -58,12 +58,14 @@
        if (r->value == v)
                DRETURN(DLEVEL_STABLE);
 
-       if (v < r->min_val)
-               r->value = r->min_val;
-       else if (v > r->max_val)
-               r->value = r->max_val;
-       else
-               r->value = v;
+       if (!r->unknown_range) {
+               if (v < r->min_val)
+                       r->value = r->min_val;
+               else if (v > r->max_val)
+                       r->value = r->max_val;
+               else
+                       r->value = v;
+       }
 
        ewl_callback_call(EWL_WIDGET(r), EWL_CALLBACK_VALUE_CHANGED);
        ewl_widget_configure(EWL_WIDGET(r));
@@ -217,9 +219,9 @@
        DCHECK_PARAM_PTR("r", r);
        DCHECK_TYPE("r", r, EWL_RANGE_TYPE);
 
-       if (r->invert != invert) 
+       if (r->invert != !!invert) 
        {
-               r->invert = invert;
+               r->invert = !!invert;
                ewl_widget_configure(EWL_WIDGET(r));
        }
 
@@ -250,14 +252,14 @@
 void
 ewl_range_unknown_set(Ewl_Range *r, unsigned int unknown)
 {
-        DENTER_FUNCTION(DLEVEL_STABLE);
-        DCHECK_PARAM_PTR("r", r);
-        DCHECK_TYPE("r", r, EWL_RANGE_TYPE);
-
-        if (r->unknown_range != unknown)
-        {
-                r->unknown_range = unknown;
-        }
+       DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR("r", r);
+       DCHECK_TYPE("r", r, EWL_RANGE_TYPE);
+
+       if (r->unknown_range != !!unknown) {
+               r->unknown_range = !!unknown;
+               ewl_widget_configure(EWL_WIDGET(r));
+       }
 
         DLEAVE_FUNCTION(DLEVEL_STABLE);
 }



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to