aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc/e-calendar.c
diff options
context:
space:
mode:
authorHarry Lu <harry.lu@sun.com>2003-12-05 10:01:46 +0800
committerHarry Lu <haip@src.gnome.org>2003-12-05 10:01:46 +0800
commitc65fbd94c0daff4ed02df7447e8eeaddd9cff9c0 (patch)
tree4ab6660ba1b1a728dbb00fdfd9b9a86310528318 /widgets/misc/e-calendar.c
parent22f021924c1816eb5b958295e9dea290611c138d (diff)
downloadgsoc2013-evolution-c65fbd94c0daff4ed02df7447e8eeaddd9cff9c0.tar
gsoc2013-evolution-c65fbd94c0daff4ed02df7447e8eeaddd9cff9c0.tar.gz
gsoc2013-evolution-c65fbd94c0daff4ed02df7447e8eeaddd9cff9c0.tar.bz2
gsoc2013-evolution-c65fbd94c0daff4ed02df7447e8eeaddd9cff9c0.tar.lz
gsoc2013-evolution-c65fbd94c0daff4ed02df7447e8eeaddd9cff9c0.tar.xz
gsoc2013-evolution-c65fbd94c0daff4ed02df7447e8eeaddd9cff9c0.tar.zst
gsoc2013-evolution-c65fbd94c0daff4ed02df7447e8eeaddd9cff9c0.zip
Fix for bugzilla bug #51624 and #51627.
2003-12-04 Harry Lu <harry.lu@sun.com> Fix for bugzilla bug #51624 and #51627. * e-calendar-item.c: (e_calendar_item_selection_add_days): set the date to the first day of the month so that user can use keyboard's arrow key to select a date. (e_calendar_item_set_selection_if_emission): only set selection_changed if emission is TRUE. * e-calendar.c: (e_calendar_init): add back the "clicked" handler so that user can use keyboard to click the button. (e_calendar_start_auto_move): no need to move since it is already handled by the clicked handler (e_calendar_on_prev_clicked), (e_calendar_on_next_clicked): move the month here. * e-dateedit.c: (e_date_edit_show_date_popup): use gdk_window_focus instead of gdk_keyboard_grab so that the focus won't lost if user click the button with keyboard. (hide_date_popup): no need to call gdk_keyboard_ungrab. svn path=/trunk/; revision=23642
Diffstat (limited to 'widgets/misc/e-calendar.c')
-rw-r--r--widgets/misc/e-calendar.c29
1 files changed, 22 insertions, 7 deletions
diff --git a/widgets/misc/e-calendar.c b/widgets/misc/e-calendar.c
index 9a5f75769f..402e390df0 100644
--- a/widgets/misc/e-calendar.c
+++ b/widgets/misc/e-calendar.c
@@ -93,8 +93,10 @@ static gboolean e_calendar_focus (GtkWidget *widget,
static void e_calendar_on_prev_pressed (ECalendar *cal);
static void e_calendar_on_prev_released (ECalendar *cal);
+static void e_calendar_on_prev_clicked (ECalendar *cal);
static void e_calendar_on_next_pressed (ECalendar *cal);
static void e_calendar_on_next_released (ECalendar *cal);
+static void e_calendar_on_next_clicked (ECalendar *cal);
static void e_calendar_start_auto_move (ECalendar *cal,
gboolean moving_forward);
@@ -165,6 +167,9 @@ e_calendar_init (ECalendar *cal)
gtk_signal_connect_object (GTK_OBJECT (button), "released",
G_CALLBACK (e_calendar_on_prev_released),
GTK_OBJECT (cal));
+ gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
+ G_CALLBACK (e_calendar_on_prev_clicked),
+ GTK_OBJECT (cal));
pixmap = gtk_arrow_new (GTK_ARROW_LEFT, GTK_SHADOW_NONE);
gtk_widget_show (pixmap);
@@ -184,6 +189,9 @@ e_calendar_init (ECalendar *cal)
gtk_signal_connect_object (GTK_OBJECT (button), "released",
G_CALLBACK (e_calendar_on_next_released),
GTK_OBJECT (cal));
+ gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
+ G_CALLBACK (e_calendar_on_next_clicked),
+ GTK_OBJECT (cal));
pixmap = gtk_arrow_new (GTK_ARROW_RIGHT, GTK_SHADOW_NONE);
gtk_widget_show (pixmap);
@@ -442,9 +450,6 @@ static void
e_calendar_start_auto_move (ECalendar *cal,
gboolean moving_forward)
{
- ECalendarItem *calitem;
- gint offset;
-
if (cal->timeout_id == 0) {
cal->timeout_id = g_timeout_add (E_CALENDAR_AUTO_MOVE_TIMEOUT,
e_calendar_auto_move_handler,
@@ -453,10 +458,6 @@ e_calendar_start_auto_move (ECalendar *cal,
cal->timeout_delay = E_CALENDAR_AUTO_MOVE_TIMEOUT_DELAY;
cal->moving_forward = moving_forward;
- calitem = cal->calitem;
- offset = cal->moving_forward ? 1 : -1;
- e_calendar_item_set_first_month (calitem, calitem->year,
- calitem->month + offset);
}
@@ -510,6 +511,20 @@ e_calendar_stop_auto_move (ECalendar *cal)
}
}
+static void
+e_calendar_on_prev_clicked (ECalendar *cal)
+{
+ e_calendar_item_set_first_month (cal->calitem, cal->calitem->year,
+ cal->calitem->month - 1);
+}
+
+static void
+e_calendar_on_next_clicked (ECalendar *cal)
+{
+ e_calendar_item_set_first_month (cal->calitem, cal->calitem->year,
+ cal->calitem->month + 1);
+}
+
static gint
e_calendar_drag_motion (GtkWidget *widget,