Add tooltips showing the gramplet name to bottombar tabs

svn: r16379
This commit is contained in:
Nick Hall 2011-01-14 00:13:59 +00:00
parent f49142aaca
commit 20f0e5d386

View File

@ -123,10 +123,7 @@ class Bottombar(object):
if g is not None] if g is not None]
gramplets.sort(key=lambda x: x.page) gramplets.sort(key=lambda x: x.page)
for gramplet in gramplets: for gramplet in gramplets:
gramplet.scrolledwindow.set_size_request(-1, 200) self.__add_tab(gramplet)
self.notebook.append_page(gramplet.mainframe,
gtk.Label(gramplet.title))
self.notebook.set_tab_reorderable(gramplet.mainframe, True)
if config_settings[0][0]: if config_settings[0][0]:
self.top.show() self.top.show()
@ -307,14 +304,21 @@ class Bottombar(object):
print "Problem creating ", tname print "Problem creating ", tname
return return
title = all_opts["title"] self.gramplet_map[gramplet.title] = gramplet
self.gramplet_map[title] = gramplet page_num = self.__add_tab(gramplet)
gramplet.scrolledwindow.set_size_request(-1, gramplet.height)
page_num = self.notebook.append_page(gramplet.mainframe,
gtk.Label(title))
self.notebook.set_tab_reorderable(gramplet.mainframe, True)
self.notebook.set_current_page(page_num) self.notebook.set_current_page(page_num)
def __add_tab(self, gramplet):
"""
Add a tab to the notebook for the given gramplet.
"""
gramplet.scrolledwindow.set_size_request(-1, gramplet.height)
label = gtk.Label(gramplet.title)
label.set_tooltip_text(gramplet.tname)
page_num = self.notebook.append_page(gramplet.mainframe, label)
self.notebook.set_tab_reorderable(gramplet.mainframe, True)
return page_num
def __delete_clicked(self, button): def __delete_clicked(self, button):
""" """
Called when the delete button is clicked. Called when the delete button is clicked.