Enlightenment CVS committal

Author  : moom
Project : e17
Module  : libs/etk

Dir     : e17/libs/etk/src/lib


Modified Files:
        etk_dialog.c 


Log Message:
* [Dialog] Fix a potential bug with 
etk_dialog_action_area_alignment_set() and document the new 
"action_area_align" property


===================================================================
RCS file: /cvs/e/e17/libs/etk/src/lib/etk_dialog.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- etk_dialog.c        17 Feb 2007 17:27:08 -0000      1.14
+++ etk_dialog.c        17 Feb 2007 18:28:19 -0000      1.15
@@ -63,7 +63,8 @@
 
       etk_type_property_add(dialog_type, "has_separator", 
ETK_DIALOG_HAS_SEPARATOR_PROPERTY,
          ETK_PROPERTY_BOOL, ETK_PROPERTY_READABLE_WRITABLE, 
etk_property_value_bool(ETK_TRUE));
-      etk_type_property_add(dialog_type, "action_area_align", 
ETK_DIALOG_ACTION_AREA_ALIGN_PROPERTY, ETK_PROPERTY_FLOAT, 
ETK_PROPERTY_READABLE_WRITABLE,  etk_property_value_float(0.5));
+      etk_type_property_add(dialog_type, "action_area_align", 
ETK_DIALOG_ACTION_AREA_ALIGN_PROPERTY,
+         ETK_PROPERTY_FLOAT, ETK_PROPERTY_READABLE_WRITABLE, 
etk_property_value_float(0.5));
 
       dialog_type->property_set = _etk_dialog_property_set;
       dialog_type->property_get = _etk_dialog_property_get;
@@ -188,14 +189,13 @@
  */
 void etk_dialog_action_area_alignment_set(Etk_Dialog *dialog, float align)
 {
-   float yalign, xscale, yscale;
-
-   etk_alignment_get(ETK_ALIGNMENT(dialog->action_area_alignment), NULL, 
&yalign, &xscale, &yscale);
-   etk_alignment_set(ETK_ALIGNMENT(dialog->action_area_alignment), align, 
yalign, xscale, yscale);
+   if (!dialog)
+      return;
 
    if (dialog->align != align)
    {
       dialog->align = align;
+      etk_alignment_set(ETK_ALIGNMENT(dialog->action_area_alignment), align, 
0.5, 0.0, 0.0);
       etk_object_notify(ETK_OBJECT(dialog), "action_area_align");
    }
 }
@@ -208,7 +208,7 @@
 void etk_dialog_action_area_alignment_get(Etk_Dialog *dialog, float *align)
 {
    if (align)
-      *align = dialog ? dialog->align : 0;
+      *align = dialog ? dialog->align : 0.0;
 }
 
 /**
@@ -301,6 +301,7 @@
    etk_widget_internal_set(dialog->action_area_hbox, ETK_TRUE);
    etk_widget_show(dialog->action_area_hbox);
 
+   dialog->align = 0.5;
    dialog->has_separator = ETK_TRUE;
 }
 
@@ -404,4 +405,10 @@
  * @prop_type Boolean
  * @prop_rw
  * @prop_val ETK_TRUE
+ * \par:
+ * @prop_name "action_area_align": The horizontal alignment of the widgets in 
the action area,
+ * from 0.0 (left) to 1.0 (right)
+ * @prop_type Float
+ * @prop_rw
+ * @prop_val 0.5
  */



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to