diff --git a/gui/queue.cpp b/gui/queue.cpp index 12b1638c..67c78c1f 100644 --- a/gui/queue.cpp +++ b/gui/queue.cpp @@ -6,7 +6,7 @@ #include #include #include -#include +#include static void renumber_queues(); @@ -53,8 +53,7 @@ private: QueueToolbar *q_toolbar; /* Treeview widgets */ - Gtk::ScrolledWindow q_window; - QueueView *q_treeview; + QueueWindow *q_window; public: @@ -89,7 +88,7 @@ QueueTab :: QueueTab(Queue *pq, unsigned int num) : Tab(pq) { builder = Gtk::Builder::create(); - builder->add_from_file(gui :: share_file("QueueView.ui")); + builder->add_from_file(gui :: share_file("QueueWindow.ui")); builder->add_from_file(gui :: share_file("QueueLabel.ui")); builder->add_from_file(gui :: share_file("QueueToolbar.ui")); @@ -113,12 +112,7 @@ QueueTab :: QueueTab(Queue *pq, unsigned int num) /* * And the treeview with scrolled window */ - builder->get_widget_derived("QueueView", q_treeview); - q_window.set_shadow_type(Gtk::SHADOW_IN); - q_window.set_margin_left(5); - q_window.set_margin_right(5); - q_window.set_margin_bottom(5); - q_window.add(*q_treeview); + builder->get_widget_derived("QueueWindow", q_window); /* @@ -129,7 +123,7 @@ QueueTab :: QueueTab(Queue *pq, unsigned int num) q_vbox.set_margin_right(1); q_vbox.set_homogeneous(false); q_vbox.pack_start(*q_toolbar, false, true, 2); - q_vbox.pack_start(q_window, true, true); + q_vbox.pack_start(*q_window, true, true); /* @@ -140,7 +134,7 @@ QueueTab :: QueueTab(Queue *pq, unsigned int num) tab_repeat = q_toolbar->q_repeat; tab_search = q_toolbar->q_search; tab_size = q_label->temp_size; - tab_treeview = q_treeview; + tab_treeview = q_window->q_treeview; tab_widget = &q_vbox; tab_finish_init(); @@ -235,7 +229,7 @@ void QueueTab :: queue_set_sensitive(bool sensitive) { q_label->temp_number->set_sensitive(sensitive); q_label->temp_size->set_sensitive(sensitive); - q_treeview->set_sensitive(sensitive); + q_window->q_treeview->set_sensitive(sensitive); } diff --git a/gui/queue/view.cpp b/gui/queue/view.cpp deleted file mode 100644 index cc9d37ef..00000000 --- a/gui/queue/view.cpp +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright 2015 (c) Anna Schumaker. - */ -#include - -QueueView :: QueueView(BaseObjectType *cobject, - const Glib::RefPtr builder) - : Gtk::TreeView(cobject), _builder(builder) -{ -} - -QueueView :: ~QueueView() -{ -} diff --git a/gui/queue/window.cpp b/gui/queue/window.cpp new file mode 100644 index 00000000..dd875b4a --- /dev/null +++ b/gui/queue/window.cpp @@ -0,0 +1,15 @@ +/* + * Copyright 2015 (c) Anna Schumaker. + */ +#include + +QueueWindow :: QueueWindow(BaseObjectType *cobject, + const Glib::RefPtr builder) + : Gtk::ScrolledWindow(cobject), _builder(builder) +{ + _builder->get_widget("q_treeview", q_treeview); +} + +QueueWindow :: ~QueueWindow() +{ +} diff --git a/include/gui/queue/view.h b/include/gui/queue/view.h deleted file mode 100644 index 435994d0..00000000 --- a/include/gui/queue/view.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2015 (c) Anna Schumaker. - */ -#ifndef OCARINA_GUI_QUEUE_VIEW_H -#define OCARINA_GUI_QUEUE_VIEW_H - -#include - -class QueueView : public Gtk::TreeView { -private: - Glib::RefPtr _builder; - -public: - QueueView(BaseObjectType *, const Glib::RefPtr); - ~QueueView(); -}; - -#endif /* OCARINA_GUI_QUEUE_VIEW_H */ diff --git a/include/gui/queue/window.h b/include/gui/queue/window.h new file mode 100644 index 00000000..17d84813 --- /dev/null +++ b/include/gui/queue/window.h @@ -0,0 +1,20 @@ +/* + * Copyright 2015 (c) Anna Schumaker. + */ +#ifndef OCARINA_GUI_QUEUE_WINDOW_H +#define OCARINA_GUI_QUEUE_WINDOW_H + +#include + +class QueueWindow : public Gtk::ScrolledWindow { +private: + Glib::RefPtr _builder; + +public: + Gtk::TreeView *q_treeview; + + QueueWindow(BaseObjectType *, const Glib::RefPtr); + ~QueueWindow(); +}; + +#endif /* OCARINA_GUI_QUEUE_WINDOW_H */ diff --git a/share/ocarina/QueueWindow.ui b/share/ocarina/QueueWindow.ui new file mode 100644 index 00000000..c6d911fc --- /dev/null +++ b/share/ocarina/QueueWindow.ui @@ -0,0 +1,162 @@ + + + + + + True + True + 5 + 5 + 5 + in + + + True + True + False + True + 9 + + + multiple + + + + + True + fixed + 20 + # + True + + + + 0 + + + + + + + True + fixed + 300 + Title + True + + + + 1 + + + + + + + True + fixed + 60 + Length + True + + + + 2 + + + + + + + True + fixed + 100 + Artist + True + + + + 3 + + + + + + + True + fixed + 100 + Album + True + + + + 4 + + + + + + + True + fixed + 45 + Year + True + + + + 5 + + + + + + + True + fixed + 100 + Genre + True + + + + 6 + + + + + + + True + fixed + 60 + Count + True + + + + 7 + + + + + + + True + fixed + 1 + Played + True + + + + 8 + + + + + + + +