Up and Down buttons
The up and down buttons have been re-added. They store their state between sessions.
This commit is contained in:
parent
6d9d3e0cb9
commit
3bf990f8c8
|
@ -34,6 +34,16 @@ def add_page(title, widget):
|
|||
pages[title] = widget
|
||||
tabs.append_page(widget, label)
|
||||
|
||||
def up_button():
|
||||
tabs.show()
|
||||
bar.hide()
|
||||
libsaria.prefs.set_pref("ocarina.footer.up", True)
|
||||
|
||||
def down_button():
|
||||
tabs.hide()
|
||||
bar.show()
|
||||
libsaria.prefs.set_pref("ocarina.footer.down", False)
|
||||
|
||||
def make_bar():
|
||||
title.set_text(ocarina.__vers__)
|
||||
title.set_ellipsize(pango.ELLIPSIZE_END)
|
||||
|
@ -48,6 +58,7 @@ def make_bar():
|
|||
bar_add(button.PauseButton())
|
||||
bar_add(button.StopButton())
|
||||
bar_add(button.NextButton())
|
||||
bar_add(button.UpButton(up_button))
|
||||
|
||||
bar.show()
|
||||
footer.pack_start(bar)
|
||||
|
@ -59,6 +70,7 @@ def make_action_bar():
|
|||
act_bar_add(button.PauseButton())
|
||||
act_bar_add(button.StopButton())
|
||||
act_bar_add(button.NextButton())
|
||||
act_bar_add(button.DownButton(down_button))
|
||||
act_bar.show()
|
||||
|
||||
def make_now_playing_page():
|
||||
|
@ -100,5 +112,11 @@ def init():
|
|||
footer.show_all()
|
||||
make_bar()
|
||||
make_tabs()
|
||||
|
||||
up = libsaria.init_pref("ocarina.footer.up", False)
|
||||
if up == True:
|
||||
up_button()
|
||||
else:
|
||||
down_button()
|
||||
libsaria.event.invite("POSTLOAD", change_title)
|
||||
init()
|
||||
|
|
Loading…
Reference in New Issue