aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc/e-calendar-item.c
diff options
context:
space:
mode:
authorRodney Dawes <dobey@novell.com>2004-12-15 07:14:29 +0800
committerRodney Dawes <dobey@src.gnome.org>2004-12-15 07:14:29 +0800
commitfcd505e7d6a3ab6c390146f4f8f3edd6d906479f (patch)
treec09698c5185aeaf6ef92ddac6e1a0c6795210234 /widgets/misc/e-calendar-item.c
parent33145ba2591ed8abe170c06aa1710b336bfee6f6 (diff)
downloadgsoc2013-evolution-fcd505e7d6a3ab6c390146f4f8f3edd6d906479f.tar
gsoc2013-evolution-fcd505e7d6a3ab6c390146f4f8f3edd6d906479f.tar.gz
gsoc2013-evolution-fcd505e7d6a3ab6c390146f4f8f3edd6d906479f.tar.bz2
gsoc2013-evolution-fcd505e7d6a3ab6c390146f4f8f3edd6d906479f.tar.lz
gsoc2013-evolution-fcd505e7d6a3ab6c390146f4f8f3edd6d906479f.tar.xz
gsoc2013-evolution-fcd505e7d6a3ab6c390146f4f8f3edd6d906479f.tar.zst
gsoc2013-evolution-fcd505e7d6a3ab6c390146f4f8f3edd6d906479f.zip
Use gtk_paint_foo instead of the deprecated gtk_draw_foo functions
2004-12-14 Rodney Dawes <dobey@novell.com> * e-calendar-item.c (e_calendar_item_draw): Use gtk_paint_foo instead of the deprecated gtk_draw_foo functions (e_calendar_item_get_day_style): Use colors from the theme for the background and foreground of various items * test-calendar.c (main): Don't set a callback for getting the day style, we want the test app to use the widget defaults (get_day_style): Remove all this duplicated code as we want to use the widget default colors for day fg/bg svn path=/trunk/; revision=28126
Diffstat (limited to 'widgets/misc/e-calendar-item.c')
-rw-r--r--widgets/misc/e-calendar-item.c58
1 files changed, 34 insertions, 24 deletions
diff --git a/widgets/misc/e-calendar-item.c b/widgets/misc/e-calendar-item.c
index 4765bdb8d5..8e9c42c544 100644
--- a/widgets/misc/e-calendar-item.c
+++ b/widgets/misc/e-calendar-item.c
@@ -940,11 +940,11 @@ e_calendar_item_draw (GnomeCanvasItem *canvas_item,
calitem->y2 - calitem->y1 + 1);
/* Draw the shadow around the entire item. */
- gtk_draw_shadow (style, drawable,
- GTK_STATE_NORMAL, GTK_SHADOW_IN,
- calitem->x1 - x, calitem->y1 - y,
- calitem->x2 - calitem->x1 + 1,
- calitem->y2 - calitem->y1 + 1);
+ gtk_paint_shadow (style, drawable, GTK_STATE_NORMAL, GTK_SHADOW_IN,
+ NULL, NULL, "entry",
+ calitem->x1 - x, calitem->y1 - y,
+ calitem->x2 - calitem->x1 + 1,
+ calitem->y2 - calitem->y1 + 1);
row_y = canvas_item->y1 + ythickness;
bar_height = ythickness * 2
@@ -961,24 +961,27 @@ e_calendar_item_draw (GnomeCanvasItem *canvas_item,
- xthickness * 2,
bar_height);
- gtk_draw_shadow (style, drawable,
- GTK_STATE_NORMAL, GTK_SHADOW_OUT,
- calitem->x1 + xthickness - x, row_y - y,
- calitem->x2 - calitem->x1 + 1
- - xthickness * 2,
- bar_height);
+ gtk_paint_shadow (style, drawable,
+ GTK_STATE_NORMAL, GTK_SHADOW_OUT,
+ NULL, NULL, "calendar-header",
+ calitem->x1 + xthickness - x, row_y - y,
+ calitem->x2 - calitem->x1 + 1
+ - xthickness * 2,
+ bar_height);
for (col = 0; col < calitem->cols; col++) {
if (col != 0) {
col_x = calitem->x1 + calitem->x_offset
+ calitem->month_width * col;
- gtk_draw_vline (style, drawable,
- GTK_STATE_NORMAL,
- row_y + ythickness + 1 - y,
- row_y + bar_height
- - ythickness - 2 - y,
- col_x - 1 - x);
+ gtk_paint_vline (style, drawable,
+ GTK_STATE_NORMAL,
+ NULL, NULL,
+ "calendar-separator",
+ row_y + ythickness + 1 - y,
+ row_y + bar_height
+ - ythickness - 2 - y,
+ col_x - 1 - x);
}
@@ -1860,6 +1863,12 @@ e_calendar_item_get_day_style (ECalendarItem *calitem,
GdkColor **box_color,
gboolean *bold)
{
+ GtkWidget *widget;
+ GtkStyle *style;
+
+ widget = GTK_WIDGET (GNOME_CANVAS_ITEM (calitem)->canvas);
+ style = widget->style;
+
*bg_color = NULL;
*fg_color = NULL;
*box_color = NULL;
@@ -1872,15 +1881,16 @@ e_calendar_item_get_day_style (ECalendarItem *calitem,
*box_color = &calitem->colors[E_CALENDAR_ITEM_COLOR_TODAY_BOX];
if (prev_or_next_month)
- *fg_color = &calitem->colors[E_CALENDAR_ITEM_COLOR_PREV_OR_NEXT_MONTH_FG];
+ *fg_color = &style->mid[GTK_WIDGET_STATE (widget)];
if (selected) {
- *fg_color = &calitem->colors[E_CALENDAR_ITEM_COLOR_SELECTION_FG];
- if (has_focus)
- *bg_color = &calitem->colors[E_CALENDAR_ITEM_COLOR_SELECTION_BG_FOCUSED];
- else
- *bg_color = &calitem->colors[E_CALENDAR_ITEM_COLOR_SELECTION_BG];
-
+ if (has_focus) {
+ *fg_color = &style->text[GTK_STATE_SELECTED];
+ *bg_color = &style->base[GTK_STATE_SELECTED];
+ } else {
+ *fg_color = &style->text[GTK_STATE_ACTIVE];
+ *bg_color = &style->base[GTK_STATE_ACTIVE];
+ }
}
}