diff options
author | Richard Hitt <rbh00@dell.rbh00.pacbell.net> | 2008-02-10 07:53:07 (GMT) |
---|---|---|
committer | Phil Bordelon <phil@thenexusproject.org> | 2008-02-13 04:10:07 (GMT) |
commit | 4cbbc59c9016b22323c952b7cd5f6f2bea8122c3 (patch) | |
tree | 5555c8fe11730df0d5c8450f041cd7b795b874fd | |
parent | 353ced8513d4caf871882b6604998ce19bfc93a9 (diff) |
Make tab text black when changing to the tab's page. Previous fix, at branch fix-tab-highlights, didn't do the whole job but only worked when the tab was mouse-clicked. This fix does it all, by using the gtk_notebook signal "switch-page".
Signed-off-by: Phil Bordelon <phil@thenexusproject.org>
-rw-r--r-- | purk/widgets.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/purk/widgets.py b/purk/widgets.py index 0f53bdd..2d7b3fa 100644 --- a/purk/widgets.py +++ b/purk/widgets.py @@ -653,10 +653,6 @@ class WindowLabel(gtk.EventBox): self.label.set_markup(title) def tab_popup(self, event): - # When a tab is selected, clear the activity and set CURRENT - if event.button == 1: # left click - self.win.activity = None - self.win.activity = CURRENT if event.button == 3: # right click c_data = self.events.data(window=self.win, menu=[]) self.events.trigger("WindowMenu", c_data) @@ -767,7 +763,7 @@ class UrkUITabs(gtk.VBox): gtk.gdk.threads_init() self.core = core self.events = core.events - self.tabs = gtk.Notebook() + self.tabs = Notebook() self.tabs.set_property( "tab-pos", conf.get("ui-gtk/tab-pos", gtk.POS_BOTTOM) @@ -806,3 +802,12 @@ class UrkUITabs(gtk.VBox): def update(self, window): self.tabs.get_tab_label(window).update() + +class Notebook(gtk.Notebook): + def __init__(self): + gtk.Notebook.__init__(self) + self.connect("switch-page", Notebook.switch_page, self) + + def switch_page(self, page, pnum, data): + self.get_nth_page(pnum).activity = None + self.get_nth_page(pnum).activity = CURRENT |