ocarina: Selectively add header and footer to tab pages
If I don't want the header or footer on a tab page, I shouldn't have to draw it. This patch gives me a way to do that.
This commit is contained in:
parent
94f428e615
commit
c185524d62
|
@ -32,16 +32,20 @@ class Page(gtk.VBox):
|
|||
self.content.goto()
|
||||
|
||||
def visible(self):
|
||||
self.pack_start(page_header, False, False)
|
||||
if self.content.header == True:
|
||||
self.pack_start(page_header, False, False)
|
||||
self.pack_start(self.content, True, True)
|
||||
self.pack_start(page_footer, False, False)
|
||||
if self.content.footer == True:
|
||||
self.pack_start(page_footer, False, False)
|
||||
if self.vis_func:
|
||||
self.vis_func()
|
||||
|
||||
def invisible(self):
|
||||
self.remove(page_header)
|
||||
if self.content.header == True:
|
||||
self.remove(page_header)
|
||||
self.remove(self.content)
|
||||
self.remove(page_footer)
|
||||
if self.content.footer == True:
|
||||
self.remove(page_footer)
|
||||
if self.invis_func:
|
||||
self.invis_func()
|
||||
|
||||
|
|
|
@ -151,6 +151,8 @@ class Source(gtk.ScrolledWindow):
|
|||
self.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
|
||||
self.list = None
|
||||
self.filter = None
|
||||
self.header = True
|
||||
self.footer = True
|
||||
self.show()
|
||||
|
||||
def init(self, filter, is_visible, right_click, play_id, reset):
|
||||
|
|
|
@ -27,6 +27,8 @@ radio = path.join(html, "web_radio.html")
|
|||
web.open(radio)
|
||||
|
||||
page.show_all()
|
||||
page.header = False
|
||||
page.footer = False
|
||||
|
||||
def start():
|
||||
body.add_page("Web Radio", page)
|
||||
|
|
Loading…
Reference in New Issue