~jb55/viscal

500b4d3d911e516fe4d055ea88a252ec41759a19 — William Casarin 2 months ago 263b7ea master
key: ctrl-v to expand and push down

Signed-off-by: William Casarin <jb55@jb55.com>
1 files changed, 21 insertions(+), 0 deletions(-)

M viscal.c
M viscal.c => viscal.c +21 -0
@@ 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;