diff options
-rw-r--r-- | calendar/ChangeLog | 12 | ||||
-rw-r--r-- | calendar/gui/dialogs/memo-page.c | 2 | ||||
-rw-r--r-- | calendar/gui/e-meeting-time-sel.c | 35 | ||||
-rw-r--r-- | calendar/gui/e-meeting-time-sel.h | 2 |
4 files changed, 43 insertions, 8 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index dbf56cdb14..c80e94515d 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,5 +1,17 @@ 2008-01-14 Milan Crha <mcrha@redhat.com> + ** Fix for bug #507359 + + * gui/e-meeting-time-sel.h: (struct _EMeetingTimeSelector): + * gui/e-meeting-time-sel.c: (e_meeting_time_selector_class_init), + (e_meeting_time_selector_destroy), (style_change_idle_func), + (e_meeting_time_selector_style_set): Recalculate sizes in idle queue, + which will ensure the style is propagated in list_view too, because we + read from there the height of the row and the style isn't set there + before it is set in our widget. + +2008-01-14 Milan Crha <mcrha@redhat.com> + ** Fix for bug #490464 * gui/dialogs/memo-page.c: (get_recipients): New helper function to 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; }; |