aboutsummaryrefslogtreecommitdiff
path: root/src/gui/calendar.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/calendar.rs')
-rw-r--r--src/gui/calendar.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/gui/calendar.rs b/src/gui/calendar.rs
index 918438d..026f86b 100644
--- a/src/gui/calendar.rs
+++ b/src/gui/calendar.rs
@@ -28,7 +28,17 @@ pub fn create(
}
let repetitions = event::repetitions_between(repeated_events, start_date, end_date);
- attach_days(tx, &grid, start_date, today, events, &repetitions);
+ attach_days(tx.clone(), &grid, start_date, today, events, &repetitions);
+
+ let event_controller_key = gtk::EventControllerKey::new();
+ event_controller_key.connect_key_released(glib::clone!(@strong tx => move |_, _, keycode, _| {
+ match keycode {
+ 111 => update::send(tx.clone(), Msg::SelectPreviousWeek), // UP
+ 116 => update::send(tx.clone(), Msg::SelectNextWeek), // DOWN
+ _ => ()
+ }
+ }));
+ grid.add_controller(&event_controller_key);
grid
}