From c4f04173c44ec79c80de1eed47892e28fde2d704 Mon Sep 17 00:00:00 2001 From: Blake DeMarcy Date: Tue, 25 Apr 2017 20:37:21 -0500 Subject: [PATCH] handle the mouse in the prompts too --- clients/urwid/main.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/clients/urwid/main.py b/clients/urwid/main.py index c07db81..57bb119 100644 --- a/clients/urwid/main.py +++ b/clients/urwid/main.py @@ -1181,7 +1181,7 @@ class App(object): urwid.Text(("button", "Max message width:")), urwid.AttrMap(width_edit, "opt_prompt"), urwid.Divider(), - urwid.Text(("button", "Scroll multiplier when holding shift:")), + urwid.Text(("button", "Scroll multiplier when holding shift or scrolling with the mouse:")), urwid.AttrMap(shift_edit, "opt_prompt"), urwid.Divider(), urwid.Text(("button", "Text editor:")), @@ -1694,6 +1694,16 @@ class OptionsMenu(urwid.LineBox): wipe_screen() + def mouse_event(self, size, event, button, x, y, focus): + if super(OptionsMenu, self).mouse_event(size, event, button, x, y, focus): + return + if button == 4: + self.keypress(size, "up") + + elif button == 5: + self.keypress(size, "down") + + class ActionBox(urwid.ListBox): """ The listwalker used by all the browsing pages. Most of the application