user-accounts: update padding on style-updated

Padding is updated for some widgets once, when creating the widgets.
But it seems style may not be loaded yet. Therefore the padding has
to be updated on "style-updated" signal to reflect style changes.

https://bugzilla.gnome.org/show_bug.cgi?id=743180
This commit is contained in:
Ondrej Holy 2015-01-19 14:27:57 +01:00
parent 57a884f1f1
commit a4521c15d5
4 changed files with 7 additions and 7 deletions

View file

@ -370,7 +370,7 @@ button_clicked (GtkWidget *widget,
}
static void
update_button_padding (UmEditableButton *button)
update_button_padding (UmEditableButton *button, gpointer user_data)
{
UmEditableButtonPrivate *priv = button->priv;
GtkStyleContext *context;
@ -416,7 +416,7 @@ um_editable_button_init (UmEditableButton *button)
gtk_stack_add_named (priv->stack, GTK_WIDGET (priv->button), PAGE_BUTTON);
g_signal_connect (priv->button, "clicked", G_CALLBACK (button_clicked), button);
update_button_padding (button);
g_signal_connect (button, "style-updated", G_CALLBACK (update_button_padding), NULL);
gtk_container_add (GTK_CONTAINER (button), GTK_WIDGET (priv->stack));

View file

@ -381,7 +381,7 @@ popup_shown (GtkWidget *widget,
}
static void
update_button_padding (UmEditableCombo *combo)
update_button_padding (UmEditableCombo *combo, gpointer user_data)
{
UmEditableComboPrivate *priv = combo->priv;
GtkStyleContext *context;
@ -433,7 +433,7 @@ um_editable_combo_init (UmEditableCombo *combo)
g_signal_connect (priv->combo, "changed", G_CALLBACK (combo_changed), combo);
g_signal_connect (priv->combo, "notify::popup-shown", G_CALLBACK (popup_shown), combo);
update_button_padding (combo);
g_signal_connect (combo, "style-updated", G_CALLBACK (update_button_padding), NULL);
gtk_container_add (GTK_CONTAINER (combo), GTK_WIDGET (priv->stack));

View file

@ -1645,7 +1645,7 @@ setup_main_window (CcUserPanel *self)
button = get_widget (d, "last-login-history-button");
g_signal_connect (button, "clicked",
G_CALLBACK (show_history), d);
update_padding (button, get_widget (d, "last-login-value-label"));
g_signal_connect (button, "style-updated", G_CALLBACK (update_padding), get_widget (d, "last-login-value-label"));
d->permission = (GPermission *)polkit_permission_new_sync (USER_ACCOUNTS_PERMISSION, NULL, NULL, &error);
if (d->permission != NULL) {

View file

@ -568,7 +568,7 @@ entry_key_press (GtkWidget *widget,
}
static void
update_button_padding (CcEditableEntry *e)
update_button_padding (CcEditableEntry *e, gpointer user_data)
{
CcEditableEntryPrivate *priv = e->priv;
GtkStyleContext *context;
@ -625,7 +625,7 @@ cc_editable_entry_init (CcEditableEntry *e)
g_signal_connect (priv->entry, "focus-out-event", G_CALLBACK (entry_focus_out), e);
g_signal_connect (priv->entry, "key-press-event", G_CALLBACK (entry_key_press), e);
update_button_padding (e);
g_signal_connect (e, "style-updated", G_CALLBACK (update_button_padding), NULL);
gtk_container_add (GTK_CONTAINER (e), (GtkWidget*)priv->stack);