From 3cccd392dcf5066d818dfcd4caf464fbbc2ac0bb Mon Sep 17 00:00:00 2001 From: Suman Manjunath Date: Mon, 14 Jan 2008 10:32:42 +0000 Subject: Patch from Milan Crha Fix for bug #507359 (Free/Busy UI needs names and graphs widgets in a container) svn path=/trunk/; revision=34814 --- calendar/gui/dialogs/memo-page.c | 2 +- calendar/gui/e-meeting-time-sel.c | 35 ++++++++++++++++++++++++++++------- calendar/gui/e-meeting-time-sel.h | 2 ++ 3 files changed, 31 insertions(+), 8 deletions(-) (limited to 'calendar/gui') diff --git a/calendar/gui/dialogs/memo-page.c b/calendar/gui/dialogs/memo-page.c index d70f937c74..038346c898 100644 --- a/calendar/gui/dialogs/memo-page.c +++ b/calendar/gui/dialogs/memo-page.c @@ -355,7 +355,7 @@ get_recipients (ECalComponent *comp) icalprop = icalcomponent_get_next_property (icalcomp, ICAL_X_PROPERTY)) { const char *xname = icalproperty_get_x_name (icalprop); - if (xname && 0 == strcmp (xname, "X-EVOLUTION-RECIPIENTS")) + if (xname && strcmp (xname, "X-EVOLUTION-RECIPIENTS") == 0) break; } diff --git a/calendar/gui/e-meeting-time-sel.c b/calendar/gui/e-meeting-time-sel.c index 013fa338f9..4744ab2e74 100644 --- a/calendar/gui/e-meeting-time-sel.c +++ b/calendar/gui/e-meeting-time-sel.c @@ -263,6 +263,7 @@ e_meeting_time_selector_init (EMeetingTimeSelector * mts) mts); mts->fb_refresh_not = 0; + mts->style_change_idle_id = 0; } @@ -842,6 +843,12 @@ e_meeting_time_selector_destroy (GtkObject *object) if (mts->fb_refresh_not != 0) { g_source_remove (mts->fb_refresh_not); + mts->fb_refresh_not = 0; + } + + if (mts->style_change_idle_id != 0) { + g_source_remove (mts->style_change_idle_id); + mts->style_change_idle_id = 0; } if (GTK_OBJECT_CLASS (e_meeting_time_selector_parent_class)->destroy) @@ -891,9 +898,8 @@ get_cell_height (GtkTreeView *tree) return height; } -static void -e_meeting_time_selector_style_set (GtkWidget *widget, - GtkStyle *previous_style) +static gboolean +style_change_idle_func (gpointer widget) { EMeetingTimeSelector *mts; EMeetingTime saved_time; @@ -904,9 +910,6 @@ e_meeting_time_selector_style_set (GtkWidget *widget, PangoFontMetrics *font_metrics; PangoLayout *layout; - if (GTK_WIDGET_CLASS (e_meeting_time_selector_parent_class)->style_set) - (*GTK_WIDGET_CLASS (e_meeting_time_selector_parent_class)->style_set)(widget, previous_style); - mts = E_MEETING_TIME_SELECTOR (widget); /* Set up Pango prerequisites */ @@ -928,7 +931,8 @@ e_meeting_time_selector_style_set (GtkWidget *widget, max_hour_width = MAX (max_hour_width, mts->hour_widths[hour]); } - mts->row_height = get_cell_height (GTK_TREE_VIEW (mts->list_view)); + /* add also some padding for lines so it fits better */ + mts->row_height = get_cell_height (GTK_TREE_VIEW (mts->list_view)) + 2; mts->col_width = max_hour_width + 6; e_meeting_time_selector_save_position (mts, &saved_time); @@ -956,6 +960,23 @@ e_meeting_time_selector_style_set (GtkWidget *widget, g_object_unref (layout); pango_font_metrics_unref (font_metrics); + + mts->style_change_idle_id = 0; + + return FALSE; +} + +static void +e_meeting_time_selector_style_set (GtkWidget *widget, + GtkStyle *previous_style) +{ + EMeetingTimeSelector *mts = E_MEETING_TIME_SELECTOR (widget); + + if (GTK_WIDGET_CLASS (e_meeting_time_selector_parent_class)->style_set) + (*GTK_WIDGET_CLASS (e_meeting_time_selector_parent_class)->style_set)(widget, previous_style); + + if (!mts->style_change_idle_id) + mts->style_change_idle_id = g_idle_add (style_change_idle_func, widget); } /* This draws a shadow around the top display and main display. */ diff --git a/calendar/gui/e-meeting-time-sel.h b/calendar/gui/e-meeting-time-sel.h index 9b95c7d767..8a10c04b7e 100644 --- a/calendar/gui/e-meeting-time-sel.h +++ b/calendar/gui/e-meeting-time-sel.h @@ -262,6 +262,8 @@ struct _EMeetingTimeSelector gboolean fb_refresh_not; GdkCursorType last_cursor_set; + + guint style_change_idle_id; }; -- cgit