1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-05-23 13:39:26 +00:00

contacts-row: center call button vertically

This commit is contained in:
Anton Lazarev 2024-04-21 17:03:25 -07:00
parent c77eddfd19
commit 0a2489d1f7
No known key found for this signature in database
GPG key ID: FBD20243E0CD9104
2 changed files with 39 additions and 34 deletions

View file

@ -22,6 +22,7 @@ struct _CallsContactsRow {
GtkWidget *avatar; GtkWidget *avatar;
GtkWidget *title; GtkWidget *title;
GtkWidget *grid; GtkWidget *grid;
GtkWidget *box;
gint n_phonenumbers; gint n_phonenumbers;
@ -49,12 +50,9 @@ insert_phonenumber (CallsContactsRow *self,
gtk_actionable_set_action_target (GTK_ACTIONABLE (button), "s", number, NULL); gtk_actionable_set_action_target (GTK_ACTIONABLE (button), "s", number, NULL);
gtk_widget_set_visible (button, TRUE); gtk_widget_set_visible (button, TRUE);
gtk_widget_add_css_class (button, "flat"); gtk_widget_add_css_class (button, "flat");
gtk_grid_attach_next_to (GTK_GRID (self->grid), gtk_box_insert_child_after (GTK_BOX (self->box),
button, button,
label, self->grid);
GTK_POS_RIGHT,
1,
1);
self->n_phonenumbers++; 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, avatar);
gtk_widget_class_bind_template_child (widget_class, CallsContactsRow, title); 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, grid);
gtk_widget_class_bind_template_child (widget_class, CallsContactsRow, box);
} }
static void static void

View file

@ -4,37 +4,43 @@
<property name="activatable">False</property> <property name="activatable">False</property>
<property name="selectable">False</property> <property name="selectable">False</property>
<property name="child"> <property name="child">
<object class="GtkGrid" id="grid"> <object class="GtkBox" id="box">
<property name="orientation">horizontal</property>
<property name="margin-start">6</property> <property name="margin-start">6</property>
<property name="margin-end">6</property> <property name="margin-end">6</property>
<property name="margin-top">6</property>
<property name="margin-bottom">6</property>
<property name="column-spacing">12</property>
<property name="row-spacing">3</property>
<child> <child>
<object class="AdwAvatar" id="avatar"> <object class="GtkGrid" id="grid">
<property name="valign">center</property> <property name="margin-end">6</property>
<property name="size">36</property> <property name="margin-top">6</property>
<property name="show-initials">True</property> <property name="margin-bottom">6</property>
<layout> <property name="column-spacing">12</property>
<property name="column">0</property> <property name="row-spacing">3</property>
<property name="row">0</property> <child>
</layout> <object class="AdwAvatar" id="avatar">
</object> <property name="valign">center</property>
</child> <property name="size">36</property>
<child> <property name="show-initials">True</property>
<object class="GtkLabel" id="title"> <layout>
<property name="ellipsize">end</property> <property name="column">0</property>
<property name="halign">start</property> <property name="row">0</property>
<property name="hexpand">True</property> </layout>
<property name="vexpand">True</property> </object>
<style> </child>
<class name="bold-label"/> <child>
</style> <object class="GtkLabel" id="title">
<layout> <property name="ellipsize">end</property>
<property name="column">1</property> <property name="halign">start</property>
<property name="row">0</property> <property name="hexpand">True</property>
</layout> <property name="vexpand">True</property>
<style>
<class name="bold-label"/>
</style>
<layout>
<property name="column">1</property>
<property name="row">0</property>
</layout>
</object>
</child>
</object> </object>
</child> </child>
</object> </object>