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:
@@ -42,7 +42,8 @@ struct _CallsCallDisplay
|
|||||||
guint timeout;
|
guint timeout;
|
||||||
|
|
||||||
GtkBox *party_box;
|
GtkBox *party_box;
|
||||||
GtkLabel *name;
|
GtkLabel *primary_contact_info;
|
||||||
|
GtkLabel *secondary_contact_info;
|
||||||
GtkLabel *status;
|
GtkLabel *status;
|
||||||
GtkLabel *time;
|
GtkLabel *time;
|
||||||
|
|
||||||
@@ -209,13 +210,18 @@ static void
|
|||||||
set_party (CallsCallDisplay *self, CallsParty *party)
|
set_party (CallsCallDisplay *self, CallsParty *party)
|
||||||
{
|
{
|
||||||
GtkWidget *image;
|
GtkWidget *image;
|
||||||
|
const gchar *name, *number;
|
||||||
|
|
||||||
image = calls_party_create_image (party);
|
image = calls_party_create_image (party);
|
||||||
gtk_box_pack_start (self->party_box, image, TRUE, TRUE, 0);
|
gtk_box_pack_start (self->party_box, image, TRUE, TRUE, 0);
|
||||||
gtk_image_set_pixel_size (GTK_IMAGE (image), 100);
|
gtk_image_set_pixel_size (GTK_IMAGE (image), 100);
|
||||||
gtk_widget_show (image);
|
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_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, 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, status);
|
||||||
gtk_widget_class_bind_template_child (widget_class, CallsCallDisplay, time);
|
gtk_widget_class_bind_template_child (widget_class, CallsCallDisplay, time);
|
||||||
gtk_widget_class_bind_template_child (widget_class, CallsCallDisplay, answer);
|
gtk_widget_class_bind_template_child (widget_class, CallsCallDisplay, answer);
|
||||||
|
|||||||
@@ -18,25 +18,27 @@
|
|||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="orientation">vertical</property>
|
<property name="orientation">vertical</property>
|
||||||
<property name="homogeneous">True</property>
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel" id="name">
|
<object class="GtkLabel" id="primary_contact_info">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</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>
|
<attributes>
|
||||||
<attribute name="scale" value="3"/>
|
<attribute name="weight" value="bold"/>
|
||||||
|
<attribute name="scale" value="1.6"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
</child>
|
||||||
<property name="expand">True</property>
|
<child>
|
||||||
<property name="pack_type">end</property>
|
<object class="GtkLabel" id="secondary_contact_info">
|
||||||
</packing>
|
<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>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="expand">True</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkBox">
|
<object class="GtkBox">
|
||||||
|
|||||||
Reference in New Issue
Block a user