Changeset View
Changeset View
Standalone View
Standalone View
b/gtk+-2/gtksecentry.c
Context not available. | |||||
GDK_CONTROL_MASK, "delete_from_cursor", 2, | GDK_CONTROL_MASK, "delete_from_cursor", 2, | ||||
G_TYPE_ENUM, GTK_DELETE_WORD_ENDS, | G_TYPE_ENUM, GTK_DELETE_WORD_ENDS, | ||||
G_TYPE_INT, -1); | G_TYPE_INT, -1); | ||||
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 | ||||
Context not available. | |||||
static void | static void | ||||
gtk_secure_entry_grab_focus(GtkWidget * widget) | gtk_secure_entry_grab_focus(GtkWidget * widget) | ||||
{ | { | ||||
GtkWidget *tmp; | |||||
GtkSecureEntry *entry = GTK_SECURE_ENTRY(widget); | GtkSecureEntry *entry = GTK_SECURE_ENTRY(widget); | ||||
gboolean select_on_focus; | gboolean select_on_focus; | ||||
GTK_WIDGET_SET_FLAGS(widget, GTK_CAN_DEFAULT); | GTK_WIDGET_SET_FLAGS(widget, GTK_CAN_DEFAULT); | ||||
GTK_WIDGET_CLASS(parent_class)->grab_focus(widget); | GTK_WIDGET_CLASS(parent_class)->grab_focus(widget); | ||||
g_object_get(gtk_widget_get_settings(widget), | /* read current select on focus setting from GtkEntry */ | ||||
tmp = gtk_entry_new (); | |||||
g_object_get(gtk_widget_get_settings(tmp), | |||||
"gtk-entry-select-on-focus", &select_on_focus, NULL); | "gtk-entry-select-on-focus", &select_on_focus, NULL); | ||||
gtk_widget_destroy (tmp); | |||||
if (select_on_focus && !entry->in_click) | if (select_on_focus && !entry->in_click) | ||||
gtk_editable_select_region(GTK_EDITABLE(widget), 0, -1); | gtk_editable_select_region(GTK_EDITABLE(widget), 0, -1); | ||||
Context not available. |