summaryrefslogtreecommitdiff
path: root/src/bin/controls.c
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2012-06-30 14:21:00 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-06-30 14:21:00 +0000
commit5afd73501ff673a5735c662058ddd2cfa6e304e2 (patch)
treefdeb56c0eeead4aa0320002fcbb6cc669acfb6ff /src/bin/controls.c
parent84261ed6ec0b971aeb67e6ba550cfa8e1c6f4497 (diff)
any button now dismisses the popup dialog things.
SVN revision: 73083
Diffstat (limited to 'src/bin/controls.c')
-rw-r--r--src/bin/controls.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/bin/controls.c b/src/bin/controls.c
index 0a08ed0..0d80755 100644
--- a/src/bin/controls.c
+++ b/src/bin/controls.c
@@ -6,9 +6,11 @@
6#include "about.h" 6#include "about.h"
7#include "termio.h" 7#include "termio.h"
8 8
9static Evas_Object *ct_frame, *ct_box = NULL; 9static Evas_Object *ct_frame = NULL, *ct_box = NULL, *ct_over = NULL;
10static Eina_Bool ct_out = EINA_FALSE; 10static Eina_Bool ct_out = EINA_FALSE;
11static Ecore_Timer *ct_del_timer = NULL; 11static Ecore_Timer *ct_del_timer = NULL;
12static Evas_Object *saved_win = NULL;
13static Evas_Object *saved_bg = NULL;
12 14
13static Evas_Object *ct_win, *ct_bg, *ct_term; 15static Evas_Object *ct_win, *ct_bg, *ct_term;
14 16
@@ -50,11 +52,19 @@ _cb_ct_about(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event __U
50 about_toggle(ct_win, ct_bg, ct_term); 52 about_toggle(ct_win, ct_bg, ct_term);
51} 53}
52 54
55static void
56_cb_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *ev __UNUSED__)
57{
58 controls_toggle(saved_win, saved_bg, data);
59}
60
53void 61void
54controls_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term) 62controls_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term)
55{ 63{
56 Evas_Object *o; 64 Evas_Object *o;
57 65
66 saved_win = win;
67 saved_bg = bg;
58 if (!ct_out) 68 if (!ct_out)
59 { 69 {
60 if (options_active_get()) 70 if (options_active_get())
@@ -125,6 +135,13 @@ controls_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term)
125 } 135 }
126 if (!ct_out) 136 if (!ct_out)
127 { 137 {
138 ct_over = o = evas_object_rectangle_add(evas_object_evas_get(win));
139 evas_object_color_set(o, 0, 0, 0, 0);
140 edje_object_part_swallow(bg, "terminology.dismiss", o);
141 evas_object_show(o);
142 evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN,
143 _cb_mouse_down, term);
144
128 ct_win = win; 145 ct_win = win;
129 ct_bg = bg; 146 ct_bg = bg;
130 ct_term = term; 147 ct_term = term;
@@ -139,6 +156,9 @@ controls_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term)
139 } 156 }
140 else 157 else
141 { 158 {
159 evas_object_del(ct_over);
160 ct_over = NULL;
161
142 edje_object_signal_emit(bg, "controls,hide", "terminology"); 162 edje_object_signal_emit(bg, "controls,hide", "terminology");
143 ct_out = EINA_FALSE; 163 ct_out = EINA_FALSE;
144 elm_object_focus_set(ct_frame, EINA_FALSE); 164 elm_object_focus_set(ct_frame, EINA_FALSE);