summaryrefslogtreecommitdiff
path: root/src/bin
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
parent84261ed6ec0b971aeb67e6ba550cfa8e1c6f4497 (diff)
any button now dismisses the popup dialog things.
SVN revision: 73083
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/about.c7
-rw-r--r--src/bin/controls.c22
-rw-r--r--src/bin/options.c23
3 files changed, 46 insertions, 6 deletions
diff --git a/src/bin/about.c b/src/bin/about.c
index fea5fa0..3c413a6 100644
--- a/src/bin/about.c
+++ b/src/bin/about.c
@@ -3,7 +3,7 @@
3#include <Elementary.h> 3#include <Elementary.h>
4#include "about.h" 4#include "about.h"
5 5
6static Evas_Object *ab_layout = NULL, *ab_over; 6static Evas_Object *ab_layout = NULL, *ab_over = NULL;
7static Eina_Bool ab_out = EINA_FALSE; 7static Eina_Bool ab_out = EINA_FALSE;
8static Ecore_Timer *ab_del_timer = NULL; 8static Ecore_Timer *ab_del_timer = NULL;
9static Evas_Object *saved_win = NULL; 9static Evas_Object *saved_win = NULL;
@@ -90,10 +90,8 @@ about_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term)
90 if (!ab_out) 90 if (!ab_out)
91 { 91 {
92 ab_over = o = evas_object_rectangle_add(evas_object_evas_get(win)); 92 ab_over = o = evas_object_rectangle_add(evas_object_evas_get(win));
93 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
94 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
95 evas_object_color_set(o, 0, 0, 0, 0); 93 evas_object_color_set(o, 0, 0, 0, 0);
96 elm_win_resize_object_add(win, o); 94 edje_object_part_swallow(bg, "terminology.dismiss", o);
97 evas_object_show(o); 95 evas_object_show(o);
98 evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, 96 evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN,
99 _cb_mouse_down, term); 97 _cb_mouse_down, term);
@@ -111,6 +109,7 @@ about_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term)
111 { 109 {
112 evas_object_del(ab_over); 110 evas_object_del(ab_over);
113 ab_over = NULL; 111 ab_over = NULL;
112
114 edje_object_signal_emit(bg, "about,hide", "terminology"); 113 edje_object_signal_emit(bg, "about,hide", "terminology");
115 ab_out = EINA_FALSE; 114 ab_out = EINA_FALSE;
116 elm_object_focus_set(ab_layout, EINA_FALSE); 115 elm_object_focus_set(ab_layout, EINA_FALSE);
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);
diff --git a/src/bin/options.c b/src/bin/options.c
index 49e84c5..6733266 100644
--- a/src/bin/options.c
+++ b/src/bin/options.c
@@ -11,9 +11,12 @@
11#include "termio.h" 11#include "termio.h"
12 12
13static Evas_Object *op_frame, *op_box = NULL, *op_toolbar = NULL, 13static Evas_Object *op_frame, *op_box = NULL, *op_toolbar = NULL,
14 *op_opbox = NULL, *op_tbox = NULL, *op_temp = NULL; 14 *op_opbox = NULL, *op_tbox = NULL, *op_temp = NULL,
15 *op_over = NULL;
15static Eina_Bool op_out = EINA_FALSE; 16static Eina_Bool op_out = EINA_FALSE;
16static Ecore_Timer *op_del_timer = NULL; 17static Ecore_Timer *op_del_timer = NULL;
18static Evas_Object *saved_win = NULL;
19static Evas_Object *saved_bg = NULL;
17 20
18static void 21static void
19_cb_op_font(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__) 22_cb_op_font(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
@@ -70,11 +73,19 @@ _cb_op_del_delay(void *data __UNUSED__)
70 return EINA_FALSE; 73 return EINA_FALSE;
71} 74}
72 75
76static void
77_cb_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *ev __UNUSED__)
78{
79 options_toggle(saved_win, saved_bg, data);
80}
81
73void 82void
74options_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term) 83options_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term)
75{ 84{
76 Evas_Object *o; 85 Evas_Object *o;
77 86
87 saved_win = win;
88 saved_bg = bg;
78 if (!op_frame) 89 if (!op_frame)
79 { 90 {
80 Elm_Object_Item *it_fn; 91 Elm_Object_Item *it_fn;
@@ -145,6 +156,13 @@ options_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term)
145 } 156 }
146 if (!op_out) 157 if (!op_out)
147 { 158 {
159 op_over = o = evas_object_rectangle_add(evas_object_evas_get(win));
160 evas_object_color_set(o, 0, 0, 0, 0);
161 edje_object_part_swallow(bg, "terminology.dismiss", o);
162 evas_object_show(o);
163 evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN,
164 _cb_mouse_down, term);
165
148 edje_object_signal_emit(bg, "options,show", "terminology"); 166 edje_object_signal_emit(bg, "options,show", "terminology");
149 op_out = EINA_TRUE; 167 op_out = EINA_TRUE;
150 elm_object_focus_set(op_toolbar, EINA_TRUE); 168 elm_object_focus_set(op_toolbar, EINA_TRUE);
@@ -156,6 +174,9 @@ options_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term)
156 } 174 }
157 else 175 else
158 { 176 {
177 evas_object_del(op_over);
178 op_over = NULL;
179
159 edje_object_signal_emit(bg, "options,hide", "terminology"); 180 edje_object_signal_emit(bg, "options,hide", "terminology");
160 op_out = EINA_FALSE; 181 op_out = EINA_FALSE;
161 elm_object_focus_set(op_frame, EINA_FALSE); 182 elm_object_focus_set(op_frame, EINA_FALSE);