1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
=== modified file 'src/indicator-datetime.c'
--- src/indicator-datetime.c 2011-04-13 19:32:18 +0000
+++ src/indicator-datetime.c 2011-04-18 09:59:43 +0000
@@ -1285,6 +1285,13 @@
/* 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);
|