ocarina: Added bare songlist and a library tab
Eventually the songlist class will list all songs in the library. For now, I just create an empty window and add it to the main tabs.
This commit is contained in:
parent
18ebac3937
commit
3a5a41f53f
|
@ -0,0 +1,6 @@
|
|||
#ifndef OCARINA_LIBRARY_H
|
||||
#define OCARINA_LIBRARY_H
|
||||
|
||||
void library_init();
|
||||
|
||||
#endif /* OCARINA_LIBRARY_H */
|
|
@ -0,0 +1,17 @@
|
|||
|
||||
#include <ocarina/library.h>
|
||||
#include <ocarina/body.h>
|
||||
#include <ocarina/gtk.h>
|
||||
#include "songlist/songlist.h"
|
||||
|
||||
static SongList library_list;
|
||||
static GtkWidget *label;
|
||||
|
||||
void library_init()
|
||||
{
|
||||
library_list.init();
|
||||
label = gtk_label_new("Library");
|
||||
gtk_label_set_angle(GTK_LABEL(label), 90);
|
||||
gtk_widget_show(label);
|
||||
add_page(label, library_list.get_window(), true);
|
||||
}
|
|
@ -6,6 +6,7 @@
|
|||
#include <ocarina/settings.h>
|
||||
#include <ocarina/footer.h>
|
||||
#include <ocarina/window.h>
|
||||
#include <ocarina/library.h>
|
||||
|
||||
#include <libsaria/libsaria.h>
|
||||
#include <libsaria/controls.h>
|
||||
|
@ -37,6 +38,7 @@ void ocarina_init(int argc, char **argv)
|
|||
gtk_widget_show(vbox);
|
||||
window_add(vbox);
|
||||
|
||||
library_init();
|
||||
settings_init();
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
|
||||
#include <ocarina/gtk.h>
|
||||
#include "songlist.h"
|
||||
|
||||
|
||||
SongList::SongList()
|
||||
{
|
||||
}
|
||||
|
||||
SongList::~SongList()
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
* I need an init() function to set up the scrolled window AFTER
|
||||
* the gtk_init() function has been called.
|
||||
*/
|
||||
void SongList::init()
|
||||
{
|
||||
window = gtk_scrolled_window_new(NULL, NULL);
|
||||
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(window),
|
||||
GTK_POLICY_AUTOMATIC,
|
||||
GTK_POLICY_AUTOMATIC);
|
||||
gtk_widget_show(window);
|
||||
}
|
||||
|
||||
GtkWidget *SongList::get_window()
|
||||
{
|
||||
return window;
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
#ifndef OCARINA_SONGLIST_H
|
||||
#define OCARINA_SONGLIST_H
|
||||
|
||||
#include <ocarina/gtk.h>
|
||||
|
||||
class SongList
|
||||
{
|
||||
private:
|
||||
GtkWidget *window;
|
||||
|
||||
public:
|
||||
SongList();
|
||||
~SongList();
|
||||
|
||||
void init();
|
||||
GtkWidget *get_window();
|
||||
};
|
||||
|
||||
#endif /* OCARINA_SONGLIST_H */
|
Loading…
Reference in New Issue