gui: Queue tabs now have a search bar

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
This commit is contained in:
Anna Schumaker 2014-02-23 20:26:12 -05:00 committed by Anna Schumaker
parent 83a2908eb6
commit 34de6874ff
2 changed files with 60 additions and 64 deletions

View File

@ -10,21 +10,28 @@
class QueueTab : public Tab {
private:
/**
* Queue tab variables
* Queue tab widgets
*/
Gtk::HBox q_tab_box;
Gtk::Label q_tab_number;
Gtk::Label q_tab_size;
Gtk::Button q_tab_close;
Gtk::Image q_tab_close_img;
/**
* Queue page variables
* Queue page widgets
*/
Gtk::ToggleButton q_random;
Gtk::VBox q_vbox;
/* Toolbar widgets */
Gtk::HBox q_toolbar_box;
Gtk::SearchEntry q_search;
Gtk::TreeView q_treeview;
Gtk::VBox q_vbox;
Gtk::ToggleButton q_random;
Gtk::ToggleButton q_repeat;
/* Treeview widgets */
Gtk::ScrolledWindow q_window;
Gtk::TreeView q_treeview;
public:
QueueTab(Playqueue *, unsigned int num);
@ -54,16 +61,18 @@ QueueTab :: QueueTab(Playqueue *pq, unsigned int num)
/*
* Create our tab widget
*/
q_tab_close_img.set_from_icon_name("window-close", Gtk::ICON_SIZE_MENU);
q_tab_close.set_image(q_tab_close_img);
q_tab_close.set_relief(Gtk::RELIEF_NONE);
q_tab_close.signal_clicked().connect(sigc::mem_fun(*this,
&QueueTab::on_close_clicked));
q_tab_number.set_alignment(0, 0.5);
q_tab_size.set_justify(Gtk::JUSTIFY_CENTER);
q_tab_box.pack_start(q_tab_number, false, false);
q_tab_close.set_image_from_icon_name("window-close", Gtk::ICON_SIZE_MENU);
q_tab_close.set_relief(Gtk::RELIEF_NONE);
q_tab_close.set_alignment(1, 0.5);
q_tab_close.signal_clicked().connect(sigc::mem_fun(*this,
&QueueTab::on_close_clicked));
q_tab_box.pack_start(q_tab_number, false, true);
q_tab_box.pack_start(q_tab_size, true, true);
q_tab_box.pack_start(q_tab_close, false, false);
q_tab_box.pack_start(q_tab_close, false, true);
tab_set_size();
queue_set_number(num);
@ -71,7 +80,44 @@ QueueTab :: QueueTab(Playqueue *pq, unsigned int num)
/*
* Finish generic init
* Now set up the toolbar
*/
q_repeat.set_image_from_icon_name("media-playlist-repeat", Gtk::ICON_SIZE_BUTTON);
q_random.set_image_from_icon_name("media-playlist-shuffle", Gtk::ICON_SIZE_BUTTON);
q_toolbar_box.set_margin_left(5);
q_toolbar_box.set_margin_right(5);
q_toolbar_box.set_spacing(5);
q_toolbar_box.set_homogeneous(false);
q_toolbar_box.pack_start(q_search, true, true);
q_toolbar_box.pack_start(q_repeat, false, true);
q_toolbar_box.pack_start(q_random, false, true);
/*
* And the treeview with scrolled window
*/
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);
/*
* Fill in the page!
*/
q_vbox.set_margin_left(1);
q_vbox.set_margin_right(1);
q_vbox.set_homogeneous(false);
q_vbox.pack_start(q_toolbar_box, false, true, 2);
q_vbox.pack_start(q_window, true, true);
/*
* Set generic tab widgets
*/
tab_random = &q_random;

View File

@ -498,56 +498,6 @@ public:
void on_focus_search();
};
void OcarinaPage::setup_common(Playqueue *pq, unsigned int pg)
{
get_builder()->get_widget("o_notebook", notebook);
model = Glib::RefPtr<PlayqueueModel>(new PlayqueueModel(pq));
filter = Gtk::TreeModelFilter::create(model);
filter->set_visible_func(sigc::mem_fun(*this,
&OcarinaPage::on_filter_visible));
set_margin_left(1);
set_margin_right(1);
set_spacing(1);
setup_treeview();
pack_start(page_viewbox);
show_all();
*/
/* Add to notebook */
/* notebook->insert_page(*this, *tab, pg);
tab_map[pq] = this;
set_tab_size();
}
void OcarinaPage::setup_toolbar()
{
page_toolbar.set_spacing(5);
page_toolbar.pack_start(page_entry);
page_toolbar.set_margin_left(5);
page_toolbar.set_margin_right(5);
*/
/* Set up entry */
/* page_entry.set_margin_top(5);
page_entry.set_margin_bottom(5);
page_entry.signal_changed().connect(sigc::mem_fun(*this,
&OcarinaPage::on_entry_changed));
page_entry.signal_key_release_event().connect(sigc::mem_fun(*this,
&OcarinaPage::on_entry_key_released));
*/
/* Make buttons */
/* if (init_flags & PQ_RANDOM) {
page_random.set_image_from_icon_name("media-playlist-shuffle");
page_toolbar.pack_start(page_random, false, false);
}
if (init_flags & PQ_REPEAT) {
page_repeat.set_image_from_icon_name("media-playlist-repeat");
page_toolbar.pack_start(page_repeat, false, false);
}
pack_start(page_toolbar, false, false);
}
void OcarinaPage::setup_treeview()
{*/
/* Make page content */