diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-03-05 12:38:41 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-03-05 20:36:23 +0800 |
commit | 2836a54dd6d61e35d1446f9a23a628064516a309 (patch) | |
tree | b9cb2ab39212de803e935ed28957ee77e73c2d96 /widgets/misc/e-calendar.c | |
parent | baa7f20333a5bbb7c8cbb3cf2ce86b57aba79ef2 (diff) | |
download | gsoc2013-evolution-2836a54dd6d61e35d1446f9a23a628064516a309.tar gsoc2013-evolution-2836a54dd6d61e35d1446f9a23a628064516a309.tar.gz gsoc2013-evolution-2836a54dd6d61e35d1446f9a23a628064516a309.tar.bz2 gsoc2013-evolution-2836a54dd6d61e35d1446f9a23a628064516a309.tar.lz gsoc2013-evolution-2836a54dd6d61e35d1446f9a23a628064516a309.tar.xz gsoc2013-evolution-2836a54dd6d61e35d1446f9a23a628064516a309.tar.zst gsoc2013-evolution-2836a54dd6d61e35d1446f9a23a628064516a309.zip |
Work around recent GTK+ deprecations.
Diffstat (limited to 'widgets/misc/e-calendar.c')
-rw-r--r-- | widgets/misc/e-calendar.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/widgets/misc/e-calendar.c b/widgets/misc/e-calendar.c index 5fb933baa6..27ac031b8d 100644 --- a/widgets/misc/e-calendar.c +++ b/widgets/misc/e-calendar.c @@ -266,7 +266,11 @@ e_calendar_style_set (GtkWidget *widget, /* Set the background of the canvas window to the normal color, or the arrow buttons are not displayed properly. */ +#if GTK_CHECK_VERSION(2,19,7) + if (gtk_widget_get_realized (widget)) { +#else if (GTK_WIDGET_REALIZED (widget)) { +#endif GtkStyle *style; GdkWindow *window; @@ -558,8 +562,13 @@ e_calendar_button_has_focus (ECalendar *cal) prev_widget = GNOME_CANVAS_WIDGET(cal->prev_item)->widget; next_widget = GNOME_CANVAS_WIDGET(cal->next_item)->widget; +#if GTK_CHECK_VERSION(2,19,7) + ret_val = gtk_widget_has_focus (prev_widget) || + gtk_widget_has_focus (next_widget); +#else ret_val = GTK_WIDGET_HAS_FOCUS (prev_widget) || GTK_WIDGET_HAS_FOCUS (next_widget); +#endif return ret_val; } @@ -586,7 +595,11 @@ e_calendar_focus (GtkWidget *widget, GtkDirectionType direction) children[2] = cal->next_item; /* get current focused item, if e-calendar has had focus */ +#if GTK_CHECK_VERSION(2,19,7) + if (gtk_widget_has_focus (widget) || e_calendar_button_has_focus (cal)) +#else if (GTK_WIDGET_HAS_FOCUS (widget) || e_calendar_button_has_focus (cal)) +#endif for (index = 0; index < E_CALENDAR_FOCUS_CHILDREN_NUM; ++index) { if (canvas->focused_item == NULL) break; @@ -636,7 +649,11 @@ e_calendar_set_focusable (ECalendar *cal, gboolean focusable) GTK_WIDGET_SET_FLAGS (next_widget, GTK_CAN_FOCUS); } else { +#if GTK_CHECK_VERSION(2,19,7) + if (gtk_widget_has_focus (GTK_WIDGET (cal)) || e_calendar_button_has_focus (cal)) { +#else if (GTK_WIDGET_HAS_FOCUS (cal) || e_calendar_button_has_focus (cal)) { +#endif GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (cal)); if (toplevel) gtk_widget_grab_focus (toplevel); |