Add key bindings to make C-/ select all and C-\ unselect all. (#309301,

2005-08-30  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkentry.c (gtk_entry_class_init): Add key bindings to
	make C-/ select all and C-\ unselect all.  (#309301,
	Kathy Fernandez)
This commit is contained in:
Matthias Clasen 2005-08-30 18:38:17 +00:00 committed by Matthias Clasen
parent 37df0b0172
commit fc8d9dc2bd
3 changed files with 29 additions and 4 deletions

View File

@ -1,5 +1,9 @@
2005-08-30 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkentry.c (gtk_entry_class_init): Add key bindings to
make C-/ select all and C-\ unselect all. (#309301,
Kathy Fernandez)
* gtk/gtkimcontextsimple.c: Change the compose sequence for
soft hyphen to be multi_key-minus-minus-space, and add
compose sequences multi_key-minus-minus-period and

View File

@ -1,5 +1,9 @@
2005-08-30 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkentry.c (gtk_entry_class_init): Add key bindings to
make C-/ select all and C-\ unselect all. (#309301,
Kathy Fernandez)
* gtk/gtkimcontextsimple.c: Change the compose sequence for
soft hyphen to be multi_key-minus-minus-space, and add
compose sequences multi_key-minus-minus-period and

View File

@ -765,6 +765,23 @@ gtk_entry_class_init (GtkEntryClass *class)
G_TYPE_INT, 1,
G_TYPE_BOOLEAN, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_slash, GDK_CONTROL_MASK,
"move_cursor", 3,
GTK_TYPE_MOVEMENT_STEP, GTK_MOVEMENT_BUFFER_ENDS,
G_TYPE_INT, -1,
G_TYPE_BOOLEAN, FALSE);
gtk_binding_entry_add_signal (binding_set, GDK_slash, GDK_CONTROL_MASK,
"move_cursor", 3,
GTK_TYPE_MOVEMENT_STEP, GTK_MOVEMENT_BUFFER_ENDS,
G_TYPE_INT, 1,
G_TYPE_BOOLEAN, TRUE);
/* Unselect all
*/
gtk_binding_entry_add_signal (binding_set, GDK_backslash, GDK_CONTROL_MASK,
"move_cursor", 3,
GTK_TYPE_MOVEMENT_STEP, GTK_MOVEMENT_VISUAL_POSITIONS,
G_TYPE_INT, 0,
G_TYPE_BOOLEAN, FALSE);
/* Activate
*/
@ -1378,7 +1395,7 @@ gtk_entry_draw_frame (GtkWidget *widget)
gtk_paint_focus (widget->style, widget->window, GTK_WIDGET_STATE (widget),
NULL, widget, "entry",
x, y, width, height);
0, 0, width, height);
}
}
@ -2400,7 +2417,7 @@ gtk_entry_move_cursor (GtkEntry *entry,
gint current_x = get_better_cursor_x (entry, entry->current_pos);
gint bound_x = get_better_cursor_x (entry, entry->selection_bound);
if (count < 0)
if (count <= 0)
new_pos = current_x < bound_x ? entry->current_pos : entry->selection_bound;
else
new_pos = current_x > bound_x ? entry->current_pos : entry->selection_bound;