aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-day-view-top-item.c
diff options
context:
space:
mode:
authorHans Petter Jansson <hpj@ximian.com>2003-01-26 09:42:05 +0800
committerHans Petter <hansp@src.gnome.org>2003-01-26 09:42:05 +0800
commit3cf26e43e21a5c9c551332a1c687a157fbcd3e3c (patch)
treeebb4ed56342905ee2bc42e04622d6e4fd2d32f93 /calendar/gui/e-day-view-top-item.c
parentcc35ce98a7a85b09dca062f7a781d7718cd17db2 (diff)
downloadgsoc2013-evolution-3cf26e43e21a5c9c551332a1c687a157fbcd3e3c.tar.gz
gsoc2013-evolution-3cf26e43e21a5c9c551332a1c687a157fbcd3e3c.tar.zst
gsoc2013-evolution-3cf26e43e21a5c9c551332a1c687a157fbcd3e3c.zip
Mainly making all views use PangoLayouts for text. When drawing a
2003-01-25 Hans Petter Jansson <hpj@ximian.com> Mainly making all views use PangoLayouts for text. When drawing a PangoLayout, the draw offset is the top left corner of the layout, not the text's baseline. Keep this in mind when viewing the changes. I'll be brief about the exact changes, since they speak better for themselves. * gui/e-day-view-time-item.c (e_day_view_time_item_get_column_width): Use Pango. (e_day_view_time_item_draw): Use Pango. * gui/e-day-view-top-item.c (e_day_view_top_item_draw): Use Pango. (e_day_view_top_item_draw_long_event): Add some FIXME text so we can see when this is being used. Is it in use at all? * gui/e-day-view.c: No longer specify an explicit X font string for the large font. Use the main font, and change the point size. (e_day_view_init): Use Pango. (e_day_view_style_set): Use Pango. Comment out the gdk_font setting for the drag text items for now. * gui/e-day-view.h: Use Pango. * gui/e-week-view-event-item.c (e_week_view_draw_time): Use Pango. * gui/e-week-view-main-item.c (e_week_view_main_item_draw_day): Use Pango. * gui/e-week-view-titles-item.c (e_week_view_titles_item_draw): Use Pango. * gui/e-week-view.c: No longer specify an explicit X font string for the small font. Use the main font, and change the point size. (e_week_view_init): Use Pango. (e_week_view_destroy): Use Pango. (get_string_width): Implemented for convenience. (get_digit_width): Implemented for convenience. (e_week_view_style_set): Use Pango. (e_week_view_recalc_cell_sizes): Use Pango. (e_week_view_get_time_string_width): Use Pango. * gui/e-week-view.h: Use Pango. Following are some random UTF-8 fixes and a crash fix. * gui/itip-utils.c (comp_description): Use g_locale_to_utf8 (). * gui/dialogs/comp-editor.c (make_title_from_comp): Return a UTF-8 string. * gui/dialogs/alarm-page.c (alarm_page_set_summary): Pass UTF-8 directly to GTK. * gui/dialogs/delete-comp.c (delete_component_dialog): Ditto. * gui/dialogs/meeting-page.c (meeting_page_fill_widgets): Ditto. (meeting_page_construct): Ditto. * gui/dialogs/recurrence-page.c (recurrence_page_set_summary): Ditto. * gui/dialogs/event-editor.c (event_editor_finalize): Fix crash caused by gtk_object_destroy()-ing a non-GtkObject. svn path=/trunk/; revision=19628
Diffstat (limited to 'calendar/gui/e-day-view-top-item.c')
-rw-r--r--calendar/gui/e-day-view-top-item.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/calendar/gui/e-day-view-top-item.c b/calendar/gui/e-day-view-top-item.c
index e35b08d830..0f7ce66124 100644
--- a/calendar/gui/e-day-view-top-item.c
+++ b/calendar/gui/e-day-view-top-item.c
@@ -171,6 +171,7 @@ e_day_view_top_item_draw (GnomeCanvasItem *canvas_item,
gint item_height, event_num;
struct tm day_start = { 0 };
struct icaltimetype day_start_tt;
+ PangoLayout *layout;
#if 0
g_print ("In e_day_view_top_item_draw %i,%i %ix%i\n",
@@ -280,8 +281,13 @@ e_day_view_top_item_draw (GnomeCanvasItem *canvas_item,
date_width = gdk_string_width (font, buffer);
date_x = day_view->day_offsets[day] + (day_view->day_widths[day] - date_width) / 2;
- gdk_draw_string (drawable, font, fg_gc,
- date_x - x, 3 + font->ascent - y, buffer);
+
+ layout = gtk_widget_create_pango_layout (GTK_WIDGET (day_view), buffer);
+ gdk_draw_layout (drawable, fg_gc,
+ date_x - x,
+ 3 - y,
+ layout);
+ g_object_unref (layout);
gdk_gc_set_clip_rectangle (fg_gc, NULL);
@@ -481,7 +487,11 @@ e_day_view_top_item_draw_long_event (EDayViewTopItem *dvtitem,
item_y + E_DAY_VIEW_LONG_EVENT_BORDER_HEIGHT
+ E_DAY_VIEW_LONG_EVENT_Y_PAD
+ font->ascent - y,
+#if 0
buffer);
+#else
+ "FIXME text");
+#endif
gdk_gc_set_clip_rectangle (fg_gc, NULL);
@@ -522,7 +532,11 @@ e_day_view_top_item_draw_long_event (EDayViewTopItem *dvtitem,
time_x,
item_y + E_DAY_VIEW_LONG_EVENT_Y_PAD
+ font->ascent + 1 - y,
+#if 0
buffer);
+#else
+ "FIXME text");
+#endif
max_icon_x -= time_width + E_DAY_VIEW_LONG_EVENT_TIME_X_PAD;
}