diff options
author | Rodney Dawes <dobey@novell.com> | 2004-12-15 07:14:29 +0800 |
---|---|---|
committer | Rodney Dawes <dobey@src.gnome.org> | 2004-12-15 07:14:29 +0800 |
commit | fcd505e7d6a3ab6c390146f4f8f3edd6d906479f (patch) | |
tree | c09698c5185aeaf6ef92ddac6e1a0c6795210234 /widgets/misc/test-calendar.c | |
parent | 33145ba2591ed8abe170c06aa1710b336bfee6f6 (diff) | |
download | gsoc2013-evolution-fcd505e7d6a3ab6c390146f4f8f3edd6d906479f.tar.gz 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/test-calendar.c')
-rw-r--r-- | widgets/misc/test-calendar.c | 75 |
1 files changed, 0 insertions, 75 deletions
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 -} |