From 50def316511d6eb86b7199fe699662b1c932a4e0 Mon Sep 17 00:00:00 2001 From: Nicolas Chachereau Date: Sun, 9 Nov 2014 23:09:11 +0100 Subject: [PATCH] Make Home and End keys work in overview --- src/hamster/widgets/facttree.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/hamster/widgets/facttree.py b/src/hamster/widgets/facttree.py index 3557c2856..cc3de5d6e 100644 --- a/src/hamster/widgets/facttree.py +++ b/src/hamster/widgets/facttree.py @@ -185,9 +185,9 @@ class FactTree(graphics.Scene, gtk.Scrollable): """ The fact tree is a painter - it maintains scroll state and shows what we can see. That means it does not show all the facts there are, but rather only - those tht you can see. + those that you can see. It's also painter as it reuses labels. Caching is futile, we do all the painting - every tie + every time @@ -288,6 +288,12 @@ def on_key_press(self, scene, event): self.y -= self.height * 0.8 self.on_scroll() + elif event.keyval == gdk.KEY_Home: + self.set_current_fact(0) + + elif event.keyval == gdk.KEY_End: + self.set_current_fact(len(self.facts) - 1) + elif event.keyval == gdk.KEY_Return: self.activate_row(self.hover_day, self.current_fact)