Merge lp:~karl-qdh/indicator-datetime/appointmentwidth into lp:indicator-datetime/0.3

Proposed by Karl Lattimer
Status: Superseded
Proposed branch: lp:~karl-qdh/indicator-datetime/appointmentwidth
Merge into: lp:indicator-datetime/0.3
Diff against target: 16 lines (+7/-0)
1 file modified
src/indicator-datetime.c (+7/-0)
To merge this branch: bzr merge lp:~karl-qdh/indicator-datetime/appointmentwidth
Reviewer Review Type Date Requested Status
Ted Gould Pending
Review via email: mp+57871@code.launchpad.net

This proposal has been superseded by a proposal from 2011-04-18.

Description of the change

fixes long appointment items

To post a comment you must log in.
109. By Karl Lattimer

min/max width for appointments

110. By Karl Lattimer

merge back in with old branch

111. By Karl Lattimer

indentation

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/indicator-datetime.c'
2--- src/indicator-datetime.c 2011-04-13 19:32:18 +0000
3+++ src/indicator-datetime.c 2011-04-18 09:50:51 +0000
4@@ -1285,6 +1285,13 @@
5 /* Label, probably a username, chat room or mailbox name */
6 mi_data->label = gtk_label_new(dbusmenu_menuitem_property_get(newitem, APPOINTMENT_MENUITEM_PROP_LABEL));
7 gtk_misc_set_alignment(GTK_MISC(mi_data->label), 0.0, 0.5);
8+
9+ GtkStyle * style = gtk_widget_get_style(GTK_WIDGET(mi_data->label));
10+ PangoContext * context = gtk_widget_get_pango_context(GTK_WIDGET(mi_data->label));
11+ gint length = measure_string(style, context, "GGGGGGGGGGGGGGG"); // 15 char wide string max
12+ gtk_widget_set_size_request(GTK_WIDGET(mi_data->label), length, -1); // Set the min size in pixels
13+
14+ gtk_label_set_ellipsize(GTK_LABEL(mi_data->label), PANGO_ELLIPSIZE_END);
15 gtk_box_pack_start(GTK_BOX(hbox), mi_data->label, TRUE, TRUE, 0);
16 gtk_widget_show(mi_data->label);
17

Subscribers

People subscribed via source and target branches