From 6691c751bc327534c467c39b7a5585e09ccdb4db Mon Sep 17 00:00:00 2001 From: Anna Date: Mon, 7 Jun 2010 14:20:19 -0400 Subject: [PATCH] Make ctrl+tab behavior wrap --- hrafn.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/hrafn.py b/hrafn.py index 337b099..77c2a27 100755 --- a/hrafn.py +++ b/hrafn.py @@ -466,12 +466,18 @@ class Hrafn(): # Ctrl + Shift + Tab or Ctrl + PgUp or Ctrl + Left should go to prev tab elif event.state & gtk.gdk.CONTROL_MASK and ((keyname == 'Tab' and event.state & gtk.gdk.SHIFT_MASK) or keyname == 'ISO_Left_Tab' or keyname == 'Page_Up' or keyname == 'Left'): - self.tweet_notebook.prev_page() + if self.tweet_notebook.get_current_page() == 0: + self.tweet_notebook.set_current_page(-1) + else: + self.tweet_notebook.prev_page() return True # Ctrl + Tab or Ctrl + PgDown or Ctrl + Right should go to next tab elif event.state & gtk.gdk.CONTROL_MASK and (keyname == 'Tab' or keyname == 'Page_Down' or keyname == 'Right'): - self.tweet_notebook.next_page() + if self.tweet_notebook.get_current_page() == self.tweet_notebook.get_n_pages() - 1: + self.tweet_notebook.set_current_page(0) + else: + self.tweet_notebook.next_page() return True else: