From a313160f943bbf5f93f2827adbba2a948426004a Mon Sep 17 00:00:00 2001 From: Anna Schumaker Date: Fri, 15 Jan 2016 14:45:23 -0500 Subject: [PATCH] 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 --- gui/collection.c | 4 +- gui/playlist.c | 2 + gui/sidebar.c | 2 + share/ocarina/ocarina6.glade | 170 +++++++++++++++++------------------ 4 files changed, 88 insertions(+), 90 deletions(-) diff --git a/gui/collection.c b/gui/collection.c index b3eb9596..a6ed67a7 100644 --- a/gui/collection.c +++ b/gui/collection.c @@ -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); diff --git a/gui/playlist.c b/gui/playlist.c index 7c30203e..a9443a51 100644 --- a/gui/playlist.c +++ b/gui/playlist.c @@ -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())); diff --git a/gui/sidebar.c b/gui/sidebar.c index 8b77801a..9b86ee23 100644 --- a/gui/sidebar.c +++ b/gui/sidebar.c @@ -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); diff --git a/share/ocarina/ocarina6.glade b/share/ocarina/ocarina6.glade index 4117c0d4..da75c2d3 100644 --- a/share/ocarina/ocarina6.glade +++ b/share/ocarina/ocarina6.glade @@ -338,8 +338,8 @@ media-skip-backward - + False @@ -373,8 +373,8 @@ 5 - + False @@ -407,8 +407,8 @@ 5 - + False @@ -441,8 +441,8 @@ media-skip-forward - + False @@ -843,57 +843,87 @@ 1 vertical - + True False - 5 + over-up-down - + True - True - center - edit-find-symbolic - False - False - Type here to filter - + False + vertical + 5 + + + True + False + 5 + + + True + True + center + edit-find-symbolic + False + False + Type here to filter + + + + True + True + 0 + + + + + True + True + center + True + + + + False + True + 1 + + + + + False + True + 0 + + + + + True + True + left + False + False + True + True + + + + + + + + + True + True + 1 + + - True - True - 0 + queues + page0 - - - True - True - center - True - - - - False - True - 1 - - - - - False - True - 0 - - - - - True - True - left - False - False - True - True True @@ -919,7 +949,7 @@ True False - 0.96999999999999997 + 0.96862745098039216 center start @@ -949,45 +979,9 @@ - False - - - - - True - False - 5 - - - True - False - system-file-manager - 1 - - - False - True - 0 - - - - - True - False - 1 - Collection -Manager - center - - - True - True - 1 - - - - - False + chooser + page1 + 1 @@ -1100,7 +1094,7 @@ Manager False True - 2 + 3