aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-week-view-main-item.c
diff options
context:
space:
mode:
authorHans Petter Jansson <hpj@ximian.com>2003-04-02 11:08:29 +0800
committerHans Petter <hansp@src.gnome.org>2003-04-02 11:08:29 +0800
commitc8e1c20b8a6b5ba84785ef63fcb4c2f4224dd0bc (patch)
treea665be846430589993d9cf01e7d0151d3f121df1 /calendar/gui/e-week-view-main-item.c
parent9f06cc49809acd03ce9367d6851f9f217bd33d27 (diff)
downloadgsoc2013-evolution-c8e1c20b8a6b5ba84785ef63fcb4c2f4224dd0bc.tar.gz
gsoc2013-evolution-c8e1c20b8a6b5ba84785ef63fcb4c2f4224dd0bc.tar.zst
gsoc2013-evolution-c8e1c20b8a6b5ba84785ef63fcb4c2f4224dd0bc.zip
Nuke GdkFont and use Pango's font measuring.
2003-04-01 Hans Petter Jansson <hpj@ximian.com> * gui/e-day-view-main-item.c (e_day_view_main_item_draw): Nuke GdkFont and use Pango's font measuring. * gui/e-day-view-time-itme.c (e_day_view_time_item_get_column_width) (e_day_view_time_item_draw): Ditto. * gui/e-day-view-top-item.c (e_day_view_top_item_draw) (e_day_view_top_item_draw_long_event): Ditto. * gui/e-day-view.c (e_day_view_style_set) (e_day_view_recalc_cell_sizes) (e_day_view_reshape_long_event) (e_day_view_update_top_canvas_drag) (e_day_view_update_main_canvas_drag): Ditto. * gui/e-meeting-time-sel.c (e_meeting_time_selector_style_set) (e_meeting_time_selector_recalc_date_form): Ditto. * gui/e-week-view-event-item.c (e_week_view_draw_time): Ditto. * gui/e-week-view-main-item.c (e_week_view_main_item_draw_day): Ditto. * gui/e-week-view-titles-item.c (e_week_view_titles_item_draw): Ditto. * gui/e-week-view.c (e_week_view_style_set) (e_week_view_recalc_cell_sizes) (e_week_view_reshape_event_span): Ditto. * gui/weekday-picker.c (weekday_picker_style_set): Ditto. svn path=/trunk/; revision=20627
Diffstat (limited to 'calendar/gui/e-week-view-main-item.c')
-rw-r--r--calendar/gui/e-week-view-main-item.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/calendar/gui/e-week-view-main-item.c b/calendar/gui/e-week-view-main-item.c
index e5fc58721d..87682a354a 100644
--- a/calendar/gui/e-week-view-main-item.c
+++ b/calendar/gui/e-week-view-main-item.c
@@ -205,12 +205,14 @@ e_week_view_main_item_draw_day (EWeekViewMainItem *wvmitem,
EWeekView *week_view;
GtkStyle *style;
GdkGC *gc;
- GdkFont *font;
gint right_edge, bottom_edge, date_width, date_x, line_y;
gboolean show_day_name, show_month_name, selected;
gchar buffer[128], *format_string;
gint month, day_of_month, max_width;
GdkColor *bg_color;
+ PangoFontDescription *font_desc;
+ PangoContext *pango_context;
+ PangoFontMetrics *font_metrics;
PangoLayout *layout;
#if 0
@@ -218,15 +220,22 @@ e_week_view_main_item_draw_day (EWeekViewMainItem *wvmitem,
#endif
week_view = wvmitem->week_view;
style = gtk_widget_get_style (GTK_WIDGET (week_view));
- font = gtk_style_get_font (style);
gc = week_view->main_gc;
+ /* Set up Pango prerequisites */
+ font_desc = style->font_desc;
+ pango_context = gtk_widget_get_pango_context (GTK_WIDGET (week_view));
+ font_metrics = pango_context_get_metrics (pango_context, font_desc,
+ pango_context_get_language (pango_context));
+
g_return_if_fail (gc != NULL);
month = g_date_month (date);
day_of_month = g_date_day (date);
- line_y = y + E_WEEK_VIEW_DATE_T_PAD + font->ascent
- + font->descent + E_WEEK_VIEW_DATE_LINE_T_PAD;
+ line_y = y + E_WEEK_VIEW_DATE_T_PAD +
+ PANGO_PIXELS (pango_font_metrics_get_ascent (font_metrics)) +
+ PANGO_PIXELS (pango_font_metrics_get_descent (font_metrics)) +
+ E_WEEK_VIEW_DATE_LINE_T_PAD;
/* Draw the background of the day. In the month view odd months are
one color and even months another, so you can easily see when each
@@ -266,8 +275,9 @@ e_week_view_main_item_draw_day (EWeekViewMainItem *wvmitem,
gdk_draw_rectangle (drawable, gc, TRUE,
x + 2, y + 1,
width - 5,
- E_WEEK_VIEW_DATE_T_PAD - 1
- + font->ascent + font->descent);
+ E_WEEK_VIEW_DATE_T_PAD - 1 +
+ PANGO_PIXELS (pango_font_metrics_get_ascent (font_metrics)) +
+ PANGO_PIXELS (pango_font_metrics_get_descent (font_metrics)));
} else {
gdk_draw_rectangle (drawable, gc, TRUE,
x + 2, y + 1,