mirror of
https://gitlab.gnome.org/GNOME/calls.git
synced 2024-11-16 17:36:22 +00:00
CallsCallDisplay: use HdyAvatar
This commit is contained in:
parent
293227ff3c
commit
e09f2e10f8
2 changed files with 18 additions and 9 deletions
|
@ -30,6 +30,7 @@
|
||||||
#include <glib/gi18n.h>
|
#include <glib/gi18n.h>
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
#include <handy.h>
|
||||||
|
|
||||||
#include <libcallaudio.h>
|
#include <libcallaudio.h>
|
||||||
|
|
||||||
|
@ -43,7 +44,7 @@ struct _CallsCallDisplay
|
||||||
guint timeout;
|
guint timeout;
|
||||||
|
|
||||||
GtkLabel *incoming_phone_call;
|
GtkLabel *incoming_phone_call;
|
||||||
GtkBox *party_box;
|
HdyAvatar *avatar;
|
||||||
GtkLabel *primary_contact_info;
|
GtkLabel *primary_contact_info;
|
||||||
GtkLabel *secondary_contact_info;
|
GtkLabel *secondary_contact_info;
|
||||||
GtkLabel *status;
|
GtkLabel *status;
|
||||||
|
@ -315,12 +316,6 @@ calls_call_display_new (CallsCall *call)
|
||||||
static void
|
static void
|
||||||
set_party (CallsCallDisplay *self)
|
set_party (CallsCallDisplay *self)
|
||||||
{
|
{
|
||||||
// FIXME: use HdyAvatar and the contact avatar
|
|
||||||
GtkWidget *image = gtk_image_new_from_icon_name ("avatar-default-symbolic", GTK_ICON_SIZE_DIALOG);
|
|
||||||
gtk_box_pack_end (self->party_box, image, TRUE, TRUE, 0);
|
|
||||||
gtk_image_set_pixel_size (GTK_IMAGE (image), 100);
|
|
||||||
gtk_widget_show (image);
|
|
||||||
|
|
||||||
self->contact = calls_call_get_contact (self->call);
|
self->contact = calls_call_get_contact (self->call);
|
||||||
|
|
||||||
g_object_bind_property (self->contact, "name",
|
g_object_bind_property (self->contact, "name",
|
||||||
|
@ -335,6 +330,13 @@ set_party (CallsCallDisplay *self)
|
||||||
self->secondary_contact_info, "visible",
|
self->secondary_contact_info, "visible",
|
||||||
G_BINDING_INVERT_BOOLEAN | G_BINDING_SYNC_CREATE);
|
G_BINDING_INVERT_BOOLEAN | G_BINDING_SYNC_CREATE);
|
||||||
|
|
||||||
|
g_object_bind_property (self->contact, "name",
|
||||||
|
self->avatar, "text",
|
||||||
|
G_BINDING_SYNC_CREATE);
|
||||||
|
|
||||||
|
g_object_bind_property (self->contact, "has-individual",
|
||||||
|
self->avatar, "show-initials",
|
||||||
|
G_BINDING_SYNC_CREATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -494,9 +496,9 @@ 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, incoming_phone_call);
|
gtk_widget_class_bind_template_child (widget_class, CallsCallDisplay, incoming_phone_call);
|
||||||
gtk_widget_class_bind_template_child (widget_class, CallsCallDisplay, party_box);
|
|
||||||
gtk_widget_class_bind_template_child (widget_class, CallsCallDisplay, primary_contact_info);
|
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, secondary_contact_info);
|
||||||
|
gtk_widget_class_bind_template_child (widget_class, CallsCallDisplay, avatar);
|
||||||
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, controls);
|
gtk_widget_class_bind_template_child (widget_class, CallsCallDisplay, controls);
|
||||||
gtk_widget_class_bind_template_child (widget_class, CallsCallDisplay, gsm_controls);
|
gtk_widget_class_bind_template_child (widget_class, CallsCallDisplay, gsm_controls);
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkBox" id="party_box">
|
<object class="GtkBox">
|
||||||
<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>
|
||||||
|
@ -59,6 +59,13 @@
|
||||||
<property name="margin_bottom">4</property>
|
<property name="margin_bottom">4</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="HdyAvatar" id="avatar">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="size">100</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
|
|
Loading…
Reference in a new issue