aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc/e-calendar.c
diff options
context:
space:
mode:
authorHans Petter Jansson <hpj@ximian.com>2003-02-02 16:02:27 +0800
committerHans Petter <hansp@src.gnome.org>2003-02-02 16:02:27 +0800
commit9c2e592707b4290e72868136163f427da640b684 (patch)
tree083381717434f8b4a6dca07f25bf3f192d64af7c /widgets/misc/e-calendar.c
parent4a84630875e7aecd49239bd02dc28e0d1cbcb232 (diff)
downloadgsoc2013-evolution-9c2e592707b4290e72868136163f427da640b684.tar
gsoc2013-evolution-9c2e592707b4290e72868136163f427da640b684.tar.gz
gsoc2013-evolution-9c2e592707b4290e72868136163f427da640b684.tar.bz2
gsoc2013-evolution-9c2e592707b4290e72868136163f427da640b684.tar.lz
gsoc2013-evolution-9c2e592707b4290e72868136163f427da640b684.tar.xz
gsoc2013-evolution-9c2e592707b4290e72868136163f427da640b684.tar.zst
gsoc2013-evolution-9c2e592707b4290e72868136163f427da640b684.zip
Use Pango to draw. (e_calendar_item_class_init): Add font_desc and
2003-02-02 Hans Petter Jansson <hpj@ximian.com> * e-calendar-item.[ch]: Use Pango to draw. (e_calendar_item_class_init): Add font_desc and week_number_font_desc args. (e_calendar_item_get_arg): Ditto. (e_calendar_item_set_arg): Ditto. (e_calendar_item_draw_month): Use Pango. (e_calendar_item_draw_day_numbers): Ditto. * e-calendar.c: Use Pango to draw. Specify just the size of the small font to use, instead of all aspects of it. (e_calendar_init): Produce the small font description and pass it to the ECalendarItem. svn path=/trunk/; revision=19705
Diffstat (limited to 'widgets/misc/e-calendar.c')
-rw-r--r--widgets/misc/e-calendar.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/widgets/misc/e-calendar.c b/widgets/misc/e-calendar.c
index 105afc555a..dce0e05771 100644
--- a/widgets/misc/e-calendar.c
+++ b/widgets/misc/e-calendar.c
@@ -41,6 +41,8 @@
#include <libgnomecanvas/gnome-canvas-widget.h>
#include <gal/util/e-util.h>
+#define E_CALENDAR_SMALL_FONT_PTSIZE 6
+
#define E_CALENDAR_SMALL_FONT \
"-adobe-utopia-regular-r-normal-*-*-100-*-*-p-*-iso8859-*"
#define E_CALENDAR_SMALL_FONT_FALLBACK \
@@ -158,6 +160,7 @@ e_calendar_init (ECalendar *cal)
{
GnomeCanvasGroup *canvas_group;
GdkFont *small_font;
+ PangoFontDescription *small_font_desc;
GtkWidget *button, *pixmap;
GdkColormap *colormap;
GdkPixmap *gdk_pixmap;
@@ -172,16 +175,23 @@ e_calendar_init (ECalendar *cal)
if (!small_font)
g_warning ("Couldn't load font");
+ small_font_desc =
+ pango_font_description_copy (gtk_widget_get_style (GTK_WIDGET (cal))->font_desc);
+ pango_font_description_set_size (small_font_desc,
+ E_CALENDAR_SMALL_FONT_PTSIZE * PANGO_SCALE);
+
canvas_group = GNOME_CANVAS_GROUP (GNOME_CANVAS (cal)->root);
cal->calitem = E_CALENDAR_ITEM (gnome_canvas_item_new (canvas_group,
e_calendar_item_get_type (),
"week_number_font", small_font,
+ "week_number_font_desc", small_font_desc,
NULL));
if (small_font)
gdk_font_unref (small_font);
+ pango_font_description_free (small_font_desc);
/* Create the arrow buttons to move to the previous/next month. */
button = gtk_button_new ();