mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-14 20:51:07 +00:00
textview: Port bindings to use shortcuts
This commit is contained in:
parent
df457cadfc
commit
48b46c8d08
@ -30,7 +30,6 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "gtkadjustmentprivate.h"
|
#include "gtkadjustmentprivate.h"
|
||||||
#include "gtkbindings.h"
|
|
||||||
#include "gtkcsscolorvalueprivate.h"
|
#include "gtkcsscolorvalueprivate.h"
|
||||||
#include "gtkdebug.h"
|
#include "gtkdebug.h"
|
||||||
#include "gtkdropcontrollermotion.h"
|
#include "gtkdropcontrollermotion.h"
|
||||||
@ -779,7 +778,7 @@ gtk_text_view_drop_scroll_leave (GtkDropControllerMotion *motion,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
add_move_binding (GtkBindingSet *binding_set,
|
add_move_binding (GtkWidgetClass *widget_class,
|
||||||
guint keyval,
|
guint keyval,
|
||||||
guint modmask,
|
guint modmask,
|
||||||
GtkMovementStep step,
|
GtkMovementStep step,
|
||||||
@ -787,18 +786,16 @@ add_move_binding (GtkBindingSet *binding_set,
|
|||||||
{
|
{
|
||||||
g_assert ((modmask & GDK_SHIFT_MASK) == 0);
|
g_assert ((modmask & GDK_SHIFT_MASK) == 0);
|
||||||
|
|
||||||
gtk_binding_entry_add_signal (binding_set, keyval, modmask,
|
gtk_widget_class_add_binding_signal (widget_class,
|
||||||
"move-cursor", 3,
|
keyval, modmask,
|
||||||
G_TYPE_ENUM, step,
|
"move-cursor",
|
||||||
G_TYPE_INT, count,
|
"(iib)", step, count, FALSE);
|
||||||
G_TYPE_BOOLEAN, FALSE);
|
|
||||||
|
|
||||||
/* Selection-extending version */
|
/* Selection-extending version */
|
||||||
gtk_binding_entry_add_signal (binding_set, keyval, modmask | GDK_SHIFT_MASK,
|
gtk_widget_class_add_binding_signal (widget_class,
|
||||||
"move-cursor", 3,
|
keyval, modmask | GDK_SHIFT_MASK,
|
||||||
G_TYPE_ENUM, step,
|
"move-cursor",
|
||||||
G_TYPE_INT, count,
|
"(iib)", step, count, TRUE);
|
||||||
G_TYPE_BOOLEAN, TRUE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -807,7 +804,6 @@ gtk_text_view_class_init (GtkTextViewClass *klass)
|
|||||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||||
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
|
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
|
||||||
GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass);
|
GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass);
|
||||||
GtkBindingSet *binding_set;
|
|
||||||
|
|
||||||
/* Default handlers and virtual methods
|
/* Default handlers and virtual methods
|
||||||
*/
|
*/
|
||||||
@ -1476,232 +1472,273 @@ gtk_text_view_class_init (GtkTextViewClass *klass)
|
|||||||
* Key bindings
|
* Key bindings
|
||||||
*/
|
*/
|
||||||
|
|
||||||
binding_set = gtk_binding_set_by_class (klass);
|
|
||||||
|
|
||||||
/* Moving the insertion point */
|
/* Moving the insertion point */
|
||||||
add_move_binding (binding_set, GDK_KEY_Right, 0,
|
add_move_binding (widget_class, GDK_KEY_Right, 0,
|
||||||
GTK_MOVEMENT_VISUAL_POSITIONS, 1);
|
GTK_MOVEMENT_VISUAL_POSITIONS, 1);
|
||||||
|
|
||||||
add_move_binding (binding_set, GDK_KEY_KP_Right, 0,
|
add_move_binding (widget_class, GDK_KEY_KP_Right, 0,
|
||||||
GTK_MOVEMENT_VISUAL_POSITIONS, 1);
|
GTK_MOVEMENT_VISUAL_POSITIONS, 1);
|
||||||
|
|
||||||
add_move_binding (binding_set, GDK_KEY_Left, 0,
|
add_move_binding (widget_class, GDK_KEY_Left, 0,
|
||||||
GTK_MOVEMENT_VISUAL_POSITIONS, -1);
|
GTK_MOVEMENT_VISUAL_POSITIONS, -1);
|
||||||
|
|
||||||
add_move_binding (binding_set, GDK_KEY_KP_Left, 0,
|
add_move_binding (widget_class, GDK_KEY_KP_Left, 0,
|
||||||
GTK_MOVEMENT_VISUAL_POSITIONS, -1);
|
GTK_MOVEMENT_VISUAL_POSITIONS, -1);
|
||||||
|
|
||||||
add_move_binding (binding_set, GDK_KEY_Right, GDK_CONTROL_MASK,
|
add_move_binding (widget_class, GDK_KEY_Right, GDK_CONTROL_MASK,
|
||||||
GTK_MOVEMENT_WORDS, 1);
|
GTK_MOVEMENT_WORDS, 1);
|
||||||
|
|
||||||
add_move_binding (binding_set, GDK_KEY_KP_Right, GDK_CONTROL_MASK,
|
add_move_binding (widget_class, GDK_KEY_KP_Right, GDK_CONTROL_MASK,
|
||||||
GTK_MOVEMENT_WORDS, 1);
|
GTK_MOVEMENT_WORDS, 1);
|
||||||
|
|
||||||
add_move_binding (binding_set, GDK_KEY_Left, GDK_CONTROL_MASK,
|
add_move_binding (widget_class, GDK_KEY_Left, GDK_CONTROL_MASK,
|
||||||
GTK_MOVEMENT_WORDS, -1);
|
GTK_MOVEMENT_WORDS, -1);
|
||||||
|
|
||||||
add_move_binding (binding_set, GDK_KEY_KP_Left, GDK_CONTROL_MASK,
|
add_move_binding (widget_class, GDK_KEY_KP_Left, GDK_CONTROL_MASK,
|
||||||
GTK_MOVEMENT_WORDS, -1);
|
GTK_MOVEMENT_WORDS, -1);
|
||||||
|
|
||||||
add_move_binding (binding_set, GDK_KEY_Up, 0,
|
add_move_binding (widget_class, GDK_KEY_Up, 0,
|
||||||
GTK_MOVEMENT_DISPLAY_LINES, -1);
|
GTK_MOVEMENT_DISPLAY_LINES, -1);
|
||||||
|
|
||||||
add_move_binding (binding_set, GDK_KEY_KP_Up, 0,
|
add_move_binding (widget_class, GDK_KEY_KP_Up, 0,
|
||||||
GTK_MOVEMENT_DISPLAY_LINES, -1);
|
GTK_MOVEMENT_DISPLAY_LINES, -1);
|
||||||
|
|
||||||
add_move_binding (binding_set, GDK_KEY_Down, 0,
|
add_move_binding (widget_class, GDK_KEY_Down, 0,
|
||||||
GTK_MOVEMENT_DISPLAY_LINES, 1);
|
GTK_MOVEMENT_DISPLAY_LINES, 1);
|
||||||
|
|
||||||
add_move_binding (binding_set, GDK_KEY_KP_Down, 0,
|
add_move_binding (widget_class, GDK_KEY_KP_Down, 0,
|
||||||
GTK_MOVEMENT_DISPLAY_LINES, 1);
|
GTK_MOVEMENT_DISPLAY_LINES, 1);
|
||||||
|
|
||||||
add_move_binding (binding_set, GDK_KEY_Up, GDK_CONTROL_MASK,
|
add_move_binding (widget_class, GDK_KEY_Up, GDK_CONTROL_MASK,
|
||||||
GTK_MOVEMENT_PARAGRAPHS, -1);
|
GTK_MOVEMENT_PARAGRAPHS, -1);
|
||||||
|
|
||||||
add_move_binding (binding_set, GDK_KEY_KP_Up, GDK_CONTROL_MASK,
|
add_move_binding (widget_class, GDK_KEY_KP_Up, GDK_CONTROL_MASK,
|
||||||
GTK_MOVEMENT_PARAGRAPHS, -1);
|
GTK_MOVEMENT_PARAGRAPHS, -1);
|
||||||
|
|
||||||
add_move_binding (binding_set, GDK_KEY_Down, GDK_CONTROL_MASK,
|
add_move_binding (widget_class, GDK_KEY_Down, GDK_CONTROL_MASK,
|
||||||
GTK_MOVEMENT_PARAGRAPHS, 1);
|
GTK_MOVEMENT_PARAGRAPHS, 1);
|
||||||
|
|
||||||
add_move_binding (binding_set, GDK_KEY_KP_Down, GDK_CONTROL_MASK,
|
add_move_binding (widget_class, GDK_KEY_KP_Down, GDK_CONTROL_MASK,
|
||||||
GTK_MOVEMENT_PARAGRAPHS, 1);
|
GTK_MOVEMENT_PARAGRAPHS, 1);
|
||||||
|
|
||||||
add_move_binding (binding_set, GDK_KEY_Home, 0,
|
add_move_binding (widget_class, GDK_KEY_Home, 0,
|
||||||
GTK_MOVEMENT_DISPLAY_LINE_ENDS, -1);
|
GTK_MOVEMENT_DISPLAY_LINE_ENDS, -1);
|
||||||
|
|
||||||
add_move_binding (binding_set, GDK_KEY_KP_Home, 0,
|
add_move_binding (widget_class, GDK_KEY_KP_Home, 0,
|
||||||
GTK_MOVEMENT_DISPLAY_LINE_ENDS, -1);
|
GTK_MOVEMENT_DISPLAY_LINE_ENDS, -1);
|
||||||
|
|
||||||
add_move_binding (binding_set, GDK_KEY_End, 0,
|
add_move_binding (widget_class, GDK_KEY_End, 0,
|
||||||
GTK_MOVEMENT_DISPLAY_LINE_ENDS, 1);
|
GTK_MOVEMENT_DISPLAY_LINE_ENDS, 1);
|
||||||
|
|
||||||
add_move_binding (binding_set, GDK_KEY_KP_End, 0,
|
add_move_binding (widget_class, GDK_KEY_KP_End, 0,
|
||||||
GTK_MOVEMENT_DISPLAY_LINE_ENDS, 1);
|
GTK_MOVEMENT_DISPLAY_LINE_ENDS, 1);
|
||||||
|
|
||||||
add_move_binding (binding_set, GDK_KEY_Home, GDK_CONTROL_MASK,
|
add_move_binding (widget_class, GDK_KEY_Home, GDK_CONTROL_MASK,
|
||||||
GTK_MOVEMENT_BUFFER_ENDS, -1);
|
GTK_MOVEMENT_BUFFER_ENDS, -1);
|
||||||
|
|
||||||
add_move_binding (binding_set, GDK_KEY_KP_Home, GDK_CONTROL_MASK,
|
add_move_binding (widget_class, GDK_KEY_KP_Home, GDK_CONTROL_MASK,
|
||||||
GTK_MOVEMENT_BUFFER_ENDS, -1);
|
GTK_MOVEMENT_BUFFER_ENDS, -1);
|
||||||
|
|
||||||
add_move_binding (binding_set, GDK_KEY_End, GDK_CONTROL_MASK,
|
add_move_binding (widget_class, GDK_KEY_End, GDK_CONTROL_MASK,
|
||||||
GTK_MOVEMENT_BUFFER_ENDS, 1);
|
GTK_MOVEMENT_BUFFER_ENDS, 1);
|
||||||
|
|
||||||
add_move_binding (binding_set, GDK_KEY_KP_End, GDK_CONTROL_MASK,
|
add_move_binding (widget_class, GDK_KEY_KP_End, GDK_CONTROL_MASK,
|
||||||
GTK_MOVEMENT_BUFFER_ENDS, 1);
|
GTK_MOVEMENT_BUFFER_ENDS, 1);
|
||||||
|
|
||||||
add_move_binding (binding_set, GDK_KEY_Page_Up, 0,
|
add_move_binding (widget_class, GDK_KEY_Page_Up, 0,
|
||||||
GTK_MOVEMENT_PAGES, -1);
|
GTK_MOVEMENT_PAGES, -1);
|
||||||
|
|
||||||
add_move_binding (binding_set, GDK_KEY_KP_Page_Up, 0,
|
add_move_binding (widget_class, GDK_KEY_KP_Page_Up, 0,
|
||||||
GTK_MOVEMENT_PAGES, -1);
|
GTK_MOVEMENT_PAGES, -1);
|
||||||
|
|
||||||
add_move_binding (binding_set, GDK_KEY_Page_Down, 0,
|
add_move_binding (widget_class, GDK_KEY_Page_Down, 0,
|
||||||
GTK_MOVEMENT_PAGES, 1);
|
GTK_MOVEMENT_PAGES, 1);
|
||||||
|
|
||||||
add_move_binding (binding_set, GDK_KEY_KP_Page_Down, 0,
|
add_move_binding (widget_class, GDK_KEY_KP_Page_Down, 0,
|
||||||
GTK_MOVEMENT_PAGES, 1);
|
GTK_MOVEMENT_PAGES, 1);
|
||||||
|
|
||||||
add_move_binding (binding_set, GDK_KEY_Page_Up, GDK_CONTROL_MASK,
|
add_move_binding (widget_class, GDK_KEY_Page_Up, GDK_CONTROL_MASK,
|
||||||
GTK_MOVEMENT_HORIZONTAL_PAGES, -1);
|
GTK_MOVEMENT_HORIZONTAL_PAGES, -1);
|
||||||
|
|
||||||
add_move_binding (binding_set, GDK_KEY_KP_Page_Up, GDK_CONTROL_MASK,
|
add_move_binding (widget_class, GDK_KEY_KP_Page_Up, GDK_CONTROL_MASK,
|
||||||
GTK_MOVEMENT_HORIZONTAL_PAGES, -1);
|
GTK_MOVEMENT_HORIZONTAL_PAGES, -1);
|
||||||
|
|
||||||
add_move_binding (binding_set, GDK_KEY_Page_Down, GDK_CONTROL_MASK,
|
add_move_binding (widget_class, GDK_KEY_Page_Down, GDK_CONTROL_MASK,
|
||||||
GTK_MOVEMENT_HORIZONTAL_PAGES, 1);
|
GTK_MOVEMENT_HORIZONTAL_PAGES, 1);
|
||||||
|
|
||||||
add_move_binding (binding_set, GDK_KEY_KP_Page_Down, GDK_CONTROL_MASK,
|
add_move_binding (widget_class, GDK_KEY_KP_Page_Down, GDK_CONTROL_MASK,
|
||||||
GTK_MOVEMENT_HORIZONTAL_PAGES, 1);
|
GTK_MOVEMENT_HORIZONTAL_PAGES, 1);
|
||||||
|
|
||||||
/* Select all */
|
/* Select all */
|
||||||
gtk_binding_entry_add_signal (binding_set, GDK_KEY_a, GDK_CONTROL_MASK,
|
gtk_widget_class_add_binding_signal (widget_class,
|
||||||
"select-all", 1,
|
GDK_KEY_a, GDK_CONTROL_MASK,
|
||||||
G_TYPE_BOOLEAN, TRUE);
|
"select-all",
|
||||||
|
"(b)", TRUE);
|
||||||
|
|
||||||
gtk_binding_entry_add_signal (binding_set, GDK_KEY_slash, GDK_CONTROL_MASK,
|
gtk_widget_class_add_binding_signal (widget_class,
|
||||||
"select-all", 1,
|
GDK_KEY_slash, GDK_CONTROL_MASK,
|
||||||
G_TYPE_BOOLEAN, TRUE);
|
"select-all",
|
||||||
|
"(b)", TRUE);
|
||||||
|
|
||||||
/* Unselect all */
|
/* Unselect all */
|
||||||
gtk_binding_entry_add_signal (binding_set, GDK_KEY_backslash, GDK_CONTROL_MASK,
|
gtk_widget_class_add_binding_signal (widget_class,
|
||||||
"select-all", 1,
|
GDK_KEY_backslash, GDK_CONTROL_MASK,
|
||||||
G_TYPE_BOOLEAN, FALSE);
|
"select-all",
|
||||||
|
"(b)", FALSE);
|
||||||
|
|
||||||
gtk_binding_entry_add_signal (binding_set, GDK_KEY_a, GDK_SHIFT_MASK | GDK_CONTROL_MASK,
|
gtk_widget_class_add_binding_signal (widget_class,
|
||||||
"select-all", 1,
|
GDK_KEY_a, GDK_SHIFT_MASK | GDK_CONTROL_MASK,
|
||||||
G_TYPE_BOOLEAN, FALSE);
|
"select-all",
|
||||||
|
"(b)", FALSE);
|
||||||
|
|
||||||
/* Deleting text */
|
/* Deleting text */
|
||||||
gtk_binding_entry_add_signal (binding_set, GDK_KEY_Delete, 0,
|
gtk_widget_class_add_binding_signal (widget_class,
|
||||||
"delete-from-cursor", 2,
|
GDK_KEY_Delete, 0,
|
||||||
G_TYPE_ENUM, GTK_DELETE_CHARS,
|
"delete-from-cursor",
|
||||||
G_TYPE_INT, 1);
|
"(ii)", GTK_DELETE_CHARS, 1);
|
||||||
|
|
||||||
gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Delete, 0,
|
gtk_widget_class_add_binding_signal (widget_class,
|
||||||
"delete-from-cursor", 2,
|
GDK_KEY_KP_Delete, 0,
|
||||||
G_TYPE_ENUM, GTK_DELETE_CHARS,
|
"delete-from-cursor",
|
||||||
G_TYPE_INT, 1);
|
"(ii)", GTK_DELETE_CHARS, 1);
|
||||||
|
|
||||||
gtk_binding_entry_add_signal (binding_set, GDK_KEY_BackSpace, 0,
|
gtk_widget_class_add_binding_signal (widget_class,
|
||||||
"backspace", 0);
|
GDK_KEY_BackSpace, 0,
|
||||||
|
"backspace",
|
||||||
|
NULL);
|
||||||
|
|
||||||
/* Make this do the same as Backspace, to help with mis-typing */
|
/* Make this do the same as Backspace, to help with mis-typing */
|
||||||
gtk_binding_entry_add_signal (binding_set, GDK_KEY_BackSpace, GDK_SHIFT_MASK,
|
gtk_widget_class_add_binding_signal (widget_class,
|
||||||
"backspace", 0);
|
GDK_KEY_BackSpace, GDK_SHIFT_MASK,
|
||||||
|
"backspace",
|
||||||
|
NULL);
|
||||||
|
|
||||||
gtk_binding_entry_add_signal (binding_set, GDK_KEY_Delete, GDK_CONTROL_MASK,
|
gtk_widget_class_add_binding_signal (widget_class,
|
||||||
"delete-from-cursor", 2,
|
GDK_KEY_Delete, GDK_CONTROL_MASK,
|
||||||
G_TYPE_ENUM, GTK_DELETE_WORD_ENDS,
|
"delete-from-cursor",
|
||||||
G_TYPE_INT, 1);
|
"(ii)", GTK_DELETE_WORD_ENDS, 1);
|
||||||
|
|
||||||
gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Delete, GDK_CONTROL_MASK,
|
gtk_widget_class_add_binding_signal (widget_class,
|
||||||
"delete-from-cursor", 2,
|
GDK_KEY_KP_Delete, GDK_CONTROL_MASK,
|
||||||
G_TYPE_ENUM, GTK_DELETE_WORD_ENDS,
|
"delete-from-cursor",
|
||||||
G_TYPE_INT, 1);
|
"(ii)", GTK_DELETE_WORD_ENDS, 1);
|
||||||
|
|
||||||
gtk_binding_entry_add_signal (binding_set, GDK_KEY_BackSpace, GDK_CONTROL_MASK,
|
gtk_widget_class_add_binding_signal (widget_class,
|
||||||
"delete-from-cursor", 2,
|
GDK_KEY_BackSpace, GDK_CONTROL_MASK,
|
||||||
G_TYPE_ENUM, GTK_DELETE_WORD_ENDS,
|
"delete-from-cursor",
|
||||||
G_TYPE_INT, -1);
|
"(ii)", GTK_DELETE_WORD_ENDS, -1);
|
||||||
|
|
||||||
gtk_binding_entry_add_signal (binding_set, GDK_KEY_Delete, GDK_SHIFT_MASK | GDK_CONTROL_MASK,
|
gtk_widget_class_add_binding_signal (widget_class,
|
||||||
"delete-from-cursor", 2,
|
GDK_KEY_Delete, GDK_SHIFT_MASK | GDK_CONTROL_MASK,
|
||||||
G_TYPE_ENUM, GTK_DELETE_PARAGRAPH_ENDS,
|
"delete-from-cursor",
|
||||||
G_TYPE_INT, 1);
|
"(ii)", GTK_DELETE_PARAGRAPH_ENDS, 1);
|
||||||
|
|
||||||
gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Delete, GDK_SHIFT_MASK | GDK_CONTROL_MASK,
|
gtk_widget_class_add_binding_signal (widget_class,
|
||||||
"delete-from-cursor", 2,
|
GDK_KEY_KP_Delete, GDK_SHIFT_MASK | GDK_CONTROL_MASK,
|
||||||
G_TYPE_ENUM, GTK_DELETE_PARAGRAPH_ENDS,
|
"delete-from-cursor",
|
||||||
G_TYPE_INT, 1);
|
"(ii)", GTK_DELETE_PARAGRAPH_ENDS, 1);
|
||||||
|
|
||||||
gtk_binding_entry_add_signal (binding_set, GDK_KEY_BackSpace, GDK_SHIFT_MASK | GDK_CONTROL_MASK,
|
gtk_widget_class_add_binding_signal (widget_class,
|
||||||
"delete-from-cursor", 2,
|
GDK_KEY_BackSpace, GDK_SHIFT_MASK | GDK_CONTROL_MASK,
|
||||||
G_TYPE_ENUM, GTK_DELETE_PARAGRAPH_ENDS,
|
"delete-from-cursor",
|
||||||
G_TYPE_INT, -1);
|
"(ii)", GTK_DELETE_PARAGRAPH_ENDS, -1);
|
||||||
|
|
||||||
/* Cut/copy/paste */
|
/* Cut/copy/paste */
|
||||||
|
|
||||||
gtk_binding_entry_add_signal (binding_set, GDK_KEY_x, GDK_CONTROL_MASK,
|
gtk_widget_class_add_binding_signal (widget_class,
|
||||||
"cut-clipboard", 0);
|
GDK_KEY_x, GDK_CONTROL_MASK,
|
||||||
gtk_binding_entry_add_signal (binding_set, GDK_KEY_c, GDK_CONTROL_MASK,
|
"cut-clipboard",
|
||||||
"copy-clipboard", 0);
|
NULL);
|
||||||
gtk_binding_entry_add_signal (binding_set, GDK_KEY_v, GDK_CONTROL_MASK,
|
gtk_widget_class_add_binding_signal (widget_class,
|
||||||
"paste-clipboard", 0);
|
GDK_KEY_c, GDK_CONTROL_MASK,
|
||||||
|
"copy-clipboard",
|
||||||
|
NULL);
|
||||||
|
gtk_widget_class_add_binding_signal (widget_class,
|
||||||
|
GDK_KEY_v, GDK_CONTROL_MASK,
|
||||||
|
"paste-clipboard",
|
||||||
|
NULL);
|
||||||
|
|
||||||
gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Delete, GDK_SHIFT_MASK,
|
gtk_widget_class_add_binding_signal (widget_class,
|
||||||
"cut-clipboard", 0);
|
GDK_KEY_KP_Delete, GDK_SHIFT_MASK,
|
||||||
gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Insert, GDK_CONTROL_MASK,
|
"cut-clipboard",
|
||||||
"copy-clipboard", 0);
|
NULL);
|
||||||
gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Insert, GDK_SHIFT_MASK,
|
gtk_widget_class_add_binding_signal (widget_class,
|
||||||
"paste-clipboard", 0);
|
GDK_KEY_KP_Insert, GDK_CONTROL_MASK,
|
||||||
|
"copy-clipboard",
|
||||||
|
NULL);
|
||||||
|
gtk_widget_class_add_binding_signal (widget_class,
|
||||||
|
GDK_KEY_KP_Insert, GDK_SHIFT_MASK,
|
||||||
|
"paste-clipboard",
|
||||||
|
NULL);
|
||||||
|
|
||||||
gtk_binding_entry_add_signal (binding_set, GDK_KEY_Delete, GDK_SHIFT_MASK,
|
gtk_widget_class_add_binding_signal (widget_class,
|
||||||
"cut-clipboard", 0);
|
GDK_KEY_Delete, GDK_SHIFT_MASK,
|
||||||
gtk_binding_entry_add_signal (binding_set, GDK_KEY_Insert, GDK_CONTROL_MASK,
|
"cut-clipboard",
|
||||||
"copy-clipboard", 0);
|
NULL);
|
||||||
gtk_binding_entry_add_signal (binding_set, GDK_KEY_Insert, GDK_SHIFT_MASK,
|
gtk_widget_class_add_binding_signal (widget_class,
|
||||||
"paste-clipboard", 0);
|
GDK_KEY_Insert, GDK_CONTROL_MASK,
|
||||||
|
"copy-clipboard",
|
||||||
|
NULL);
|
||||||
|
gtk_widget_class_add_binding_signal (widget_class,
|
||||||
|
GDK_KEY_Insert, GDK_SHIFT_MASK,
|
||||||
|
"paste-clipboard",
|
||||||
|
NULL);
|
||||||
|
|
||||||
/* Undo/Redo */
|
/* Undo/Redo */
|
||||||
gtk_binding_entry_add_action (binding_set, GDK_KEY_z, GDK_CONTROL_MASK,
|
gtk_widget_class_add_binding_action (widget_class,
|
||||||
"text.undo", NULL);
|
GDK_KEY_z, GDK_CONTROL_MASK,
|
||||||
gtk_binding_entry_add_action (binding_set, GDK_KEY_y, GDK_CONTROL_MASK,
|
"text.undo", NULL);
|
||||||
"text.redo", NULL);
|
gtk_widget_class_add_binding_action (widget_class,
|
||||||
gtk_binding_entry_add_action (binding_set, GDK_KEY_z, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
|
GDK_KEY_y, GDK_CONTROL_MASK,
|
||||||
"text.redo", NULL);
|
"text.redo", NULL);
|
||||||
|
gtk_widget_class_add_binding_action (widget_class,
|
||||||
|
GDK_KEY_z, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
|
||||||
|
"text.redo", NULL);
|
||||||
|
|
||||||
/* Overwrite */
|
/* Overwrite */
|
||||||
gtk_binding_entry_add_signal (binding_set, GDK_KEY_Insert, 0,
|
gtk_widget_class_add_binding_signal (widget_class,
|
||||||
"toggle-overwrite", 0);
|
GDK_KEY_Insert, 0,
|
||||||
gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Insert, 0,
|
"toggle-overwrite",
|
||||||
"toggle-overwrite", 0);
|
NULL);
|
||||||
|
gtk_widget_class_add_binding_signal (widget_class,
|
||||||
|
GDK_KEY_KP_Insert, 0,
|
||||||
|
"toggle-overwrite",
|
||||||
|
NULL);
|
||||||
|
|
||||||
/* Emoji */
|
/* Emoji */
|
||||||
gtk_binding_entry_add_signal (binding_set, GDK_KEY_period, GDK_CONTROL_MASK,
|
gtk_widget_class_add_binding_signal (widget_class,
|
||||||
"insert-emoji", 0);
|
GDK_KEY_period, GDK_CONTROL_MASK,
|
||||||
gtk_binding_entry_add_signal (binding_set, GDK_KEY_semicolon, GDK_CONTROL_MASK,
|
"insert-emoji",
|
||||||
"insert-emoji", 0);
|
NULL);
|
||||||
|
gtk_widget_class_add_binding_signal (widget_class,
|
||||||
|
GDK_KEY_semicolon, GDK_CONTROL_MASK,
|
||||||
|
"insert-emoji",
|
||||||
|
NULL);
|
||||||
|
|
||||||
/* Caret mode */
|
/* Caret mode */
|
||||||
gtk_binding_entry_add_signal (binding_set, GDK_KEY_F7, 0,
|
gtk_widget_class_add_binding_signal (widget_class,
|
||||||
"toggle-cursor-visible", 0);
|
GDK_KEY_F7, 0,
|
||||||
|
"toggle-cursor-visible",
|
||||||
|
NULL);
|
||||||
|
|
||||||
/* Control-tab focus motion */
|
/* Control-tab focus motion */
|
||||||
gtk_binding_entry_add_signal (binding_set, GDK_KEY_Tab, GDK_CONTROL_MASK,
|
gtk_widget_class_add_binding_signal (widget_class,
|
||||||
"move-focus", 1,
|
GDK_KEY_Tab, GDK_CONTROL_MASK,
|
||||||
GTK_TYPE_DIRECTION_TYPE, GTK_DIR_TAB_FORWARD);
|
"move-focus",
|
||||||
gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Tab, GDK_CONTROL_MASK,
|
"(i)", GTK_DIR_TAB_FORWARD);
|
||||||
"move-focus", 1,
|
gtk_widget_class_add_binding_signal (widget_class,
|
||||||
GTK_TYPE_DIRECTION_TYPE, GTK_DIR_TAB_FORWARD);
|
GDK_KEY_KP_Tab, GDK_CONTROL_MASK,
|
||||||
|
"move-focus",
|
||||||
|
"(i)", GTK_DIR_TAB_FORWARD);
|
||||||
|
|
||||||
gtk_binding_entry_add_signal (binding_set, GDK_KEY_Tab, GDK_SHIFT_MASK | GDK_CONTROL_MASK,
|
gtk_widget_class_add_binding_signal (widget_class,
|
||||||
"move-focus", 1,
|
GDK_KEY_Tab, GDK_SHIFT_MASK | GDK_CONTROL_MASK,
|
||||||
GTK_TYPE_DIRECTION_TYPE, GTK_DIR_TAB_BACKWARD);
|
"move-focus",
|
||||||
gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Tab, GDK_SHIFT_MASK | GDK_CONTROL_MASK,
|
"(i)", GTK_DIR_TAB_BACKWARD);
|
||||||
"move-focus", 1,
|
gtk_widget_class_add_binding_signal (widget_class,
|
||||||
GTK_TYPE_DIRECTION_TYPE, GTK_DIR_TAB_BACKWARD);
|
GDK_KEY_KP_Tab, GDK_SHIFT_MASK | GDK_CONTROL_MASK,
|
||||||
|
"move-focus",
|
||||||
|
"(i)", GTK_DIR_TAB_BACKWARD);
|
||||||
|
|
||||||
gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_TEXT_VIEW_ACCESSIBLE);
|
gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_TEXT_VIEW_ACCESSIBLE);
|
||||||
gtk_widget_class_set_css_name (widget_class, I_("textview"));
|
gtk_widget_class_set_css_name (widget_class, I_("textview"));
|
||||||
|
Loading…
Reference in New Issue
Block a user