summaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-28 23:13:13 -0300
committerWerner Almesberger <werner@almesberger.net>2016-08-28 23:13:13 -0300
commitd05810c8d4c88eb73cb0350df1ab5c896c04c3c4 (patch)
treefeaf3a9375bf172c713788b0a1b2f0fea1eb6f6d /gui
parent545ecf392a5da2ee9a929d3fc9eca5bd33e3a056 (diff)
downloadeeshow-d05810c8d4c88eb73cb0350df1ab5c896c04c3c4.tar.gz
eeshow-d05810c8d4c88eb73cb0350df1ab5c896c04c3c4.tar.bz2
eeshow-d05810c8d4c88eb73cb0350df1ab5c896c04c3c4.zip
gui/history.c: add scrolling with the scroll wheel
Diffstat (limited to 'gui')
-rw-r--r--gui/history.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gui/history.c b/gui/history.c
index f76bb1d..30f88a9 100644
--- a/gui/history.c
+++ b/gui/history.c
@@ -270,6 +270,21 @@ static void history_drag_move(void *user, int dx, int dy)
}
+static void history_scroll(void *user, int x, int y, int dy)
+{
+ struct gui *gui = user;
+
+ if (dy < 0) {
+ gui->hist_y_offset += 20;
+ if (gui->hist_y_offset > 0)
+ gui->hist_y_offset = 0;
+ } else {
+ gui->hist_y_offset -= 20;
+ }
+ redraw(gui);
+}
+
+
static void history_key(void *user, int x, int y, int keyval)
{
struct gui *gui = user;
@@ -291,6 +306,7 @@ static const struct input_ops history_input_ops = {
.hover_click = history_click,
.drag_begin = input_accept,
.drag_move = history_drag_move,
+ .scroll = history_scroll,
.key = history_key,
};