From fcd505e7d6a3ab6c390146f4f8f3edd6d906479f Mon Sep 17 00:00:00 2001 From: Rodney Dawes Date: Tue, 14 Dec 2004 23:14:29 +0000 Subject: Use gtk_paint_foo instead of the deprecated gtk_draw_foo functions 2004-12-14 Rodney Dawes * 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 --- widgets/misc/test-calendar.c | 75 -------------------------------------------- 1 file changed, 75 deletions(-) (limited to 'widgets/misc/test-calendar.c') diff --git a/widgets/misc/test-calendar.c b/widgets/misc/test-calendar.c index f156e66599..2b017ae6fe 100644 --- a/widgets/misc/test-calendar.c +++ b/widgets/misc/test-calendar.c @@ -50,21 +50,6 @@ static guint n_targets = sizeof(target_table) / sizeof(target_table[0]); static void on_date_range_changed (ECalendarItem *calitem); static void on_selection_changed (ECalendarItem *calitem); -static void get_day_style (ECalendarItem *calitem, - gint year, - gint month, - gint day, - gint day_style, - gboolean today, - gboolean prev_or_next_month, - gboolean selected, - gboolean has_focus, - gboolean drop_target, - GdkColor **bg_color, - GdkColor **fg_color, - GdkColor **box_color, - gboolean *bold, - gpointer data); static void delete_event_cb (GtkWidget *widget, @@ -96,8 +81,6 @@ main (int argc, char **argv) e_calendar_set_minimum_size (E_CALENDAR (cal), 1, 1); calitem = E_CALENDAR (cal)->calitem; gtk_widget_show (cal); - e_calendar_item_set_style_callback (calitem, get_day_style, - NULL, NULL); g_signal_connect((calitem), "date_range_changed", G_CALLBACK (on_date_range_changed), NULL); @@ -161,61 +144,3 @@ on_selection_changed (ECalendarItem *calitem) g_date_get_month (&end_date), g_date_get_year (&end_date)); } - - -static void -get_day_style (ECalendarItem *calitem, - gint year, - gint month, - gint day, - gint day_style, - gboolean today, - gboolean prev_or_next_month, - gboolean selected, - gboolean has_focus, - gboolean drop_target, - GdkColor **bg_color, - GdkColor **fg_color, - GdkColor **box_color, - gboolean *bold, - gpointer data) -{ - *bg_color = NULL; - *fg_color = NULL; - *box_color = NULL; - *bold = FALSE; - -#if 1 - - if (day_style == 1) - *bold = TRUE; - - if (today) - *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]; - - if (selected) { - *fg_color = &calitem->colors[E_CALENDAR_ITEM_COLOR_SELECTION_FG]; - *bg_color = &calitem->colors[E_CALENDAR_ITEM_COLOR_SELECTION_BG]; - } - -#else - - if (day_style == 1) - *bold = TRUE; - - if (today) - *box_color = &calitem->colors[E_CALENDAR_ITEM_COLOR_PREV_OR_NEXT_MONTH_FG]; - - if (prev_or_next_month) - *fg_color = &calitem->colors[E_CALENDAR_ITEM_COLOR_TODAY_BOX]; - - if (selected) { - *fg_color = &calitem->colors[E_CALENDAR_ITEM_COLOR_SELECTION_FG]; - *bg_color = &calitem->colors[E_CALENDAR_ITEM_COLOR_PREV_OR_NEXT_MONTH_FG]; - } - -#endif -} -- cgit v1.2.3