aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/options_keys.c
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2016-03-18 19:08:58 +0100
committerBoris Faure <billiob@gmail.com>2016-03-18 19:08:58 +0100
commita0b7fae2dd51480df0fd7c5213adf27b789c3141 (patch)
tree2620d3d2556b975c8813b28d82b72e544ecebb5c /src/bin/options_keys.c
parentremove buggy keybinding dedup (diff)
downloadterminology-a0b7fae2dd51480df0fd7c5213adf27b789c3141.tar.gz
add a reset button to reset the key bindings
Diffstat (limited to 'src/bin/options_keys.c')
-rw-r--r--src/bin/options_keys.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/bin/options_keys.c b/src/bin/options_keys.c
index 95ca85d..b70035f 100644
--- a/src/bin/options_keys.c
+++ b/src/bin/options_keys.c
@@ -337,6 +337,16 @@ char *gl_group_text_get(void *data, Evas_Object *obj EINA_UNUSED,
return strdup(action->description);
}
+static void
+_cb_reset_keys(void *data, Evas_Object *obj EINA_UNUSED,
+ void *event EINA_UNUSED)
+{
+ Evas_Object *gl = data;
+
+ config_reset_keys(_config);
+ elm_genlist_realized_items_update(gl);
+}
+
void
options_keys(Evas_Object *opbox, Evas_Object *term)
{
@@ -409,5 +419,11 @@ options_keys(Evas_Object *opbox, Evas_Object *term)
action++;
}
- /* TODO: reset button ? */
+ o = elm_button_add(bx);
+ evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_object_text_set(o, _("Reset bindings"));
+ elm_box_pack_end(bx, o);
+ evas_object_show(o);
+ evas_object_smart_callback_add(o, "clicked", _cb_reset_keys, gl);
}