discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=1ea9d73d33b739ba18a94be491bb2196569ff76b

commit 1ea9d73d33b739ba18a94be491bb2196569ff76b
Author: Peter Kjellerstedt <p...@axis.com>
Date:   Sun Oct 4 11:53:31 2015 -0400

    Add "(drag only)" to title for drag only edge bindings
    
    Reviewers: zmike
    
    Subscribers: cedric
    
    Differential Revision: https://phab.enlightenment.org/D3128
---
 .../conf_bindings/e_int_config_edgebindings.c      | 26 ++++++++++++++--------
 1 file changed, 17 insertions(+), 9 deletions(-)

diff --git a/src/modules/conf_bindings/e_int_config_edgebindings.c 
b/src/modules/conf_bindings/e_int_config_edgebindings.c
index 981a33d..3796b5b 100644
--- a/src/modules/conf_bindings/e_int_config_edgebindings.c
+++ b/src/modules/conf_bindings/e_int_config_edgebindings.c
@@ -35,7 +35,7 @@ static void         _add_edge_binding_cb(void *data, void 
*data2);
 static void         _modify_edge_binding_cb(void *data, void *data2);
 
 /********* Helper *************************/
-static char        *_edge_binding_text_get(E_Zone_Edge edge, float delay, int 
mod);
+static char        *_edge_binding_text_get(E_Zone_Edge edge, float delay, int 
mod, int drag_only);
 static void         _auto_apply_changes(E_Config_Dialog_Data *cfdata);
 static void         _find_edge_binding_action(const char *action, const char 
*params, int *g, int *a, int *n);
 
@@ -765,7 +765,7 @@ _update_edge_binding_list(E_Config_Dialog_Data *cfdata)
 
         bi = l->data;
 
-        b = _edge_binding_text_get(bi->edge, bi->delay, bi->modifiers);
+        b = _edge_binding_text_get(bi->edge, bi->delay, bi->modifiers, 
bi->drag_only);
         if (!b) continue;
 
         ic = edje_object_add(cfdata->evas);
@@ -930,7 +930,7 @@ _edge_grab_wnd_show(E_Config_Dialog_Data *cfdata)
 
    if (cfdata->locals.edge)
      {
-        label = _edge_binding_text_get(cfdata->locals.edge, 
((float)cfdata->locals.delay), cfdata->locals.modifiers);
+       label = _edge_binding_text_get(cfdata->locals.edge, 
((float)cfdata->locals.delay), cfdata->locals.modifiers, 
cfdata->locals.drag_only);
         edje_object_part_text_set(cfdata->gui.o_selector, "e.text.selection", 
label);
         E_FREE(label);
      }
@@ -978,7 +978,8 @@ _edge_grab_wnd_slider_changed_cb(void *data, Evas_Object 
*obj EINA_UNUSED)
    if (!cfdata->locals.edge) return;
    label = _edge_binding_text_get(cfdata->locals.edge,
                                   ((float)cfdata->locals.delay),
-                                  cfdata->locals.modifiers);
+                                  cfdata->locals.modifiers,
+                                  cfdata->locals.drag_only);
    edje_object_part_text_set(cfdata->gui.o_selector, "e.text.selection", 
label);
    E_FREE(label);
 }
@@ -992,12 +993,12 @@ _edge_grab_wnd_check_changed_cb(void *data, Evas_Object 
*obj EINA_UNUSED)
    if (cfdata->locals.click)
      {
         if (cfdata->locals.edge && cfdata->locals.button)
-          label = _edge_binding_text_get(cfdata->locals.edge, -1.0 * 
cfdata->locals.button, cfdata->locals.modifiers);
+          label = _edge_binding_text_get(cfdata->locals.edge, -1.0 * 
cfdata->locals.button, cfdata->locals.modifiers, cfdata->locals.drag_only);
      }
    else
      {
         if (cfdata->locals.edge)
-          label = _edge_binding_text_get(cfdata->locals.edge, 
((float)cfdata->locals.delay), cfdata->locals.modifiers);
+          label = _edge_binding_text_get(cfdata->locals.edge, 
((float)cfdata->locals.delay), cfdata->locals.modifiers, 
cfdata->locals.drag_only);
         e_widget_disabled_set(cfdata->gui.o_slider, 0);
      }
    e_widget_disabled_set(cfdata->gui.o_slider, cfdata->locals.click);
@@ -1087,7 +1088,8 @@ stop:
 
    label = _edge_binding_text_get(cfdata->locals.edge,
                                   cfdata->locals.click ? (-1.0 * 
cfdata->locals.button) : ((float)cfdata->locals.delay),
-                                  cfdata->locals.modifiers);
+                                  cfdata->locals.modifiers,
+                                  cfdata->locals.drag_only);
    edje_object_part_text_set(cfdata->gui.o_selector, "e.text.selection", 
label);
    E_FREE(label);
 }
@@ -1204,7 +1206,7 @@ _edge_grab_wnd_selection_apply(E_Config_Dialog_Data 
*cfdata)
           {
              char *label;
 
-             label = _edge_binding_text_get(bi->edge, bi->delay, 
bi->modifiers);
+             label = _edge_binding_text_get(bi->edge, bi->delay, 
bi->modifiers, bi->drag_only);
              e_widget_ilist_nth_label_set(cfdata->gui.o_binding_list, n, 
label);
              free(label);
           }
@@ -1357,7 +1359,7 @@ _find_edge_binding_action(const char *action, const char 
*params, int *g, int *a
 }
 
 static char *
-_edge_binding_text_get(E_Zone_Edge edge, float delay, int mod)
+_edge_binding_text_get(E_Zone_Edge edge, float delay, int mod, int drag_only)
 {
    char b[256] = "";
 
@@ -1439,6 +1441,12 @@ _edge_binding_text_get(E_Zone_Edge edge, float delay, 
int mod)
         strcat(b, buf);
      }
 
+   if (drag_only)
+     {
+        if (b[0]) strcat(b, " ");
+        strcat(b, _("(drag only)"));
+     }
+
    if (!b[0]) return strdup(TEXT_NONE_ACTION_EDGE);
    return strdup(b);
 }

-- 


Reply via email to