aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorkarl-qdh <karl@qdh.org.uk>2011-04-18 10:41:58 +0100
committerkarl-qdh <karl@qdh.org.uk>2011-04-18 10:41:58 +0100
commit00518ac99caea18f056e911b4c9c4a7f1e62727b (patch)
treedd627d898629161d8605c77b7d179d016958e45d /src
parentb5bb58568b4ddd555c885b9f32fd9977b64c8b8a (diff)
downloadayatana-indicator-datetime-00518ac99caea18f056e911b4c9c4a7f1e62727b.tar.gz
ayatana-indicator-datetime-00518ac99caea18f056e911b4c9c4a7f1e62727b.tar.bz2
ayatana-indicator-datetime-00518ac99caea18f056e911b4c9c4a7f1e62727b.zip
min/max width for appointments
Diffstat (limited to 'src')
-rw-r--r--src/indicator-datetime.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/indicator-datetime.c b/src/indicator-datetime.c
index 1c05ff0..58053ef 100644
--- a/src/indicator-datetime.c
+++ b/src/indicator-datetime.c
@@ -1285,6 +1285,13 @@ new_appointment_item (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, Dbu
/* Label, probably a username, chat room or mailbox name */
mi_data->label = gtk_label_new(dbusmenu_menuitem_property_get(newitem, APPOINTMENT_MENUITEM_PROP_LABEL));
gtk_misc_set_alignment(GTK_MISC(mi_data->label), 0.0, 0.5);
+
+ GtkStyle * style = gtk_widget_get_style(GTK_WIDGET(mi_data->label));
+ PangoContext * context = gtk_widget_get_pango_context(GTK_WIDGET(mi_data->label));
+ gint length = measure_string(style, context, "GGGGGGGGGGGGGGG"); // 15 char wide string max
+ gtk_widget_set_size_request(GTK_WIDGET(mi_data->label), length, -1); // Set the min size in pixels
+
+ gtk_label_set_ellipsize(GTK_LABEL(mi_data->label), PANGO_ELLIPSIZE_END);
gtk_box_pack_start(GTK_BOX(hbox), mi_data->label, TRUE, TRUE, 0);
gtk_widget_show(mi_data->label);