fix keybindings when bottom window is out of focus
This commit is contained in:
parent
55196c60fe
commit
2c130bf515
16
nex.py
16
nex.py
|
@ -120,10 +120,10 @@ class Browser(ptg.WindowManager):
|
||||||
vertical_align=ptg.VerticalAlignment.TOP)
|
vertical_align=ptg.VerticalAlignment.TOP)
|
||||||
self.footer = ptg.Window(
|
self.footer = ptg.Window(
|
||||||
ptg.Splitter(
|
ptg.Splitter(
|
||||||
ptg.KeyboardButton("Back", self.back, bound='b'),
|
["(B)ack", self.back],
|
||||||
ptg.KeyboardButton("Forward", self.forward, bound='f'),
|
["(F)orward", self.forward],
|
||||||
ptg.KeyboardButton("Reload", self.reload, bound='r'),
|
["(R)eload", self.reload],
|
||||||
ptg.KeyboardButton("Quit", self.stop, bound='q')
|
["(Q)uit", lambda *_: self.stop()]
|
||||||
),
|
),
|
||||||
box="EMPTY",
|
box="EMPTY",
|
||||||
is_persistant=True
|
is_persistant=True
|
||||||
|
@ -134,10 +134,13 @@ class Browser(ptg.WindowManager):
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
def _create_key_bindings(self):
|
def _create_key_bindings(self):
|
||||||
self.bind('j', lambda *_: self.body.scroll(5))
|
|
||||||
self.bind(ptg.keys.DOWN, lambda *_: self.body.scroll(5))
|
self.bind(ptg.keys.DOWN, lambda *_: self.body.scroll(5))
|
||||||
self.bind('k', lambda *_: self.body.scroll(-5))
|
|
||||||
self.bind(ptg.keys.UP, lambda *_: self.body.scroll(-5))
|
self.bind(ptg.keys.UP, lambda *_: self.body.scroll(-5))
|
||||||
|
self.bind('j', lambda *_: self.body.scroll(5))
|
||||||
|
self.bind('k', lambda *_: self.body.scroll(-5))
|
||||||
|
self.bind('b', self.back)
|
||||||
|
self.bind('f', self.forward)
|
||||||
|
self.bind('r', self.reload)
|
||||||
self.bind('q', lambda *_: self.stop())
|
self.bind('q', lambda *_: self.stop())
|
||||||
|
|
||||||
for i in range(10):
|
for i in range(10):
|
||||||
|
@ -148,7 +151,6 @@ class Browser(ptg.WindowManager):
|
||||||
self.layout.add_break()
|
self.layout.add_break()
|
||||||
self.layout.add_slot("Footer", height=1)
|
self.layout.add_slot("Footer", height=1)
|
||||||
|
|
||||||
# self.add(self.header)
|
|
||||||
self.add(self.body)
|
self.add(self.body)
|
||||||
self.add(self.footer)
|
self.add(self.footer)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue