ocarina: Show some attributes on the now playing page
Title, album, and artist for now.
This commit is contained in:
parent
8ea0036df0
commit
6c20398699
|
@ -75,13 +75,3 @@ def cur_page_clear():
|
|||
#set_pref("ocarina.body.page", next)
|
||||
#child.invisible()
|
||||
#next_pg.visible()
|
||||
|
||||
#def cur_page_reset():
|
||||
#cur_num = body.get_current_page()
|
||||
#page = body.get_nth_page(cur_num)
|
||||
#page.reset()
|
||||
|
||||
#def cur_page_goto():
|
||||
#cur_num = body.get_current_page()
|
||||
#page = body.get_nth_page(cur_num)
|
||||
#page.goto()
|
||||
|
|
|
@ -5,17 +5,23 @@ import gtk
|
|||
page = gtk.HBox(False, 5)
|
||||
label = gtk.Label("Now Playing")
|
||||
|
||||
def pack_label(box, label):
|
||||
a = gtk.Alignment(0, 0.5, 0, 0)
|
||||
a.add(label)
|
||||
a.show()
|
||||
box.pack_start(a)
|
||||
|
||||
TITLE = gtk.Label()
|
||||
ARTIST = gtk.Label()
|
||||
ALBUM = gtk.Label()
|
||||
ARTIST = gtk.Label("by")
|
||||
ALBUM = gtk.Label("from")
|
||||
tag_box = gtk.VBox(True)
|
||||
view = gtk.Viewport()
|
||||
tags = gtk.ScrolledWindow()
|
||||
view.set_shadow_type(gtk.SHADOW_NONE)
|
||||
tags.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
|
||||
tag_box.pack_start(TITLE)
|
||||
tag_box.pack_start(ARTIST)
|
||||
tag_box.pack_start(ALBUM)
|
||||
pack_label(tag_box, TITLE)
|
||||
pack_label(tag_box, ARTIST)
|
||||
pack_label(tag_box, ALBUM)
|
||||
view.add(tag_box)
|
||||
tags.add(view)
|
||||
page.pack_start(tags)
|
||||
|
@ -25,5 +31,5 @@ label.show()
|
|||
|
||||
def on_load(title, artist, album):
|
||||
TITLE.set_text(title)
|
||||
ARTIST.set_text(artist)
|
||||
ALBUM.set_text(album)
|
||||
ARTIST.set_text("by %s" % artist)
|
||||
ALBUM.set_text("from %s" % album)
|
||||
|
|
|
@ -36,18 +36,6 @@ class AttrLabel(gtk.Alignment):
|
|||
else:
|
||||
self.label.set_text("")
|
||||
|
||||
class TitleLabel(AttrLabel):
|
||||
def __init__(self):
|
||||
AttrLabel.__init__(self, "title")
|
||||
|
||||
class ArtistLabel(AttrLabel):
|
||||
def __init__(self):
|
||||
AttrLabel.__init__(self, "artist", "by")
|
||||
|
||||
class AlbumLabel(AttrLabel):
|
||||
def __init__(self):
|
||||
AttrLabel.__init__(self, "album", "from")
|
||||
|
||||
class YearLabel(AttrLabel):
|
||||
def __init__(self):
|
||||
AttrLabel.__init__(self, "year", "Year:")
|
||||
|
|
Loading…
Reference in New Issue
Block a user