1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-09-28 14:55:26 +00:00

call-display: Replace name by primary and secondary info

This better matches the final design and displays the most relevant
information available first.
This commit is contained in:
Adrien Plazas 2018-07-27 09:49:48 +02:00
parent 1a3d34bb2b
commit c5b1a3a923
2 changed files with 23 additions and 14 deletions

View file

@ -42,7 +42,8 @@ struct _CallsCallDisplay
guint timeout;
GtkBox *party_box;
GtkLabel *name;
GtkLabel *primary_contact_info;
GtkLabel *secondary_contact_info;
GtkLabel *status;
GtkLabel *time;
@ -209,13 +210,18 @@ static void
set_party (CallsCallDisplay *self, CallsParty *party)
{
GtkWidget *image;
const gchar *name, *number;
image = calls_party_create_image (party);
gtk_box_pack_start (self->party_box, image, TRUE, TRUE, 0);
gtk_image_set_pixel_size (GTK_IMAGE (image), 100);
gtk_widget_show (image);
gtk_label_set_text (self->name, calls_party_get_label (party));
name = calls_party_get_name (party);
number = calls_party_get_number (party);
gtk_label_set_text (self->primary_contact_info, name != NULL ? name : number);
gtk_label_set_text (self->secondary_contact_info, name != NULL ? number : NULL);
}
@ -313,7 +319,8 @@ calls_call_display_class_init (CallsCallDisplayClass *klass)
gtk_widget_class_set_template_from_resource (widget_class, "/sm/puri/calls/ui/call-display.ui");
gtk_widget_class_bind_template_child (widget_class, CallsCallDisplay, party_box);
gtk_widget_class_bind_template_child (widget_class, CallsCallDisplay, name);
gtk_widget_class_bind_template_child (widget_class, CallsCallDisplay, primary_contact_info);
gtk_widget_class_bind_template_child (widget_class, CallsCallDisplay, secondary_contact_info);
gtk_widget_class_bind_template_child (widget_class, CallsCallDisplay, status);
gtk_widget_class_bind_template_child (widget_class, CallsCallDisplay, time);
gtk_widget_class_bind_template_child (widget_class, CallsCallDisplay, answer);

View file

@ -18,25 +18,27 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="homogeneous">True</property>
<child>
<object class="GtkLabel" id="name">
<object class="GtkLabel" id="primary_contact_info">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">John</property>
<property name="margin_top">6</property>
<property name="margin_bottom">6</property>
<attributes>
<attribute name="scale" value="3"/>
<attribute name="weight" value="bold"/>
<attribute name="scale" value="1.6"/>
</attributes>
</object>
<packing>
<property name="expand">True</property>
<property name="pack_type">end</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="secondary_contact_info">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_top">4</property>
<property name="margin_bottom">4</property>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
</packing>
</child>
<child>
<object class="GtkBox">