Double click select the whole address
This commit is contained in:
parent
5a26d51d20
commit
edb4e7aae1
@ -617,6 +617,19 @@ sugar_address_entry_class_init(SugarAddressEntryClass *klass)
|
|||||||
G_PARAM_READWRITE));
|
G_PARAM_READWRITE));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
button_press_event_cb (GtkWidget *widget, GdkEventButton *event)
|
||||||
|
{
|
||||||
|
if (event->button == 1 && event->type == GDK_2BUTTON_PRESS) {
|
||||||
|
gtk_editable_select_region(GTK_EDITABLE(widget), 0, -1);
|
||||||
|
gtk_widget_grab_focus(widget);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
focus_in_event_cb(GtkWidget *widget, GdkEventFocus *event)
|
focus_in_event_cb(GtkWidget *widget, GdkEventFocus *event)
|
||||||
{
|
{
|
||||||
@ -642,4 +655,6 @@ sugar_address_entry_init(SugarAddressEntry *entry)
|
|||||||
G_CALLBACK(focus_in_event_cb), NULL);
|
G_CALLBACK(focus_in_event_cb), NULL);
|
||||||
g_signal_connect(entry, "focus-out-event",
|
g_signal_connect(entry, "focus-out-event",
|
||||||
G_CALLBACK(focus_out_event_cb), NULL);
|
G_CALLBACK(focus_out_event_cb), NULL);
|
||||||
|
g_signal_connect(entry, "button-press-event",
|
||||||
|
G_CALLBACK(button_press_event_cb), NULL);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user