mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 10:50:10 +00:00
Add a GtkSetting (gtk-entry-select-on-focus) controlling whether the
Sat Feb 2 17:43:00 2002 Owen Taylor <otaylor@redhat.com> * gtk/gtkentry.c (gtk_entry_grab_focus): Add a GtkSetting (gtk-entry-select-on-focus) controlling whether the contents of an entry are selected on focus in. * gtk/gtkmenu.c (gtk_menu_key_press): Add a GtkSetting (gtk-can-change-accels) controlling whether accelerators can be changed on the fly or not. (#51902) * gtk/gtkmenu.c (gtk_menu_key_press): Allow unmodified accelerators, now that accelerator changing can be turned off for those who won't expect it. (#61285) * gtk/gtkaccelgroup.c (gtk_accelerator_valid): Allow Backspace/Delete/KP_Delete as valid accelerators. * gtk/gtkmenu.c (gtk_menu_key_press): Allow setting of Delete/Backspace as accelerators by making them toggle the menu item between empty and the pressed key. (#58605) * tests/testgtkrc: Remove the objectionably short cursor blink time setting.
This commit is contained in:
parent
2ee08d8ec6
commit
d6622d38d6
25
ChangeLog
25
ChangeLog
@ -1,3 +1,28 @@
|
|||||||
|
Sat Feb 2 17:43:00 2002 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
|
* gtk/gtkentry.c (gtk_entry_grab_focus): Add a GtkSetting
|
||||||
|
(gtk-entry-select-on-focus) controlling whether the
|
||||||
|
contents of an entry are selected on focus in.
|
||||||
|
|
||||||
|
* gtk/gtkmenu.c (gtk_menu_key_press): Add a GtkSetting
|
||||||
|
(gtk-can-change-accels) controlling whether accelerators can be
|
||||||
|
changed on the fly or not. (#51902)
|
||||||
|
|
||||||
|
* gtk/gtkmenu.c (gtk_menu_key_press): Allow unmodified
|
||||||
|
accelerators, now that accelerator changing can be turned
|
||||||
|
off for those who won't expect it. (#61285)
|
||||||
|
|
||||||
|
* gtk/gtkaccelgroup.c (gtk_accelerator_valid): Allow
|
||||||
|
Backspace/Delete/KP_Delete as valid accelerators.
|
||||||
|
|
||||||
|
* gtk/gtkmenu.c (gtk_menu_key_press): Allow setting of
|
||||||
|
Delete/Backspace as accelerators by making them toggle
|
||||||
|
the menu item between empty and the pressed key.
|
||||||
|
(#58605)
|
||||||
|
|
||||||
|
* tests/testgtkrc: Remove the objectionably short cursor blink
|
||||||
|
time setting.
|
||||||
|
|
||||||
Sat Feb 2 16:43:31 2002 Owen Taylor <otaylor@redhat.com>
|
Sat Feb 2 16:43:31 2002 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gtk/gtkmenu.c (gtk_menu_popup): To get around the fact
|
* gtk/gtkmenu.c (gtk_menu_popup): To get around the fact
|
||||||
|
@ -1,3 +1,28 @@
|
|||||||
|
Sat Feb 2 17:43:00 2002 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
|
* gtk/gtkentry.c (gtk_entry_grab_focus): Add a GtkSetting
|
||||||
|
(gtk-entry-select-on-focus) controlling whether the
|
||||||
|
contents of an entry are selected on focus in.
|
||||||
|
|
||||||
|
* gtk/gtkmenu.c (gtk_menu_key_press): Add a GtkSetting
|
||||||
|
(gtk-can-change-accels) controlling whether accelerators can be
|
||||||
|
changed on the fly or not. (#51902)
|
||||||
|
|
||||||
|
* gtk/gtkmenu.c (gtk_menu_key_press): Allow unmodified
|
||||||
|
accelerators, now that accelerator changing can be turned
|
||||||
|
off for those who won't expect it. (#61285)
|
||||||
|
|
||||||
|
* gtk/gtkaccelgroup.c (gtk_accelerator_valid): Allow
|
||||||
|
Backspace/Delete/KP_Delete as valid accelerators.
|
||||||
|
|
||||||
|
* gtk/gtkmenu.c (gtk_menu_key_press): Allow setting of
|
||||||
|
Delete/Backspace as accelerators by making them toggle
|
||||||
|
the menu item between empty and the pressed key.
|
||||||
|
(#58605)
|
||||||
|
|
||||||
|
* tests/testgtkrc: Remove the objectionably short cursor blink
|
||||||
|
time setting.
|
||||||
|
|
||||||
Sat Feb 2 16:43:31 2002 Owen Taylor <otaylor@redhat.com>
|
Sat Feb 2 16:43:31 2002 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gtk/gtkmenu.c (gtk_menu_popup): To get around the fact
|
* gtk/gtkmenu.c (gtk_menu_popup): To get around the fact
|
||||||
|
@ -1,3 +1,28 @@
|
|||||||
|
Sat Feb 2 17:43:00 2002 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
|
* gtk/gtkentry.c (gtk_entry_grab_focus): Add a GtkSetting
|
||||||
|
(gtk-entry-select-on-focus) controlling whether the
|
||||||
|
contents of an entry are selected on focus in.
|
||||||
|
|
||||||
|
* gtk/gtkmenu.c (gtk_menu_key_press): Add a GtkSetting
|
||||||
|
(gtk-can-change-accels) controlling whether accelerators can be
|
||||||
|
changed on the fly or not. (#51902)
|
||||||
|
|
||||||
|
* gtk/gtkmenu.c (gtk_menu_key_press): Allow unmodified
|
||||||
|
accelerators, now that accelerator changing can be turned
|
||||||
|
off for those who won't expect it. (#61285)
|
||||||
|
|
||||||
|
* gtk/gtkaccelgroup.c (gtk_accelerator_valid): Allow
|
||||||
|
Backspace/Delete/KP_Delete as valid accelerators.
|
||||||
|
|
||||||
|
* gtk/gtkmenu.c (gtk_menu_key_press): Allow setting of
|
||||||
|
Delete/Backspace as accelerators by making them toggle
|
||||||
|
the menu item between empty and the pressed key.
|
||||||
|
(#58605)
|
||||||
|
|
||||||
|
* tests/testgtkrc: Remove the objectionably short cursor blink
|
||||||
|
time setting.
|
||||||
|
|
||||||
Sat Feb 2 16:43:31 2002 Owen Taylor <otaylor@redhat.com>
|
Sat Feb 2 16:43:31 2002 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gtk/gtkmenu.c (gtk_menu_popup): To get around the fact
|
* gtk/gtkmenu.c (gtk_menu_popup): To get around the fact
|
||||||
|
@ -1,3 +1,28 @@
|
|||||||
|
Sat Feb 2 17:43:00 2002 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
|
* gtk/gtkentry.c (gtk_entry_grab_focus): Add a GtkSetting
|
||||||
|
(gtk-entry-select-on-focus) controlling whether the
|
||||||
|
contents of an entry are selected on focus in.
|
||||||
|
|
||||||
|
* gtk/gtkmenu.c (gtk_menu_key_press): Add a GtkSetting
|
||||||
|
(gtk-can-change-accels) controlling whether accelerators can be
|
||||||
|
changed on the fly or not. (#51902)
|
||||||
|
|
||||||
|
* gtk/gtkmenu.c (gtk_menu_key_press): Allow unmodified
|
||||||
|
accelerators, now that accelerator changing can be turned
|
||||||
|
off for those who won't expect it. (#61285)
|
||||||
|
|
||||||
|
* gtk/gtkaccelgroup.c (gtk_accelerator_valid): Allow
|
||||||
|
Backspace/Delete/KP_Delete as valid accelerators.
|
||||||
|
|
||||||
|
* gtk/gtkmenu.c (gtk_menu_key_press): Allow setting of
|
||||||
|
Delete/Backspace as accelerators by making them toggle
|
||||||
|
the menu item between empty and the pressed key.
|
||||||
|
(#58605)
|
||||||
|
|
||||||
|
* tests/testgtkrc: Remove the objectionably short cursor blink
|
||||||
|
time setting.
|
||||||
|
|
||||||
Sat Feb 2 16:43:31 2002 Owen Taylor <otaylor@redhat.com>
|
Sat Feb 2 16:43:31 2002 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gtk/gtkmenu.c (gtk_menu_popup): To get around the fact
|
* gtk/gtkmenu.c (gtk_menu_popup): To get around the fact
|
||||||
|
@ -1,3 +1,28 @@
|
|||||||
|
Sat Feb 2 17:43:00 2002 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
|
* gtk/gtkentry.c (gtk_entry_grab_focus): Add a GtkSetting
|
||||||
|
(gtk-entry-select-on-focus) controlling whether the
|
||||||
|
contents of an entry are selected on focus in.
|
||||||
|
|
||||||
|
* gtk/gtkmenu.c (gtk_menu_key_press): Add a GtkSetting
|
||||||
|
(gtk-can-change-accels) controlling whether accelerators can be
|
||||||
|
changed on the fly or not. (#51902)
|
||||||
|
|
||||||
|
* gtk/gtkmenu.c (gtk_menu_key_press): Allow unmodified
|
||||||
|
accelerators, now that accelerator changing can be turned
|
||||||
|
off for those who won't expect it. (#61285)
|
||||||
|
|
||||||
|
* gtk/gtkaccelgroup.c (gtk_accelerator_valid): Allow
|
||||||
|
Backspace/Delete/KP_Delete as valid accelerators.
|
||||||
|
|
||||||
|
* gtk/gtkmenu.c (gtk_menu_key_press): Allow setting of
|
||||||
|
Delete/Backspace as accelerators by making them toggle
|
||||||
|
the menu item between empty and the pressed key.
|
||||||
|
(#58605)
|
||||||
|
|
||||||
|
* tests/testgtkrc: Remove the objectionably short cursor blink
|
||||||
|
time setting.
|
||||||
|
|
||||||
Sat Feb 2 16:43:31 2002 Owen Taylor <otaylor@redhat.com>
|
Sat Feb 2 16:43:31 2002 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gtk/gtkmenu.c (gtk_menu_popup): To get around the fact
|
* gtk/gtkmenu.c (gtk_menu_popup): To get around the fact
|
||||||
|
@ -1,3 +1,28 @@
|
|||||||
|
Sat Feb 2 17:43:00 2002 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
|
* gtk/gtkentry.c (gtk_entry_grab_focus): Add a GtkSetting
|
||||||
|
(gtk-entry-select-on-focus) controlling whether the
|
||||||
|
contents of an entry are selected on focus in.
|
||||||
|
|
||||||
|
* gtk/gtkmenu.c (gtk_menu_key_press): Add a GtkSetting
|
||||||
|
(gtk-can-change-accels) controlling whether accelerators can be
|
||||||
|
changed on the fly or not. (#51902)
|
||||||
|
|
||||||
|
* gtk/gtkmenu.c (gtk_menu_key_press): Allow unmodified
|
||||||
|
accelerators, now that accelerator changing can be turned
|
||||||
|
off for those who won't expect it. (#61285)
|
||||||
|
|
||||||
|
* gtk/gtkaccelgroup.c (gtk_accelerator_valid): Allow
|
||||||
|
Backspace/Delete/KP_Delete as valid accelerators.
|
||||||
|
|
||||||
|
* gtk/gtkmenu.c (gtk_menu_key_press): Allow setting of
|
||||||
|
Delete/Backspace as accelerators by making them toggle
|
||||||
|
the menu item between empty and the pressed key.
|
||||||
|
(#58605)
|
||||||
|
|
||||||
|
* tests/testgtkrc: Remove the objectionably short cursor blink
|
||||||
|
time setting.
|
||||||
|
|
||||||
Sat Feb 2 16:43:31 2002 Owen Taylor <otaylor@redhat.com>
|
Sat Feb 2 16:43:31 2002 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gtk/gtkmenu.c (gtk_menu_popup): To get around the fact
|
* gtk/gtkmenu.c (gtk_menu_popup): To get around the fact
|
||||||
|
@ -1,3 +1,28 @@
|
|||||||
|
Sat Feb 2 17:43:00 2002 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
|
* gtk/gtkentry.c (gtk_entry_grab_focus): Add a GtkSetting
|
||||||
|
(gtk-entry-select-on-focus) controlling whether the
|
||||||
|
contents of an entry are selected on focus in.
|
||||||
|
|
||||||
|
* gtk/gtkmenu.c (gtk_menu_key_press): Add a GtkSetting
|
||||||
|
(gtk-can-change-accels) controlling whether accelerators can be
|
||||||
|
changed on the fly or not. (#51902)
|
||||||
|
|
||||||
|
* gtk/gtkmenu.c (gtk_menu_key_press): Allow unmodified
|
||||||
|
accelerators, now that accelerator changing can be turned
|
||||||
|
off for those who won't expect it. (#61285)
|
||||||
|
|
||||||
|
* gtk/gtkaccelgroup.c (gtk_accelerator_valid): Allow
|
||||||
|
Backspace/Delete/KP_Delete as valid accelerators.
|
||||||
|
|
||||||
|
* gtk/gtkmenu.c (gtk_menu_key_press): Allow setting of
|
||||||
|
Delete/Backspace as accelerators by making them toggle
|
||||||
|
the menu item between empty and the pressed key.
|
||||||
|
(#58605)
|
||||||
|
|
||||||
|
* tests/testgtkrc: Remove the objectionably short cursor blink
|
||||||
|
time setting.
|
||||||
|
|
||||||
Sat Feb 2 16:43:31 2002 Owen Taylor <otaylor@redhat.com>
|
Sat Feb 2 16:43:31 2002 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gtk/gtkmenu.c (gtk_menu_popup): To get around the fact
|
* gtk/gtkmenu.c (gtk_menu_popup): To get around the fact
|
||||||
|
@ -803,7 +803,6 @@ gtk_accelerator_valid (guint keyval,
|
|||||||
GdkModifierType modifiers)
|
GdkModifierType modifiers)
|
||||||
{
|
{
|
||||||
static const guint invalid_accelerator_vals[] = {
|
static const guint invalid_accelerator_vals[] = {
|
||||||
GDK_BackSpace, GDK_Delete, GDK_KP_Delete,
|
|
||||||
GDK_Shift_L, GDK_Shift_R, GDK_Shift_Lock, GDK_Caps_Lock, GDK_ISO_Lock,
|
GDK_Shift_L, GDK_Shift_R, GDK_Shift_Lock, GDK_Caps_Lock, GDK_ISO_Lock,
|
||||||
GDK_Control_L, GDK_Control_R, GDK_Meta_L, GDK_Meta_R,
|
GDK_Control_L, GDK_Control_R, GDK_Meta_L, GDK_Meta_R,
|
||||||
GDK_Alt_L, GDK_Alt_R, GDK_Super_L, GDK_Super_R, GDK_Hyper_L, GDK_Hyper_R,
|
GDK_Alt_L, GDK_Alt_R, GDK_Super_L, GDK_Super_R, GDK_Hyper_L, GDK_Hyper_R,
|
||||||
|
@ -780,6 +780,12 @@ gtk_entry_class_init (GtkEntryClass *class)
|
|||||||
"toggle_overwrite", 0);
|
"toggle_overwrite", 0);
|
||||||
gtk_binding_entry_add_signal (binding_set, GDK_KP_Insert, 0,
|
gtk_binding_entry_add_signal (binding_set, GDK_KP_Insert, 0,
|
||||||
"toggle_overwrite", 0);
|
"toggle_overwrite", 0);
|
||||||
|
|
||||||
|
gtk_settings_install_property (g_param_spec_boolean ("gtk-entry-select-on-focus",
|
||||||
|
_("Select on focus"),
|
||||||
|
_("Whether to select the contents of an entry when it is focused."),
|
||||||
|
TRUE,
|
||||||
|
G_PARAM_READWRITE));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -1659,9 +1665,16 @@ gtk_entry_focus_out (GtkWidget *widget,
|
|||||||
static void
|
static void
|
||||||
gtk_entry_grab_focus (GtkWidget *widget)
|
gtk_entry_grab_focus (GtkWidget *widget)
|
||||||
{
|
{
|
||||||
GTK_WIDGET_CLASS (parent_class)->grab_focus (widget);
|
gboolean select_on_focus;
|
||||||
|
|
||||||
|
GTK_WIDGET_CLASS (parent_class)->grab_focus (widget);
|
||||||
|
|
||||||
if (!GTK_ENTRY (widget)->in_click)
|
g_object_get (G_OBJECT (gtk_settings_get_default ()),
|
||||||
|
"gtk-entry-select-on-focus",
|
||||||
|
&select_on_focus,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
if (select_on_focus && !GTK_ENTRY (widget)->in_click)
|
||||||
gtk_editable_select_region (GTK_EDITABLE (widget), 0, -1);
|
gtk_editable_select_region (GTK_EDITABLE (widget), 0, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -256,6 +256,12 @@ gtk_menu_class_init (GtkMenuClass *class)
|
|||||||
"move_current", 1,
|
"move_current", 1,
|
||||||
GTK_TYPE_MENU_DIRECTION_TYPE,
|
GTK_TYPE_MENU_DIRECTION_TYPE,
|
||||||
GTK_MENU_DIR_CHILD);
|
GTK_MENU_DIR_CHILD);
|
||||||
|
|
||||||
|
gtk_settings_install_property (g_param_spec_boolean ("gtk-can-change-accels",
|
||||||
|
_("Can change accelerators"),
|
||||||
|
_("Whether menu accelerators can be changed by pressing a key over the menu item."),
|
||||||
|
FALSE,
|
||||||
|
G_PARAM_READWRITE));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1700,8 +1706,8 @@ gtk_menu_key_press (GtkWidget *widget,
|
|||||||
{
|
{
|
||||||
GtkMenuShell *menu_shell;
|
GtkMenuShell *menu_shell;
|
||||||
GtkMenu *menu;
|
GtkMenu *menu;
|
||||||
GtkAccelGroup *accel_group;
|
|
||||||
gboolean delete = FALSE;
|
gboolean delete = FALSE;
|
||||||
|
gboolean can_change_accels;
|
||||||
gchar *accel = NULL;
|
gchar *accel = NULL;
|
||||||
guint accel_key, accel_mods;
|
guint accel_key, accel_mods;
|
||||||
|
|
||||||
@ -1710,7 +1716,6 @@ gtk_menu_key_press (GtkWidget *widget,
|
|||||||
|
|
||||||
menu_shell = GTK_MENU_SHELL (widget);
|
menu_shell = GTK_MENU_SHELL (widget);
|
||||||
menu = GTK_MENU (widget);
|
menu = GTK_MENU (widget);
|
||||||
accel_group = gtk_menu_get_accel_group (menu);
|
|
||||||
|
|
||||||
gtk_menu_stop_navigating_submenu (menu);
|
gtk_menu_stop_navigating_submenu (menu);
|
||||||
|
|
||||||
@ -1760,17 +1765,20 @@ gtk_menu_key_press (GtkWidget *widget,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_object_get (G_OBJECT (gtk_settings_get_default ()),
|
||||||
|
"gtk-can-change-accels",
|
||||||
|
&can_change_accels,
|
||||||
|
NULL);
|
||||||
|
|
||||||
accel_key = event->keyval;
|
accel_key = event->keyval;
|
||||||
accel_mods = event->state & gtk_accelerator_get_default_mod_mask ();
|
accel_mods = event->state & gtk_accelerator_get_default_mod_mask ();
|
||||||
|
|
||||||
/* Modify the accelerators */
|
/* Modify the accelerators */
|
||||||
if (menu_shell->active_menu_item &&
|
if (can_change_accels &&
|
||||||
|
menu_shell->active_menu_item &&
|
||||||
GTK_BIN (menu_shell->active_menu_item)->child && /* no seperators */
|
GTK_BIN (menu_shell->active_menu_item)->child && /* no seperators */
|
||||||
GTK_MENU_ITEM (menu_shell->active_menu_item)->submenu == NULL && /* no submenus */
|
GTK_MENU_ITEM (menu_shell->active_menu_item)->submenu == NULL && /* no submenus */
|
||||||
(delete ||
|
(delete || gtk_accelerator_valid (event->keyval, event->state)))
|
||||||
(gtk_accelerator_valid (event->keyval, event->state) &&
|
|
||||||
(accel_mods ||
|
|
||||||
(accel_key >= GDK_F1 && accel_key <= GDK_F35)))))
|
|
||||||
{
|
{
|
||||||
GtkWidget *menu_item = menu_shell->active_menu_item;
|
GtkWidget *menu_item = menu_shell->active_menu_item;
|
||||||
gboolean replace_accels = TRUE;
|
gboolean replace_accels = TRUE;
|
||||||
@ -1791,10 +1799,20 @@ gtk_menu_key_press (GtkWidget *widget,
|
|||||||
{
|
{
|
||||||
gboolean changed;
|
gboolean changed;
|
||||||
|
|
||||||
|
/* For the keys that act to delete the current setting, we delete
|
||||||
|
* the current setting if there is one, otherwise, we set the
|
||||||
|
* key as the accelerator.
|
||||||
|
*/
|
||||||
if (delete)
|
if (delete)
|
||||||
{
|
{
|
||||||
accel_key = 0;
|
GtkAccelKey key;
|
||||||
accel_mods = 0;
|
|
||||||
|
if (gtk_accel_map_lookup_entry (path, &key) &&
|
||||||
|
key.accel_key || key.accel_mods)
|
||||||
|
{
|
||||||
|
accel_key = 0;
|
||||||
|
accel_mods = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
changed = gtk_accel_map_change_entry (path, accel_key, accel_mods, replace_accels);
|
changed = gtk_accel_map_change_entry (path, accel_key, accel_mods, replace_accels);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user