gui: Put file chooser and notebook onto a stack
The eventual goal is to replace the notebook, but this is a good start. Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
parent
21eb09ced3
commit
a313160f94
|
@ -152,12 +152,12 @@ void __collection_add(GtkButton *button, GtkFileChooser *chooser)
|
|||
void __collection_selection_changed(GtkTreeSelection *selection,
|
||||
GtkFileChooser *chooser)
|
||||
{
|
||||
GtkNotebook *notebook = GTK_NOTEBOOK(gui_builder_widget("o_notebook"));
|
||||
GtkStack *stack = GTK_STACK(gui_builder_widget("o_stack"));
|
||||
struct library *library;
|
||||
GtkTreeIter iter;
|
||||
|
||||
if (gtk_tree_selection_get_selected(selection, &c_model, &iter)) {
|
||||
gtk_notebook_set_current_page(notebook, tempq_count() + 3);
|
||||
gtk_stack_set_visible_child_name(stack, "chooser");
|
||||
library = __collection_get_library(&iter);
|
||||
|
||||
gui_sidebar_selected(SB_COLLECTION, NULL);
|
||||
|
|
|
@ -34,12 +34,14 @@ static void __playlist_add(GtkTreeIter *parent, const gchar *name,
|
|||
void __playlist_selection_changed(GtkTreeSelection *selection, gpointer data)
|
||||
{
|
||||
GtkNotebook *notebook = GTK_NOTEBOOK(gui_builder_widget("o_notebook"));
|
||||
GtkStack *stack = GTK_STACK(gui_builder_widget("o_stack"));
|
||||
GtkTreeModel *model = GTK_TREE_MODEL(p_store);
|
||||
GtkTreeIter iter;
|
||||
|
||||
if (gtk_tree_selection_get_selected(selection, &model, &iter)) {
|
||||
gtk_tree_model_get(model, &iter, P_SB_PLAYLIST, &p_cur, -1);
|
||||
|
||||
gtk_stack_set_visible_child_name(stack, "queues");
|
||||
gtk_notebook_set_current_page(notebook, tempq_count() + 2);
|
||||
gui_sidebar_selected(SB_PLAYLIST,
|
||||
gui_queue(playlist_get_queue()));
|
||||
|
|
|
@ -100,6 +100,7 @@ out:
|
|||
void __sidebar_selection_changed(GtkTreeSelection *selection, gpointer data)
|
||||
{
|
||||
GtkNotebook *notebook = GTK_NOTEBOOK(gui_builder_widget("o_notebook"));
|
||||
GtkStack *stack = GTK_STACK(gui_builder_widget("o_stack"));
|
||||
GtkTreeModel *model = GTK_TREE_MODEL(sb_store);
|
||||
GtkTreeIter iter;
|
||||
|
||||
|
@ -107,6 +108,7 @@ void __sidebar_selection_changed(GtkTreeSelection *selection, gpointer data)
|
|||
GtkTreePath *path = gtk_tree_model_get_path(model, &iter);
|
||||
unsigned int page = gtk_tree_path_get_indices(path)[0];
|
||||
|
||||
gtk_stack_set_visible_child_name(stack, "queues");
|
||||
gtk_notebook_set_current_page(notebook, page);
|
||||
gui_sidebar_selected(SB_SIDEBAR, __sidebar_get_queue(&iter));
|
||||
gtk_tree_path_free(path);
|
||||
|
|
|
@ -338,8 +338,8 @@
|
|||
<property name="icon_name">media-skip-backward</property>
|
||||
</object>
|
||||
</child>
|
||||
<accelerator key="AudioPrev" signal="clicked"/>
|
||||
<accelerator key="n" signal="clicked" modifiers="GDK_SHIFT_MASK"/>
|
||||
<accelerator key="AudioPrev" signal="clicked"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
|
@ -373,8 +373,8 @@
|
|||
<property name="icon_size">5</property>
|
||||
</object>
|
||||
</child>
|
||||
<accelerator key="AudioPlay" signal="clicked"/>
|
||||
<accelerator key="space" signal="clicked"/>
|
||||
<accelerator key="AudioPlay" signal="clicked"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
|
@ -407,8 +407,8 @@
|
|||
<property name="icon_size">5</property>
|
||||
</object>
|
||||
</child>
|
||||
<accelerator key="AudioPlay" signal="clicked"/>
|
||||
<accelerator key="space" signal="clicked"/>
|
||||
<accelerator key="AudioPlay" signal="clicked"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
|
@ -441,8 +441,8 @@
|
|||
<property name="icon_name">media-skip-forward</property>
|
||||
</object>
|
||||
</child>
|
||||
<accelerator key="AudioNext" signal="clicked"/>
|
||||
<accelerator key="n" signal="clicked"/>
|
||||
<accelerator key="AudioNext" signal="clicked"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
|
@ -842,6 +842,17 @@
|
|||
<property name="can_focus">False</property>
|
||||
<property name="margin_left">1</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkStack" id="o_stack">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="transition_type">over-up-down</property>
|
||||
<child>
|
||||
<object class="GtkBox" id="box11">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">5</property>
|
||||
<child>
|
||||
<object class="GtkBox" id="box10">
|
||||
<property name="visible">True</property>
|
||||
|
@ -894,6 +905,25 @@
|
|||
<property name="show_border">False</property>
|
||||
<property name="scrollable">True</property>
|
||||
<property name="enable_popup">True</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child type="tab">
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="name">queues</property>
|
||||
<property name="title" translatable="yes">page0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="box8">
|
||||
<property name="visible">True</property>
|
||||
|
@ -919,7 +949,7 @@
|
|||
<object class="GtkButtonBox" id="buttonbox3">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="opacity">0.96999999999999997</property>
|
||||
<property name="opacity">0.96862745098039216</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="layout_style">start</property>
|
||||
<child>
|
||||
|
@ -949,48 +979,12 @@
|
|||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="tab_fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child type="tab">
|
||||
<object class="GtkBox" id="box4">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="spacing">5</property>
|
||||
<child>
|
||||
<object class="GtkImage" id="image8">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="icon_name">system-file-manager</property>
|
||||
<property name="icon_size">1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_right">1</property>
|
||||
<property name="label" translatable="yes">Collection
|
||||
Manager</property>
|
||||
<property name="justify">center</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="name">chooser</property>
|
||||
<property name="title" translatable="yes">page1</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="tab_fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
|
@ -1100,7 +1094,7 @@ Manager</property>
|
|||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
|
|
Loading…
Reference in New Issue