gui: Add shuffle and repeat buttons

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
Anna Schumaker 2016-01-14 08:26:17 -05:00
parent 410a784ede
commit 2c676631a4
2 changed files with 202 additions and 128 deletions

View File

@ -601,18 +601,86 @@
<property name="position_set">True</property>
<property name="wide_handle">True</property>
<signal name="notify::position" handler="__sidebar_resize" swapped="no"/>
<child>
<object class="GtkBox" id="box5">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkButtonBox" id="buttonbox4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="valign">center</property>
<property name="spacing">5</property>
<property name="layout_style">spread</property>
<child>
<object class="GtkToggleButton" id="o_random">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="valign">center</property>
<child>
<object class="GtkImage" id="image10">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xpad">10</property>
<property name="ypad">2</property>
<property name="icon_name">media-playlist-shuffle</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
<property name="non_homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="o_repeat">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="valign">center</property>
<child>
<object class="GtkImage" id="image9">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xpad">10</property>
<property name="ypad">2</property>
<property name="icon_name">media-playlist-repeat</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
<property name="non_homogeneous">True</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow" id="scrolledwindow3">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="margin_right">1</property>
<property name="margin_top">5</property>
<property name="margin_bottom">5</property>
<property name="shadow_type">in</property>
<child>
<object class="GtkViewport" id="viewport1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkBox" id="box5">
<object class="GtkBox" id="box9">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
@ -756,9 +824,16 @@
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="resize">False</property>
<property name="shrink">True</property>
<property name="shrink">False</property>
</packing>
</child>
<child>

View File

@ -23,10 +23,9 @@ static void test_sidebar()
gui_builder_init("share/ocarina/ocarina6.glade");
gui_settings_init();
gui_sidebar_init();
paned = GTK_PANED(gui_builder_widget("o_sidebar"));
paned = GTK_PANED(gui_builder_widget("o_sidebar"));
test_equal(gui_settings_has("gui.sidebar.pos"), (bool)false);
test_equal(gtk_paned_get_position(paned), 125);
gtk_paned_set_position(paned, 300);
test_equal(gui_settings_has("gui.sidebar.pos"), (bool)true);