aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc/e-calendar.c
diff options
context:
space:
mode:
Diffstat (limited to 'widgets/misc/e-calendar.c')
-rw-r--r--widgets/misc/e-calendar.c34
1 files changed, 10 insertions, 24 deletions
diff --git a/widgets/misc/e-calendar.c b/widgets/misc/e-calendar.c
index 27ac031b8d..fd8f882b25 100644
--- a/widgets/misc/e-calendar.c
+++ b/widgets/misc/e-calendar.c
@@ -266,11 +266,7 @@ 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;
@@ -562,13 +558,8 @@ 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;
}
@@ -595,11 +586,7 @@ 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,30 +623,29 @@ e_calendar_focus (GtkWidget *widget, GtkDirectionType direction)
void
e_calendar_set_focusable (ECalendar *cal, gboolean focusable)
{
+ GtkWidget *widget;
GtkWidget *prev_widget, *next_widget;
+ GtkWidget *toplevel;
g_return_if_fail (E_IS_CALENDAR (cal));
+ widget = GTK_WIDGET (cal);
prev_widget = GNOME_CANVAS_WIDGET(cal->prev_item)->widget;
next_widget = GNOME_CANVAS_WIDGET(cal->next_item)->widget;
if (focusable) {
- GTK_WIDGET_SET_FLAGS (cal, GTK_CAN_FOCUS);
- GTK_WIDGET_SET_FLAGS (prev_widget, GTK_CAN_FOCUS);
- GTK_WIDGET_SET_FLAGS (next_widget, GTK_CAN_FOCUS);
+ gtk_widget_set_can_focus (widget, TRUE);
+ gtk_widget_set_can_focus (prev_widget, TRUE);
+ gtk_widget_set_can_focus (next_widget, TRUE);
}
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));
+ toplevel = gtk_widget_get_toplevel (widget);
if (toplevel)
gtk_widget_grab_focus (toplevel);
}
- GTK_WIDGET_UNSET_FLAGS (cal, GTK_CAN_FOCUS);
- GTK_WIDGET_UNSET_FLAGS (prev_widget, GTK_CAN_FOCUS);
- GTK_WIDGET_UNSET_FLAGS (next_widget, GTK_CAN_FOCUS);
+ gtk_widget_set_can_focus (widget, FALSE);
+ gtk_widget_set_can_focus (prev_widget, FALSE);
+ gtk_widget_set_can_focus (next_widget, FALSE);
}
}