From 0a2489d1f7ec4e21e3085b47e0686d07ba47f147 Mon Sep 17 00:00:00 2001 From: Anton Lazarev Date: Sun, 21 Apr 2024 17:03:25 -0700 Subject: [PATCH] contacts-row: center call button vertically --- src/calls-contacts-row.c | 11 ++++--- src/ui/contacts-row.ui | 62 ++++++++++++++++++++++------------------ 2 files changed, 39 insertions(+), 34 deletions(-) diff --git a/src/calls-contacts-row.c b/src/calls-contacts-row.c index a89949d..e687dba 100644 --- a/src/calls-contacts-row.c +++ b/src/calls-contacts-row.c @@ -22,6 +22,7 @@ struct _CallsContactsRow { GtkWidget *avatar; GtkWidget *title; GtkWidget *grid; + GtkWidget *box; gint n_phonenumbers; @@ -49,12 +50,9 @@ insert_phonenumber (CallsContactsRow *self, gtk_actionable_set_action_target (GTK_ACTIONABLE (button), "s", number, NULL); gtk_widget_set_visible (button, TRUE); gtk_widget_add_css_class (button, "flat"); - gtk_grid_attach_next_to (GTK_GRID (self->grid), - button, - label, - GTK_POS_RIGHT, - 1, - 1); + gtk_box_insert_child_after (GTK_BOX (self->box), + button, + self->grid); self->n_phonenumbers++; } @@ -139,6 +137,7 @@ calls_contacts_row_class_init (CallsContactsRowClass *klass) gtk_widget_class_bind_template_child (widget_class, CallsContactsRow, avatar); gtk_widget_class_bind_template_child (widget_class, CallsContactsRow, title); gtk_widget_class_bind_template_child (widget_class, CallsContactsRow, grid); + gtk_widget_class_bind_template_child (widget_class, CallsContactsRow, box); } static void diff --git a/src/ui/contacts-row.ui b/src/ui/contacts-row.ui index 0e1b87d..3ce0d68 100644 --- a/src/ui/contacts-row.ui +++ b/src/ui/contacts-row.ui @@ -4,37 +4,43 @@ False False - + + horizontal 6 6 - 6 - 6 - 12 - 3 - - center - 36 - True - - 0 - 0 - - - - - - end - start - True - True - - - 1 - 0 - + + 6 + 6 + 6 + 12 + 3 + + + center + 36 + True + + 0 + 0 + + + + + + end + start + True + True + + + 1 + 0 + + +