Made pane navigation buttons work regardless of focus

This commit is contained in:
Anna 2010-05-19 11:27:14 -04:00
parent c2aae17e5b
commit 34b8bc6b58
2 changed files with 27 additions and 2 deletions

1
TODO
View File

@ -17,3 +17,4 @@ bugs:
considerable tweaks to python-twitter)
* "ValueError: list.remove(x): x not in list" when trying to close a tab (error recurred after adding conversation support). Tabs can be reordered, then closed, as a workaround.
* Links must be right-clicked on to activate - can't left-click on the link directly. This seems to be a pygtk issue
* Double-quotes are not parsed correctly in tweets

View File

@ -432,13 +432,37 @@ class MyTwitter():
keyname = gtk.gdk.keyval_name(event.keyval)
if keyname == 'w' and event.state & gtk.gdk.CONTROL_MASK:
self.close_current_tab()
elif (keyname == 'Tab' and event.state & gtk.gdk.SHIFT_MASK and event.state & gtk.gdk.CONTROL_MASK) or (keyname == 'ISO_Left_Tab' and event.state & gtk.gdk.CONTROL_MASK) or (keyname == 'Page_Up' and event.state & gtk.gdk.CONTROL_MASK):
# 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()
return True
elif (keyname == 'Tab' and event.state & gtk.gdk.CONTROL_MASK) or (keyname == 'Page_Down' and event.state & gtk.gdk.CONTROL_MASK):
# 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()
return True
else:
scrolltype = None
if keyname == 'Page_Down':
scrolltype = gtk.SCROLL_PAGE_FORWARD
elif keyname == 'Page_Up':
scrolltype = gtk.SCROLL_PAGE_BACKWARD
elif keyname == 'Up':
scrolltype = gtk.SCROLL_STEP_BACKWARD
elif keyname == 'Down':
scrolltype = gtk.SCROLL_STEP_FORWARD
elif keyname == 'Home':
scrolltype = gtk.SCROLL_START
elif keyname == 'End':
scrolltype = gtk.SCROLL_END
if scrolltype:
self.tweet_notebook.get_nth_page(self.tweet_notebook.get_current_page()).emit('scroll-child', scrolltype, False)
return True
def close_current_tab(self):
current_pane = self.tweet_notebook.get_nth_page(self.tweet_notebook.get_current_page())