aboutsummaryrefslogtreecommitdiff
path: root/src/indicator-datetime.c
diff options
context:
space:
mode:
authorKen VanDine <ken.vandine@canonical.com>2011-06-22 11:12:53 -0400
committerKen VanDine <ken.vandine@canonical.com>2011-06-22 11:12:53 -0400
commitbe0557bd3630b3efe189f299d26aa3db9a358798 (patch)
tree51aa069c725606e9635b14091c4b6c5ddd7b48a4 /src/indicator-datetime.c
parent5b1027bd6f7e193639a895c9c0d63462443d4566 (diff)
parentd84d6a67d0c63d270462cade09d33efc9d2b6de8 (diff)
downloadayatana-indicator-datetime-be0557bd3630b3efe189f299d26aa3db9a358798.tar.gz
ayatana-indicator-datetime-be0557bd3630b3efe189f299d26aa3db9a358798.tar.bz2
ayatana-indicator-datetime-be0557bd3630b3efe189f299d26aa3db9a358798.zip
* New upstream release.
- Set minimum width for appointments to prevent continuous resizing when the calendar is hiden and ensure there is enough of the event description visible (LP: #762976) - ellipsize long appointment descriptions (LP: #750671) - GTK3 build * Dropping debian/patches/lp_762976.patch and debian/patches/lp_750671.patch as merged upstream. * debian/control: Switching dep to libedataserverui-3.0-dev * Upstream Merge * Ellipsize calendar entries that are too long (LP: #750671)
Diffstat (limited to 'src/indicator-datetime.c')
-rw-r--r--src/indicator-datetime.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/indicator-datetime.c b/src/indicator-datetime.c
index 1c05ff0..800fa87 100644
--- a/src/indicator-datetime.c
+++ b/src/indicator-datetime.c
@@ -270,7 +270,7 @@ static void
menu_visible_notfy_cb(GtkWidget * menu, G_GNUC_UNUSED GParamSpec *pspec, gpointer user_data)
{
IndicatorDatetime * self = INDICATOR_DATETIME(user_data);
- g_debug("notify visible signal recieved");
+ g_debug("notify visible signal received");
// we should only react if we're currently visible
gboolean visible;
@@ -1077,7 +1077,7 @@ guess_label_size (IndicatorDatetime * self)
GArray * timevals = g_array_new(FALSE, TRUE, sizeof(struct tm));
build_timeval_array(timevals, posibilitymask);
- g_debug("Checking against %d posible times", timevals->len);
+ g_debug("Checking against %d possible times", timevals->len);
gint check_time;
for (check_time = 0; check_time < timevals->len; check_time++) {
gchar longstr[256];
@@ -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, "MMMMMMMMMMMMMMM"); // 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);