summaryrefslogtreecommitdiff
path: root/tp-account-widgets
diff options
context:
space:
mode:
authorDebarshi Ray <debarshir@gnome.org>2016-06-06 17:24:19 +0200
committerDebarshi Ray <debarshir@gnome.org>2016-06-07 09:41:14 +0200
commit0bad64b02bf3e9fd1c0d24c249951f15c4114b60 (patch)
tree7556583bf63f35a26417ccb8c1ad62c9f3bf83f8 /tp-account-widgets
parent082786e2d03bec0ffcd75f092d3e1212222dd0b1 (diff)
downloadtelepathy-account-widgets-0bad64b02bf3e9fd1c0d24c249951f15c4114b60.tar.gz
account-widget: Hitting ENTER should also emit GtkDialog::response
If the widget is inside a GtkDialog, then clicking one of the response buttons emits GtkDialog::response, as one would expect. However, just hitting ENTER inside a GtkEntry doesn't. This is an awkward inconsistency for applications using this widget. From now on, when TpawAccountWidget is inside a GtkDialog, it will emit GtkDialog::response followed by TpawAccountWidget::close when the widget has finished adding the account. Fall out from b838c54c673165a9d948b18f21580a0ca94f8cd5 https://bugzilla.gnome.org/show_bug.cgi?id=767295
Diffstat (limited to 'tp-account-widgets')
-rw-r--r--tp-account-widgets/tpaw-account-widget.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/tp-account-widgets/tpaw-account-widget.c b/tp-account-widgets/tpaw-account-widget.c
index 9ba43af0..b2252469 100644
--- a/tp-account-widgets/tpaw-account-widget.c
+++ b/tp-account-widgets/tpaw-account-widget.c
@@ -565,6 +565,9 @@ tpaw_account_widget_setup_widget (TpawAccountWidget *self,
if (strstr (param_name, "password"))
{
+ if (self->priv->dialog != NULL)
+ gtk_entry_set_activates_default (GTK_ENTRY (widget), TRUE);
+
gtk_entry_set_visibility (GTK_ENTRY (widget), FALSE);
/* Add 'clear' icon */
@@ -582,8 +585,13 @@ tpaw_account_widget_setup_widget (TpawAccountWidget *self,
G_CALLBACK (password_entry_activated_cb), self);
}
else if (strstr (param_name, "account"))
- g_signal_connect (widget, "activate",
- G_CALLBACK (account_entry_activated_cb), self);
+ {
+ if (self->priv->dialog != NULL)
+ gtk_entry_set_activates_default (GTK_ENTRY (widget), TRUE);
+
+ g_signal_connect (widget, "activate",
+ G_CALLBACK (account_entry_activated_cb), self);
+ }
g_signal_connect (widget, "changed",
G_CALLBACK (account_widget_entry_changed_cb), self);