aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-day-view-top-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-day-view-top-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-day-view-top-item.c')
-rw-r--r--calendar/gui/e-day-view-top-item.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/calendar/gui/e-day-view-top-item.c b/calendar/gui/e-day-view-top-item.c
index 973d326d8f..82f74c5c4e 100644
--- a/calendar/gui/e-day-view-top-item.c
+++ b/calendar/gui/e-day-view-top-item.c
@@ -166,7 +166,6 @@ e_day_view_top_item_draw (GnomeCanvasItem *canvas_item,
GdkGC *gc, *fg_gc, *bg_gc, *light_gc, *dark_gc;
gchar buffer[128], *format;
GdkRectangle clip_rect;
- GdkFont *font;
gint canvas_width, canvas_height, left_edge, day, date_width, date_x;
gint item_height, event_num;
struct tm day_start = { 0 };
@@ -182,7 +181,6 @@ e_day_view_top_item_draw (GnomeCanvasItem *canvas_item,
g_return_if_fail (day_view != NULL);
style = gtk_widget_get_style (GTK_WIDGET (day_view));
- font = gtk_style_get_font (style);
gc = day_view->main_gc;
fg_gc = style->fg_gc[GTK_STATE_NORMAL];
bg_gc = style->bg_gc[GTK_STATE_NORMAL];
@@ -279,10 +277,10 @@ e_day_view_top_item_draw (GnomeCanvasItem *canvas_item,
clip_rect.height = item_height - 2;
gdk_gc_set_clip_rectangle (fg_gc, &clip_rect);
- date_width = gdk_string_width (font, buffer);
+ layout = gtk_widget_create_pango_layout (GTK_WIDGET (day_view), buffer);
+ pango_layout_get_pixel_size (layout, &date_width, NULL);
date_x = day_view->day_offsets[day] + (day_view->day_widths[day] - date_width) / 2;
- layout = gtk_widget_create_pango_layout (GTK_WIDGET (day_view), buffer);
gdk_draw_layout (drawable, fg_gc,
date_x - x,
3 - y,
@@ -341,7 +339,6 @@ e_day_view_top_item_draw_long_event (EDayViewTopItem *dvtitem,
EDayViewEvent *event;
GtkStyle *style;
GdkGC *gc, *fg_gc, *bg_gc;
- GdkFont *font;
gint start_day, end_day;
gint item_x, item_y, item_w, item_h;
gint text_x, icon_x, icon_y, icon_x_inc;
@@ -373,7 +370,6 @@ e_day_view_top_item_draw_long_event (EDayViewTopItem *dvtitem,
event_num);
style = gtk_widget_get_style (GTK_WIDGET (day_view));
- font = gtk_style_get_font (style);
gc = day_view->main_gc;
fg_gc = style->fg_gc[GTK_STATE_NORMAL];
bg_gc = style->bg_gc[GTK_STATE_NORMAL];