From 227176c7831119e4edad0816f002074615787a4e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thomas=20Gst=C3=A4dtner?= <thomas@gstaedtner.net>
Date: Wed, 1 Aug 2012 19:50:22 +0200
Subject: [PATCH] wallpaper2: implement close/apply buttons
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="------------1.7.8.6"

This is a multi-part message in MIME format.
--------------1.7.8.6
Content-Type: text/plain; charset=UTF-8; format=fixed
Content-Transfer-Encoding: 8bit


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 <thomas@gstaedtner.net>
---
 .../conf_wallpaper2/e_int_config_wallpaper.c       |   28 ++++++++++++++++++-
 1 files changed, 26 insertions(+), 2 deletions(-)


--------------1.7.8.6
Content-Type: text/x-patch; name="0001-wallpaper2-implement-close-apply-buttons.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="0001-wallpaper2-implement-close-apply-buttons.patch"

diff --git a/src/modules/conf_wallpaper2/e_int_config_wallpaper.c b/src/modules/conf_wallpaper2/e_int_config_wallpaper.c
index ab33faa..2ca1032 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,14 +1186,26 @@ 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);
    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);
+   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);
+
    e_widget_size_min_get(info->box, &mw, &mh);
    edje_extern_object_min_size_set(info->box, mw, mh);
    edje_object_part_swallow(info->bg, "e.swallow.buttons", info->box);

--------------1.7.8.6--


