This patch adds a close and a apply button the the conf_wallpaper2
module.
It is implemented in an extremely simple way and does NOT have the
advanced features brought by E_Dialog (like disabling after apply).

This way the selector is much more usable without having to move to
E_Dialog completely, and thus keeping its unique design which differs
from typical dialogs.

If the whole module should be ported to E_Dialog instead, please let me
know.

Signed-off-by: Thomas Gstädtner <tho...@gstaedtner.net>
---
 .../conf_wallpaper2/e_int_config_wallpaper.c       |   30 ++++++++++++++++++-
 1 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/src/modules/conf_wallpaper2/e_int_config_wallpaper.c b/src/modules/conf_wallpaper2/e_int_config_wallpaper.c
index ab33faa..b4bd5d9 100644
--- a/src/modules/conf_wallpaper2/e_int_config_wallpaper.c
+++ b/src/modules/conf_wallpaper2/e_int_config_wallpaper.c
@@ -979,7 +979,7 @@ _bg_clicked(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUS
 }
 
 static void
-_ok(void *data, void *data2 __UNUSED__)
+_apply(void *data, void *data2 __UNUSED__)
 {
    Info *info = data;
 
@@ -1022,10 +1022,22 @@ _ok(void *data, void *data2 __UNUSED__)
      }
    e_bg_update();
    e_config_save_queue();
+}
+
+static void
+_close(void *data, void *data2 __UNUSED__)
+{
    wp_conf_hide();
 }
 
 static void
+_ok(void *data, void *data2 __UNUSED__)
+{
+  _apply(data, data2);
+  wp_conf_hide();
+}
+
+static void
 _wp_add(void *data, void *data2 __UNUSED__)
 {
    Info *info = data;
@@ -1174,11 +1186,25 @@ wp_browser_new(E_Container *con)
    edje_object_signal_callback_add(info->bg, "e,action,click", "e",
                                    _bg_clicked, info);
 
-   // ok button
    info->box = e_widget_list_add(info->win->evas, 1, 1);
 
+   // ok button
    info->button = e_widget_button_add(info->win->evas, _("OK"), NULL, 
                                       _ok, info, NULL);
+   e_widget_disabled_set(info->button, 1);
+   evas_object_show(info->button);
+   e_widget_list_object_append(info->box, info->button, 1, 0, 0.5);
+
+   // apply button
+   info->button = e_widget_button_add(info->win->evas, _("Apply"), NULL, 
+                                      _apply, info, NULL);
+   e_widget_disabled_set(info->button, 1);
+   evas_object_show(info->button);
+   e_widget_list_object_append(info->box, info->button, 1, 0, 0.5);
+
+   // close button
+   info->button = e_widget_button_add(info->win->evas, _("Close"), NULL, 
+                                      _close, info, NULL);
    evas_object_show(info->button);
    e_widget_list_object_append(info->box, info->button, 1, 0, 0.5);
 
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to