summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIván Briano <sachieru@gmail.com>2011-07-25 14:08:38 +0000
committerIván Briano <sachieru@gmail.com>2011-07-25 14:08:38 +0000
commit38b40990e533ae273d1e3fc2b12492c69624b10f (patch)
treed8c3ff9191b9f37315150fcad62b704a9b708969
parent7db652a3834be695bd095954e2f9964af7e0c0f0 (diff)
Add triple click for entries, for line selection magics and who knows what else
SVN revision: 61694
-rw-r--r--legacy/elementary/src/lib/Elementary.h.in1
-rw-r--r--legacy/elementary/src/lib/elm_entry.c12
2 files changed, 13 insertions, 0 deletions
diff --git a/legacy/elementary/src/lib/Elementary.h.in b/legacy/elementary/src/lib/Elementary.h.in
index 60e2da3..f7ed4ef 100644
--- a/legacy/elementary/src/lib/Elementary.h.in
+++ b/legacy/elementary/src/lib/Elementary.h.in
@@ -5729,6 +5729,7 @@ extern "C" {
5729 * seconds. 5729 * seconds.
5730 * @li "clicked": The entry has been clicked (mouse press and release). 5730 * @li "clicked": The entry has been clicked (mouse press and release).
5731 * @li "clicked,double": The entry has been double clicked. 5731 * @li "clicked,double": The entry has been double clicked.
5732 * @li "clicked,triple": The entry has been triple clicked.
5732 * @li "focused": The entry has received focus. 5733 * @li "focused": The entry has received focus.
5733 * @li "unfocused": The entry has lost focus. 5734 * @li "unfocused": The entry has lost focus.
5734 * @li "selection,paste": A paste of the clipboard contents was requested. 5735 * @li "selection,paste": A paste of the clipboard contents was requested.
diff --git a/legacy/elementary/src/lib/elm_entry.c b/legacy/elementary/src/lib/elm_entry.c
index 111bab9..b70ed42 100644
--- a/legacy/elementary/src/lib/elm_entry.c
+++ b/legacy/elementary/src/lib/elm_entry.c
@@ -123,6 +123,7 @@ static const char SIG_PRESS[] = "press";
123static const char SIG_LONGPRESSED[] = "longpressed"; 123static const char SIG_LONGPRESSED[] = "longpressed";
124static const char SIG_CLICKED[] = "clicked"; 124static const char SIG_CLICKED[] = "clicked";
125static const char SIG_CLICKED_DOUBLE[] = "clicked,double"; 125static const char SIG_CLICKED_DOUBLE[] = "clicked,double";
126static const char SIG_CLICKED_TRIPLE[] = "clicked,triple";
126static const char SIG_FOCUSED[] = "focused"; 127static const char SIG_FOCUSED[] = "focused";
127static const char SIG_UNFOCUSED[] = "unfocused"; 128static const char SIG_UNFOCUSED[] = "unfocused";
128static const char SIG_SELECTION_PASTE[] = "selection,paste"; 129static const char SIG_SELECTION_PASTE[] = "selection,paste";
@@ -145,6 +146,7 @@ static const Evas_Smart_Cb_Description _signals[] = {
145 {SIG_LONGPRESSED, ""}, 146 {SIG_LONGPRESSED, ""},
146 {SIG_CLICKED, ""}, 147 {SIG_CLICKED, ""},
147 {SIG_CLICKED_DOUBLE, ""}, 148 {SIG_CLICKED_DOUBLE, ""},
149 {SIG_CLICKED_TRIPLE, ""},
148 {SIG_FOCUSED, ""}, 150 {SIG_FOCUSED, ""},
149 {SIG_UNFOCUSED, ""}, 151 {SIG_UNFOCUSED, ""},
150 {SIG_SELECTION_PASTE, ""}, 152 {SIG_SELECTION_PASTE, ""},
@@ -1575,6 +1577,14 @@ _signal_mouse_double(void *data, Evas_Object *obj __UNUSED__, const char *emissi
1575 evas_object_smart_callback_call(data, SIG_CLICKED_DOUBLE, NULL); 1577 evas_object_smart_callback_call(data, SIG_CLICKED_DOUBLE, NULL);
1576} 1578}
1577 1579
1580static void
1581_signal_mouse_triple(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
1582{
1583 Widget_Data *wd = elm_widget_data_get(data);
1584 if (!wd) return;
1585 evas_object_smart_callback_call(data, SIG_CLICKED_TRIPLE, NULL);
1586}
1587
1578#ifdef HAVE_ELEMENTARY_X 1588#ifdef HAVE_ELEMENTARY_X
1579static Eina_Bool 1589static Eina_Bool
1580_event_selection_notify(void *data, int type __UNUSED__, void *event) 1590_event_selection_notify(void *data, int type __UNUSED__, void *event)
@@ -2008,6 +2018,8 @@ elm_entry_add(Evas_Object *parent)
2008 _signal_mouse_clicked, obj); 2018 _signal_mouse_clicked, obj);
2009 edje_object_signal_callback_add(wd->ent, "mouse,down,1,double", "elm.text", 2019 edje_object_signal_callback_add(wd->ent, "mouse,down,1,double", "elm.text",
2010 _signal_mouse_double, obj); 2020 _signal_mouse_double, obj);
2021 edje_object_signal_callback_add(wd->ent, "mouse,down,1,triple", "elm.text",
2022 _signal_mouse_triple, obj);
2011 edje_object_part_text_set(wd->ent, "elm.text", ""); 2023 edje_object_part_text_set(wd->ent, "elm.text", "");
2012 if (_elm_config->desktop_entry) 2024 if (_elm_config->desktop_entry)
2013 edje_object_part_text_select_allow_set(wd->ent, "elm.text", EINA_TRUE); 2025 edje_object_part_text_select_allow_set(wd->ent, "elm.text", EINA_TRUE);