viscal

cairo/gtk vi-like timeblocking calendar
git clone git://jb55.com/viscal
Log | Files | Refs | README | LICENSE

commit 45e578d569a669f7508e50be02f5e60a3c455b38
parent 810e735241d16f41bab41be2d2a5598d4b95f315
Author: William Casarin <jb55@jb55.com>
Date:   Thu, 11 Oct 2018 20:58:09 -0700

event movement

Diffstat:
Mviscal.c | 23+++++++++++++++++++++++
1 file changed, 23 insertions(+), 0 deletions(-)

diff --git a/viscal.c b/viscal.c @@ -1103,6 +1103,21 @@ static void move_event(struct event *event, int minutes) icalcomponent_set_dtend(event->vevent, et); } + + +static void move_event_action(struct cal *cal, int direction) +{ + struct event *event = + get_selected_event(cal); + + if (!event) + return; + + move_event(event, direction * 15); +} + + + static void delete_event(struct cal *cal, struct event *event) { int i, ind = -1; @@ -1354,6 +1369,14 @@ static gboolean on_keypress (GtkWidget *widget, GdkEvent *event, gpointer user_ cal->chord = 'g'; break; + case 'K': + move_event_action(cal, -1); + break; + + case 'J': + move_event_action(cal, 1); + break; + case 'j': move_down(cal, cal->repeat); break;