From 446385cf45b3702fba437dfbd1d0740e72740b36 Mon Sep 17 00:00:00 2001 From: karl-qdh Date: Fri, 15 Apr 2011 14:20:50 +0100 Subject: Prevent long appointment titles making the menu too wide --- src/indicator-datetime.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/indicator-datetime.c') diff --git a/src/indicator-datetime.c b/src/indicator-datetime.c index 1c05ff0..a992507 100644 --- a/src/indicator-datetime.c +++ b/src/indicator-datetime.c @@ -1285,6 +1285,7 @@ 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); + 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); -- cgit v1.2.3 From 00518ac99caea18f056e911b4c9c4a7f1e62727b Mon Sep 17 00:00:00 2001 From: karl-qdh Date: Mon, 18 Apr 2011 10:41:58 +0100 Subject: min/max width for appointments --- src/indicator-datetime.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/indicator-datetime.c') 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); -- cgit v1.2.3 From 969771d64ab89a61a821420cb15f1bd04243c940 Mon Sep 17 00:00:00 2001 From: karl-qdh Date: Mon, 18 Apr 2011 10:57:40 +0100 Subject: indentation --- src/indicator-datetime.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/indicator-datetime.c') diff --git a/src/indicator-datetime.c b/src/indicator-datetime.c index 58053ef..db71e9d 100644 --- a/src/indicator-datetime.c +++ b/src/indicator-datetime.c @@ -1287,8 +1287,8 @@ new_appointment_item (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, Dbu 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 + 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); -- cgit v1.2.3 From 5325c7a9c8ca4779f0336424b9e349fcba8d681f Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Sun, 5 Jun 2011 20:45:28 +0200 Subject: fix two spelling mistakes spotted by lintian --- src/indicator-datetime.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/indicator-datetime.c') diff --git a/src/indicator-datetime.c b/src/indicator-datetime.c index eb4b695..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]; -- cgit v1.2.3