From ddaf70747c712792598c9dbce2812b247991fafd Mon Sep 17 00:00:00 2001 From: JosephMcc Date: Mon, 4 Dec 2017 12:12:48 -0800 Subject: [PATCH] xed-view: Add shortcuts for change case Closes https://github.com/linuxmint/xed/issues/154 --- xed/resources/ui/xed-shortcuts.ui | 49 +++++++++++++++++-------------- xed/xed-view.c | 32 ++++++++++++++++++-- 2 files changed, 57 insertions(+), 24 deletions(-) diff --git a/xed/resources/ui/xed-shortcuts.ui b/xed/resources/ui/xed-shortcuts.ui index bd9b628..ad6ae4d 100644 --- a/xed/resources/ui/xed-shortcuts.ui +++ b/xed/resources/ui/xed-shortcuts.ui @@ -219,6 +219,26 @@ + + + 1 + Tools + + + 1 + <shift>F7 + Check spelling + + + + + 1 + <ctrl>P + Print the document + + + + 1 @@ -265,7 +285,6 @@ Move current word right - 1 @@ -304,26 +329,6 @@ - - - 1 - Tools - - - 1 - <shift>F7 - Check spelling - - - - - 1 - <ctrl>P - Print the document - - - - diff --git a/xed/xed-view.c b/xed/xed-view.c index 0099553..0a60133 100644 --- a/xed/xed-view.c +++ b/xed/xed-view.c @@ -607,8 +607,36 @@ xed_view_class_init (XedViewClass *klass) binding_set = gtk_binding_set_by_class (klass); - gtk_binding_entry_add_signal (binding_set, GDK_KEY_d, GDK_CONTROL_MASK, "delete_from_cursor", 2, G_TYPE_ENUM, - GTK_DELETE_PARAGRAPHS, G_TYPE_INT, 1); + gtk_binding_entry_add_signal (binding_set, + GDK_KEY_d, + GDK_CONTROL_MASK, + "delete_from_cursor", 2, + G_TYPE_ENUM, GTK_DELETE_PARAGRAPHS, + G_TYPE_INT, 1); + + gtk_binding_entry_add_signal (binding_set, + GDK_KEY_u, + GDK_CONTROL_MASK, + "change_case", 1, + G_TYPE_ENUM, GTK_SOURCE_CHANGE_CASE_UPPER); + + gtk_binding_entry_add_signal (binding_set, + GDK_KEY_l, + GDK_CONTROL_MASK, + "change_case", 1, + G_TYPE_ENUM, GTK_SOURCE_CHANGE_CASE_LOWER); + + gtk_binding_entry_add_signal (binding_set, + GDK_KEY_asciitilde, + GDK_CONTROL_MASK, + "change_case", 1, + G_TYPE_ENUM, GTK_SOURCE_CHANGE_CASE_TOGGLE); + + gtk_binding_entry_add_signal (binding_set, + GDK_KEY_t, + GDK_CONTROL_MASK, + "change_case", 1, + G_TYPE_ENUM, GTK_SOURCE_CHANGE_CASE_TITLE); } /**