[gnome-control-center] online-accounts: Replace g_object_new with gtk widget methods
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] online-accounts: Replace g_object_new with gtk widget methods
- Date: Mon, 19 Oct 2020 04:12:03 +0000 (UTC)
commit 83d3724ff60065f0841db9b134e1372c507ab494
Author: Robert Ancell <robert ancell canonical com>
Date: Fri Sep 25 16:26:35 2020 +1200
online-accounts: Replace g_object_new with gtk widget methods
This improves compile time type checking.
panels/online-accounts/cc-online-accounts-panel.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
---
diff --git a/panels/online-accounts/cc-online-accounts-panel.c
b/panels/online-accounts/cc-online-accounts-panel.c
index e6d6a3dfb..642396cb3 100644
--- a/panels/online-accounts/cc-online-accounts-panel.c
+++ b/panels/online-accounts/cc-online-accounts-panel.c
@@ -797,13 +797,11 @@ on_account_added (GoaClient *client,
goa_account_get_provider_name (account),
goa_account_get_presentation_identity (account));
- label = g_object_new (GTK_TYPE_LABEL,
- "ellipsize", PANGO_ELLIPSIZE_END,
- "label", title,
- "xalign", 0.0,
- "use-markup", TRUE,
- "hexpand", TRUE,
- NULL);
+ label = gtk_label_new (NULL);
+ gtk_label_set_markup (GTK_LABEL (label), title);
+ gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
+ gtk_label_set_xalign (GTK_LABEL (label), 0.0);
+ gtk_widget_set_hexpand (label, TRUE);
gtk_widget_show (label);
gtk_container_add (GTK_CONTAINER (box), label);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]