viscal

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

commit 500b4d3d911e516fe4d055ea88a252ec41759a19
parent 263b7ea49173e328f24d335e06b39cecd4efabfa
Author: William Casarin <jb55@jb55.com>
Date:   Wed, 14 Apr 2021 10:42:34 -0700

key: ctrl-v to expand and push down

Signed-off-by: William Casarin <jb55@jb55.com>

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

diff --git a/viscal.c b/viscal.c @@ -1225,6 +1225,23 @@ static void push_up(struct cal *cal, int ind, time_t push_to) push_up(cal, ind-1, new_st); } +static void push_expand_selection(struct cal *cal) +{ + time_t st, et, push_to, new_st; + struct event *ev; + + expand_selection(cal); + + ev = get_selected_event(cal); + + if (ev == NULL) + return; + + vevent_span_timet(ev->vevent, &st, &et); + + push_down(cal, cal->selected_event_ind+1, et); +} + static void pushmove_dir(struct cal *cal, int dir) { time_t st, et, push_to, new_st; struct event *ev; @@ -1788,6 +1805,10 @@ static gboolean on_keypress (GtkWidget *widget, GdkEvent *event, move_up(cal, cal->repeat); break; + case 0x16: + push_expand_selection(cal); + break; + case 'v': expand_selection(cal); break;