summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAli Alzyod <ali198724@gmail.com>2020-01-13 11:50:37 +0000
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2020-01-15 11:03:52 +0100
commit4386a70177f1516a8da96e522bd105d6e6dc2481 (patch)
tree7da730b89138eb3f5020296124db38d3f534ba6d
parent1a1868ce57a3c0e45735bb3afa5aa5243ef78018 (diff)
efl.ui.textbox: paste in mouse button 2
efl.ui.textbox: paste in mouse button 2 work on primary instead of clipboard Differential Revision: https://phab.enlightenment.org/D11068
-rw-r--r--src/lib/elementary/efl_ui_textbox.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/lib/elementary/efl_ui_textbox.c b/src/lib/elementary/efl_ui_textbox.c
index c64c1baf03..053979c82f 100644
--- a/src/lib/elementary/efl_ui_textbox.c
+++ b/src/lib/elementary/efl_ui_textbox.c
@@ -211,6 +211,7 @@ static void _anchors_free(Efl_Ui_Textbox_Data *sd);
211static void _selection_defer(Eo *obj, Efl_Ui_Textbox_Data *sd); 211static void _selection_defer(Eo *obj, Efl_Ui_Textbox_Data *sd);
212static Eina_Position2D _decoration_calc_offset(Efl_Ui_Textbox_Data *sd); 212static Eina_Position2D _decoration_calc_offset(Efl_Ui_Textbox_Data *sd);
213static void _update_text_theme(Eo *obj, Efl_Ui_Textbox_Data *sd); 213static void _update_text_theme(Eo *obj, Efl_Ui_Textbox_Data *sd);
214static void _efl_ui_textbox_selection_paste_type(Eo *obj, Efl_Ui_Selection_Type type);
214 215
215static char * 216static char *
216_file_load(Eo *obj) 217_file_load(Eo *obj)
@@ -1235,7 +1236,7 @@ _mouse_down_cb(void *data,
1235 1236
1236 if (ev->button == 2) 1237 if (ev->button == 2)
1237 { 1238 {
1238 efl_ui_textbox_selection_paste(data); 1239 _efl_ui_textbox_selection_paste_type(data, EFL_UI_SELECTION_TYPE_PRIMARY);
1239 } 1240 }
1240 1241
1241 /* If right button is pressed and context menu disabled is true, 1242 /* If right button is pressed and context menu disabled is true,
@@ -2186,18 +2187,24 @@ _efl_ui_textbox_selection_copy(Eo *obj, Efl_Ui_Textbox_Data *sd)
2186 efl_event_callback_call(obj, EFL_UI_TEXTBOX_EVENT_SELECTION_COPY, NULL); 2187 efl_event_callback_call(obj, EFL_UI_TEXTBOX_EVENT_SELECTION_COPY, NULL);
2187} 2188}
2188 2189
2189EOLIAN static void 2190static void
2190_efl_ui_textbox_selection_paste(Eo *obj, Efl_Ui_Textbox_Data *sd EINA_UNUSED) 2191_efl_ui_textbox_selection_paste_type(Eo *obj, Efl_Ui_Selection_Type type)
2191{ 2192{
2192 Efl_Ui_Selection_Format formats = EFL_UI_SELECTION_FORMAT_TEXT | EFL_UI_SELECTION_FORMAT_MARKUP; 2193 Efl_Ui_Selection_Format formats = EFL_UI_SELECTION_FORMAT_TEXT | EFL_UI_SELECTION_FORMAT_MARKUP;
2193 2194
2194 efl_ui_selection_get(obj, EFL_UI_SELECTION_TYPE_CLIPBOARD, formats, 2195 efl_ui_selection_get(obj, type, formats,
2195 NULL, _selection_data_cb, NULL, 1); 2196 NULL, _selection_data_cb, NULL, 1);
2196 2197
2197 efl_event_callback_call(obj, EFL_UI_TEXTBOX_EVENT_SELECTION_PASTE, NULL); 2198 efl_event_callback_call(obj, EFL_UI_TEXTBOX_EVENT_SELECTION_PASTE, NULL);
2198} 2199}
2199 2200
2200EOLIAN static void 2201EOLIAN static void
2202_efl_ui_textbox_selection_paste(Eo *obj, Efl_Ui_Textbox_Data *sd EINA_UNUSED)
2203{
2204 _efl_ui_textbox_selection_paste_type(obj, EFL_UI_SELECTION_TYPE_CLIPBOARD);
2205}
2206
2207EOLIAN static void
2201_efl_ui_textbox_context_menu_enabled_set(Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd, Eina_Bool enabled) 2208_efl_ui_textbox_context_menu_enabled_set(Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd, Eina_Bool enabled)
2202{ 2209{
2203 if (sd->context_menu_enabled == enabled) return; 2210 if (sd->context_menu_enabled == enabled) return;