aboutsummaryrefslogtreecommitdiffstats
path: root/src/empathy-call-window.c
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd@luon.net>2012-05-21 01:59:29 +0800
committerSjoerd Simons <sjoerd@luon.net>2012-05-21 19:54:00 +0800
commit7e7a60c59f7e07612cdbc5e547dbb9a1151834ab (patch)
tree95145d71e969448ca974bd8a93b5ce007fd34e53 /src/empathy-call-window.c
parent6b19934b9a237b648f36b0da943bde046b6488c0 (diff)
downloadgsoc2013-empathy-7e7a60c59f7e07612cdbc5e547dbb9a1151834ab.tar
gsoc2013-empathy-7e7a60c59f7e07612cdbc5e547dbb9a1151834ab.tar.gz
gsoc2013-empathy-7e7a60c59f7e07612cdbc5e547dbb9a1151834ab.tar.bz2
gsoc2013-empathy-7e7a60c59f7e07612cdbc5e547dbb9a1151834ab.tar.lz
gsoc2013-empathy-7e7a60c59f7e07612cdbc5e547dbb9a1151834ab.tar.xz
gsoc2013-empathy-7e7a60c59f7e07612cdbc5e547dbb9a1151834ab.tar.zst
gsoc2013-empathy-7e7a60c59f7e07612cdbc5e547dbb9a1151834ab.zip
Call window: Ellipsize alias and status
If the user alias is too long both the hangup and the dialpad buttons get pushed into a drop-down menu. Even worse when the alias doesn't fit, it just isn't shown at all anymore. Given the username is already printed in the title and the user tends to know who they're calling with, ellipsizing the alias isn't an issue. Which has the nice side-effect of keeping the hangup and dialpad buttons on the toolbar in all cases like they should be. Unfortunately as pango doesn't ellipsize if it still has enough height left to put more lines in. So put the alias and status in seperate labels in a vbox which isn't set to fill.
Diffstat (limited to 'src/empathy-call-window.c')
-rw-r--r--src/empathy-call-window.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index 564504f99..1301f96d1 100644
--- a/src/empathy-call-window.c
+++ b/src/empathy-call-window.c
@@ -161,6 +161,7 @@ struct _EmpathyCallWindowPriv
GtkWidget *remote_user_avatar_widget;
GtkWidget *remote_user_avatar_toolbar;
GtkWidget *remote_user_name_toolbar;
+ GtkWidget *remote_user_status_toolbar;
GtkWidget *status_label;
GtkWidget *hangup_button;
GtkWidget *audio_call_button;
@@ -1564,6 +1565,7 @@ empathy_call_window_init (EmpathyCallWindow *self)
"errors_vbox", &priv->errors_vbox,
"pane", &priv->pane,
"remote_user_name_toolbar", &priv->remote_user_name_toolbar,
+ "remote_user_status_toolbar", &priv->remote_user_status_toolbar,
"remote_user_avatar_toolbar", &priv->remote_user_avatar_toolbar,
"status_label", &priv->status_label,
"audiocall", &priv->audio_call_button,
@@ -1873,16 +1875,20 @@ set_remote_user_name (EmpathyCallWindow *self,
{
const gchar *alias = empathy_contact_get_alias (contact);
const gchar *status = empathy_contact_get_status (contact);
- gchar *label;
- if (status != NULL)
- label = g_strdup_printf ("%s\n<small>%s</small>", alias, status);
- else
- label = g_strdup (alias);
+ gtk_label_set_text (GTK_LABEL (self->priv->remote_user_name_toolbar), alias);
+
+ if (status != NULL) {
+ gchar *markup;
- gtk_label_set_markup (GTK_LABEL (self->priv->remote_user_name_toolbar),
- label);
- g_free (label);
+ markup = g_markup_printf_escaped ("<small>%s</small>", status);
+ gtk_label_set_markup (GTK_LABEL (self->priv->remote_user_status_toolbar),
+ markup);
+ g_free (markup);
+ } else {
+ gtk_label_set_markup (GTK_LABEL (self->priv->remote_user_status_toolbar),
+ "");
+ }
}
static void