ocarina: Created footer tabs

I'm going to use a ribbon-ish interface for the footer and work the
settings pages in with the now playing widgets to make things easier to
find.  Right now, I created everything with placeholders.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
This commit is contained in:
Bryan Schumaker 2012-03-11 12:46:59 -04:00
parent 3d11ea47ba
commit 8f43bf62e4
7 changed files with 104 additions and 1 deletions

View File

@ -16,7 +16,11 @@ namespace ocarina
{
void init();
GtkWidget *playlist_init();
GtkWidget *footer_init();
GtkWidget *now_playing_page();
GtkWidget *general_page();
GtkWidget *library_page();
}
}; /* Namespace: ocarina */

View File

@ -12,7 +12,11 @@ namespace ocarina
{
content = gtk_vbox_new(FALSE, 0);
gtk_box_pack_start(GTK_BOX(content), playlist_init(), TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(content), footer_init(), FALSE, FALSE, 0);
gtk_widget_show(content);
window::set_content(content);
}
}; /* Namespace: ocarina */

32
ocarina/body/footer.cpp Normal file
View File

@ -0,0 +1,32 @@
// Copyright (c) 2012 Bryan Schumaker
#include <ocarina/ocarina.h>
#include <ocarina/body.h>
static GtkWidget *footer;
static void add_page(string text, GtkWidget *page)
{
GtkWidget *label = gtk_label_new(text.c_str());
gtk_notebook_append_page(GTK_NOTEBOOK(footer), page, label);
gtk_notebook_set_tab_label_packing(GTK_NOTEBOOK(footer),
page, TRUE, TRUE, GTK_PACK_START);
gtk_widget_show(label);
}
namespace ocarina
{
GtkWidget *body::footer_init()
{
footer = gtk_notebook_new();
gtk_notebook_set_tab_pos(GTK_NOTEBOOK(footer), GTK_POS_TOP);
add_page("Now Playing", now_playing_page());
add_page("Library Settings", library_page());
add_page("General Settings", general_page());
gtk_widget_show(footer);
return footer;
};
}; /* Namespace: ocarina */

15
ocarina/body/general.cpp Normal file
View File

@ -0,0 +1,15 @@
// Copyright (c) 2012 Bryan Schumaker
#include <ocarina/ocarina.h>
#include <ocarina/body.h>
namespace ocarina
{
GtkWidget *body::general_page()
{
GtkWidget *label = gtk_label_new("Future general settings page");
gtk_widget_show(label);
return label;
}
}; /* Namespace: ocarina */

15
ocarina/body/library.cpp Normal file
View File

@ -0,0 +1,15 @@
// Copyright (c) 2012 Bryan Schumaker
#include <ocarina/ocarina.h>
#include <ocarina/body.h>
namespace ocarina
{
GtkWidget *body::library_page()
{
GtkWidget *label = gtk_label_new("Future library page");
gtk_widget_show(label);
return label;
}
}; /* Namespace: ocarina */

View File

@ -0,0 +1,15 @@
// Copyright (c) 2012 Bryan Schumaker
#include <ocarina/ocarina.h>
#include <ocarina/body.h>
namespace ocarina
{
GtkWidget *body::now_playing_page()
{
GtkWidget *label = gtk_label_new("Future now playing page");
gtk_widget_show(label);
return label;
}
}; /* Namespace: ocarina */

18
ocarina/body/playlist.cpp Normal file
View File

@ -0,0 +1,18 @@
// Copyright (c) 2012 Bryan Schumaker
#include <ocarina/ocarina.h>
#include <ocarina/body.h>
static GtkWidget *tabs;
namespace ocarina
{
GtkWidget *body::playlist_init()
{
tabs = gtk_notebook_new();
gtk_notebook_set_tab_pos(GTK_NOTEBOOK(tabs), GTK_POS_LEFT);
gtk_widget_show(tabs);
return tabs;
};
}; /* Namespace: ocarina */