Clicking the tab label should now mark that pane as read

This commit is contained in:
Anna 2010-04-12 22:30:09 -04:00
parent 0a9669e84a
commit f48d5accaf

View File

@ -186,7 +186,8 @@ class MyTwitter():
tab_label = CloseTabLabel(name) tab_label = CloseTabLabel(name)
self.tweet_notebook.append_page(new_pane, tab_label) self.tweet_notebook.append_page(new_pane, tab_label)
tab_label.connect('clicked', self.remove_view, name) tab_label.connect('label_clicked', new_pane.set_tweets_read_callback)
tab_label.connect('close_clicked', self.remove_view, name)
self.tweet_notebook.set_current_page(-1) # switch to the new pane self.tweet_notebook.set_current_page(-1) # switch to the new pane
@ -492,6 +493,8 @@ class CloseTabLabel(gtk.EventBox):
tabBox.pack_start(self.label, False) tabBox.pack_start(self.label, False)
tabBox.pack_start(tabButton, False) tabBox.pack_start(tabButton, False)
self.connect('button_press_event', self.on_button_press)
# needed, otherwise even calling show_all on the notebook won't # needed, otherwise even calling show_all on the notebook won't
# make the hbox contents appear. # make the hbox contents appear.
tabBox.show_all() tabBox.show_all()
@ -503,7 +506,11 @@ class CloseTabLabel(gtk.EventBox):
def on_clicked(self, event): def on_clicked(self, event):
self.emit('clicked') self.emit('close_clicked')
def on_button_press(self, event, direction):
self.emit('label_clicked')
### end class CloseTabLabel ### end class CloseTabLabel
@ -526,7 +533,10 @@ class User():
# main # main
# Create custom events for TweetBox # Create custom events for TweetBox
gobject.signal_new("clicked", CloseTabLabel, gobject.signal_new("close_clicked", CloseTabLabel,
gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE, ())
gobject.signal_new("label_clicked", CloseTabLabel,
gobject.SIGNAL_RUN_LAST, gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE, ()) gobject.TYPE_NONE, ())
gobject.signal_new("reply", TweetBox, gobject.signal_new("reply", TweetBox,