aboutsummaryrefslogtreecommitdiffstats
path: root/src
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
parentfix about text. (diff)
downloadterminology-5afd73501ff673a5735c662058ddd2cfa6e304e2.tar.gz
any button now dismisses the popup dialog things.
SVN revision: 73083
Diffstat (limited to 'src')
-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 @@
#include <Elementary.h>
#include "about.h"
-static Evas_Object *ab_layout = NULL, *ab_over;
+static Evas_Object *ab_layout = NULL, *ab_over = NULL;
static Eina_Bool ab_out = EINA_FALSE;
static Ecore_Timer *ab_del_timer = NULL;
static Evas_Object *saved_win = NULL;
@@ -90,10 +90,8 @@ about_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term)
if (!ab_out)
{
ab_over = o = evas_object_rectangle_add(evas_object_evas_get(win));
- evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_color_set(o, 0, 0, 0, 0);
- elm_win_resize_object_add(win, o);
+ edje_object_part_swallow(bg, "terminology.dismiss", o);
evas_object_show(o);
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN,
_cb_mouse_down, term);
@@ -111,6 +109,7 @@ about_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term)
{
evas_object_del(ab_over);
ab_over = NULL;
+
edje_object_signal_emit(bg, "about,hide", "terminology");
ab_out = EINA_FALSE;
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 @@
#include "about.h"
#include "termio.h"
-static Evas_Object *ct_frame, *ct_box = NULL;
+static Evas_Object *ct_frame = NULL, *ct_box = NULL, *ct_over = NULL;
static Eina_Bool ct_out = EINA_FALSE;
static Ecore_Timer *ct_del_timer = NULL;
+static Evas_Object *saved_win = NULL;
+static Evas_Object *saved_bg = NULL;
static Evas_Object *ct_win, *ct_bg, *ct_term;
@@ -50,11 +52,19 @@ _cb_ct_about(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event __U
about_toggle(ct_win, ct_bg, ct_term);
}
+static void
+_cb_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *ev __UNUSED__)
+{
+ controls_toggle(saved_win, saved_bg, data);
+}
+
void
controls_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term)
{
Evas_Object *o;
+ saved_win = win;
+ saved_bg = bg;
if (!ct_out)
{
if (options_active_get())
@@ -125,6 +135,13 @@ controls_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term)
}
if (!ct_out)
{
+ ct_over = o = evas_object_rectangle_add(evas_object_evas_get(win));
+ evas_object_color_set(o, 0, 0, 0, 0);
+ edje_object_part_swallow(bg, "terminology.dismiss", o);
+ evas_object_show(o);
+ evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN,
+ _cb_mouse_down, term);
+
ct_win = win;
ct_bg = bg;
ct_term = term;
@@ -139,6 +156,9 @@ controls_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term)
}
else
{
+ evas_object_del(ct_over);
+ ct_over = NULL;
+
edje_object_signal_emit(bg, "controls,hide", "terminology");
ct_out = EINA_FALSE;
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 @@
#include "termio.h"
static Evas_Object *op_frame, *op_box = NULL, *op_toolbar = NULL,
- *op_opbox = NULL, *op_tbox = NULL, *op_temp = NULL;
+ *op_opbox = NULL, *op_tbox = NULL, *op_temp = NULL,
+ *op_over = NULL;
static Eina_Bool op_out = EINA_FALSE;
static Ecore_Timer *op_del_timer = NULL;
+static Evas_Object *saved_win = NULL;
+static Evas_Object *saved_bg = NULL;
static void
_cb_op_font(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
@@ -70,11 +73,19 @@ _cb_op_del_delay(void *data __UNUSED__)
return EINA_FALSE;
}
+static void
+_cb_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *ev __UNUSED__)
+{
+ options_toggle(saved_win, saved_bg, data);
+}
+
void
options_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term)
{
Evas_Object *o;
+ saved_win = win;
+ saved_bg = bg;
if (!op_frame)
{
Elm_Object_Item *it_fn;
@@ -145,6 +156,13 @@ options_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term)
}
if (!op_out)
{
+ op_over = o = evas_object_rectangle_add(evas_object_evas_get(win));
+ evas_object_color_set(o, 0, 0, 0, 0);
+ edje_object_part_swallow(bg, "terminology.dismiss", o);
+ evas_object_show(o);
+ evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN,
+ _cb_mouse_down, term);
+
edje_object_signal_emit(bg, "options,show", "terminology");
op_out = EINA_TRUE;
elm_object_focus_set(op_toolbar, EINA_TRUE);
@@ -156,6 +174,9 @@ options_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term)
}
else
{
+ evas_object_del(op_over);
+ op_over = NULL;
+
edje_object_signal_emit(bg, "options,hide", "terminology");
op_out = EINA_FALSE;
elm_object_focus_set(op_frame, EINA_FALSE);