aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-week-view-main-item.c
diff options
context:
space:
mode:
authorDamon Chaplin <damon@helixcode.com>2001-01-18 02:45:40 +0800
committerDamon Chaplin <damon@src.gnome.org>2001-01-18 02:45:40 +0800
commit08ea9ff68d9b544242dfe7f0f4409e90f2f24ebd (patch)
tree511f5630856246bf8fa2a917b5d51dd11bf5240b /calendar/gui/e-week-view-main-item.c
parent60d8fc824908c3522765003de4ef821005c415ff (diff)
downloadgsoc2013-evolution-08ea9ff68d9b544242dfe7f0f4409e90f2f24ebd.tar
gsoc2013-evolution-08ea9ff68d9b544242dfe7f0f4409e90f2f24ebd.tar.gz
gsoc2013-evolution-08ea9ff68d9b544242dfe7f0f4409e90f2f24ebd.tar.bz2
gsoc2013-evolution-08ea9ff68d9b544242dfe7f0f4409e90f2f24ebd.tar.lz
gsoc2013-evolution-08ea9ff68d9b544242dfe7f0f4409e90f2f24ebd.tar.xz
gsoc2013-evolution-08ea9ff68d9b544242dfe7f0f4409e90f2f24ebd.tar.zst
gsoc2013-evolution-08ea9ff68d9b544242dfe7f0f4409e90f2f24ebd.zip
gui/e-week-view*.c don't use the theme colors at all within the graphical
2001-01-17 Damon Chaplin <damon@helixcode.com> * gui/e-week-view*.c * gui/e-day-view*.c: don't use the theme colors at all within the graphical parts of the widgets, since they may clash with our colors. May make them configurable in future so people can tweak them to go with their theme. At least the calendars are usable in any theme now, even though the colors may not go well with the theme. Also set the font of all the EText items in style_set. * gui/e-week-view-event-item.c (e_week_view_event_item_draw): don't draw the icons if we are editing the event. * gui/e-day-view.c: * gui/e-week-view.c: reinstated the optimizations so we don't do a complete relayout if the event's dates haven't been changed. (Though we still do a re-layout when recurring events change, since comparing all the RDATES/RRULES/EXDATES/EXRULES is too much hassle.) A side-effect of this change is that the EWeekView won't crash so often - only recurring events will be a problem. * cal-util/cal-component.[hc]: added function to check if the start and end dates of a component match. Used for optimizing the updating of the EDayView & EWeekView. svn path=/trunk/; revision=7593
Diffstat (limited to 'calendar/gui/e-week-view-main-item.c')
-rw-r--r--calendar/gui/e-week-view-main-item.c33
1 files changed, 15 insertions, 18 deletions
diff --git a/calendar/gui/e-week-view-main-item.c b/calendar/gui/e-week-view-main-item.c
index 10990324ff..e1959489b1 100644
--- a/calendar/gui/e-week-view-main-item.c
+++ b/calendar/gui/e-week-view-main-item.c
@@ -223,8 +223,7 @@ e_week_view_main_item_draw_day (EWeekViewMainItem *wvmitem,
{
EWeekView *week_view;
GtkStyle *style;
- GdkGC *fg_gc, *bg_gc, *light_gc, *dark_gc, *gc, *date_gc;
- GdkGC *selected_fg_gc, *selected_bg_gc;
+ GdkGC *gc;
GdkFont *font;
gint right_edge, bottom_edge, date_width, date_x, line_y;
gboolean show_day_name, show_month_name, selected;
@@ -238,12 +237,6 @@ e_week_view_main_item_draw_day (EWeekViewMainItem *wvmitem,
week_view = wvmitem->week_view;
style = GTK_WIDGET (week_view)->style;
font = style->font;
- fg_gc = style->fg_gc[GTK_STATE_NORMAL];
- bg_gc = style->bg_gc[GTK_STATE_PRELIGHT];
- light_gc = style->light_gc[GTK_STATE_NORMAL];
- dark_gc = style->dark_gc[GTK_STATE_NORMAL];
- selected_fg_gc = style->fg_gc[GTK_STATE_SELECTED];
- selected_bg_gc = style->bg_gc[GTK_STATE_SELECTED];
gc = week_view->main_gc;
g_return_if_fail (gc != NULL);
@@ -272,9 +265,10 @@ e_week_view_main_item_draw_day (EWeekViewMainItem *wvmitem,
right_edge = x + width - 1;
bottom_edge = y + height - 1;
- gdk_draw_line (drawable, fg_gc,
+ gdk_gc_set_foreground (gc, &week_view->colors[E_WEEK_VIEW_COLOR_GRID]);
+ gdk_draw_line (drawable, gc,
right_edge, y, right_edge, bottom_edge);
- gdk_draw_line (drawable, fg_gc,
+ gdk_draw_line (drawable, gc,
x, bottom_edge, right_edge, bottom_edge);
/* If the day is selected, draw the blue background. */
@@ -285,16 +279,18 @@ e_week_view_main_item_draw_day (EWeekViewMainItem *wvmitem,
|| week_view->selection_end_day < day)
selected = FALSE;
if (selected) {
- if (week_view->multi_week_view)
- gdk_draw_rectangle (drawable, selected_bg_gc, TRUE,
+ gdk_gc_set_foreground (gc, &week_view->colors[E_WEEK_VIEW_COLOR_SELECTED]);
+ if (week_view->multi_week_view) {
+ gdk_draw_rectangle (drawable, gc, TRUE,
x + 2, y + 1,
width - 5,
E_WEEK_VIEW_DATE_T_PAD - 1
+ font->ascent + font->descent);
- else
- gdk_draw_rectangle (drawable, selected_bg_gc, TRUE,
+ } else {
+ gdk_draw_rectangle (drawable, gc, TRUE,
x + 2, y + 1,
width - 5, line_y - y);
+ }
}
/* Display the date in the top of the cell.
@@ -355,16 +351,17 @@ e_week_view_main_item_draw_day (EWeekViewMainItem *wvmitem,
date_x = MAX (date_x, x + 1);
if (selected)
- date_gc = selected_fg_gc;
+ gdk_gc_set_foreground (gc, &week_view->colors[E_WEEK_VIEW_COLOR_DATES_SELECTED]);
else
- date_gc = fg_gc;
- gdk_draw_string (drawable, font, date_gc,
+ gdk_gc_set_foreground (gc, &week_view->colors[E_WEEK_VIEW_COLOR_DATES]);
+ gdk_draw_string (drawable, font, gc,
date_x, y + E_WEEK_VIEW_DATE_T_PAD + font->ascent,
buffer);
/* Draw the line under the date. */
if (!week_view->multi_week_view) {
- gdk_draw_line (drawable, fg_gc,
+ gdk_gc_set_foreground (gc, &week_view->colors[E_WEEK_VIEW_COLOR_GRID]);
+ gdk_draw_line (drawable, gc,
x + E_WEEK_VIEW_DATE_LINE_L_PAD, line_y,
right_edge, line_y);
}