Add "(drag only)" to title for drag only edge bindings

Reviewers: zmike

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D3128
This commit is contained in:
Peter Kjellerstedt 2015-10-04 11:53:31 -04:00 committed by Mike Blumenkrantz
parent c57f2ff611
commit 1ea9d73d33
1 changed files with 17 additions and 9 deletions

View File

@ -35,7 +35,7 @@ static void _add_edge_binding_cb(void *data, void *data2);
static void _modify_edge_binding_cb(void *data, void *data2); static void _modify_edge_binding_cb(void *data, void *data2);
/********* Helper *************************/ /********* 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 _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); 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; 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; if (!b) continue;
ic = edje_object_add(cfdata->evas); ic = edje_object_add(cfdata->evas);
@ -930,7 +930,7 @@ _edge_grab_wnd_show(E_Config_Dialog_Data *cfdata)
if (cfdata->locals.edge) 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); edje_object_part_text_set(cfdata->gui.o_selector, "e.text.selection", label);
E_FREE(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; if (!cfdata->locals.edge) return;
label = _edge_binding_text_get(cfdata->locals.edge, label = _edge_binding_text_get(cfdata->locals.edge,
((float)cfdata->locals.delay), ((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); edje_object_part_text_set(cfdata->gui.o_selector, "e.text.selection", label);
E_FREE(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.click)
{ {
if (cfdata->locals.edge && cfdata->locals.button) 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 else
{ {
if (cfdata->locals.edge) 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, 0);
} }
e_widget_disabled_set(cfdata->gui.o_slider, cfdata->locals.click); e_widget_disabled_set(cfdata->gui.o_slider, cfdata->locals.click);
@ -1087,7 +1088,8 @@ stop:
label = _edge_binding_text_get(cfdata->locals.edge, label = _edge_binding_text_get(cfdata->locals.edge,
cfdata->locals.click ? (-1.0 * cfdata->locals.button) : ((float)cfdata->locals.delay), 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); edje_object_part_text_set(cfdata->gui.o_selector, "e.text.selection", label);
E_FREE(label); E_FREE(label);
} }
@ -1204,7 +1206,7 @@ _edge_grab_wnd_selection_apply(E_Config_Dialog_Data *cfdata)
{ {
char *label; 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); e_widget_ilist_nth_label_set(cfdata->gui.o_binding_list, n, label);
free(label); free(label);
} }
@ -1357,7 +1359,7 @@ _find_edge_binding_action(const char *action, const char *params, int *g, int *a
} }
static char * 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] = ""; char b[256] = "";
@ -1439,6 +1441,12 @@ _edge_binding_text_get(E_Zone_Edge edge, float delay, int mod)
strcat(b, buf); strcat(b, buf);
} }
if (drag_only)
{
if (b[0]) strcat(b, " ");
strcat(b, _("(drag only)"));
}
if (!b[0]) return strdup(TEXT_NONE_ACTION_EDGE); if (!b[0]) return strdup(TEXT_NONE_ACTION_EDGE);
return strdup(b); return strdup(b);
} }