WIP: Experimenting with track headers
This commit is contained in:
parent
c536915b2e
commit
125db978ba
2 changed files with 32 additions and 8 deletions
|
|
@ -29,6 +29,7 @@
|
||||||
|
|
||||||
using namespace boost;
|
using namespace boost;
|
||||||
using namespace Gtk;
|
using namespace Gtk;
|
||||||
|
using namespace sigc;
|
||||||
|
|
||||||
namespace gui {
|
namespace gui {
|
||||||
namespace widgets {
|
namespace widgets {
|
||||||
|
|
@ -37,9 +38,14 @@ namespace timeline {
|
||||||
Track::Track(TimelineWidget &timeline_widget) :
|
Track::Track(TimelineWidget &timeline_widget) :
|
||||||
timelineWidget(timeline_widget),
|
timelineWidget(timeline_widget),
|
||||||
expanded(true),
|
expanded(true),
|
||||||
|
titleMenuButton("4HelloHelloHello"),
|
||||||
enableButton(Gtk::StockID("track_enabled")),
|
enableButton(Gtk::StockID("track_enabled")),
|
||||||
lockButton(Gtk::StockID("track_unlocked"))
|
lockButton(Gtk::StockID("track_unlocked"))
|
||||||
{
|
{
|
||||||
|
titleMenuButton.set_relief(RELIEF_HALF);
|
||||||
|
titleMenuButton.signal_pressed().connect(
|
||||||
|
mem_fun(this, &Track::on_title_menu_button) );
|
||||||
|
|
||||||
buttonBar.append(enableButton);
|
buttonBar.append(enableButton);
|
||||||
buttonBar.append(lockButton);
|
buttonBar.append(lockButton);
|
||||||
|
|
||||||
|
|
@ -55,16 +61,20 @@ Track::Track(TimelineWidget &timeline_widget) :
|
||||||
(GtkIconSize)(int)WindowManager::MenuIconSize);
|
(GtkIconSize)(int)WindowManager::MenuIconSize);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
headerWidget.pack_start(titleBox, PACK_SHRINK);
|
headerWidget.pack_start(titleMenuButton, PACK_SHRINK);
|
||||||
headerWidget.pack_start(buttonBar, PACK_SHRINK);
|
headerWidget.pack_start(buttonBar, PACK_SHRINK);
|
||||||
|
|
||||||
|
// Setup the title menu
|
||||||
|
Menu::MenuList& title_list = titleMenu.items();
|
||||||
|
title_list.push_back( Menu_Helpers::MenuElem(_("_Name..."),
|
||||||
|
mem_fun(this, &Track::on_remove_track) ) );
|
||||||
|
|
||||||
// Setup the context menu
|
// Setup the context menu
|
||||||
Menu::MenuList& menu_list = contextMenu.items();
|
Menu::MenuList& context_list = contextMenu.items();
|
||||||
menu_list.push_back( Menu_Helpers::MenuElem(_("_Add Track"),
|
context_list.push_back( Menu_Helpers::MenuElem(_("_Add Track"),
|
||||||
sigc::mem_fun(timelineWidget,
|
mem_fun(timelineWidget, &TimelineWidget::on_add_track_command) ) );
|
||||||
&TimelineWidget::on_add_track_command) ) );
|
context_list.push_back( Menu_Helpers::MenuElem(_("_Remove Track"),
|
||||||
menu_list.push_back( Menu_Helpers::MenuElem(_("_Remove Track"),
|
mem_fun(this, &Track::on_remove_track) ) );
|
||||||
sigc::mem_fun(this, &Track::on_remove_track) ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Gtk::Widget&
|
Gtk::Widget&
|
||||||
|
|
@ -97,6 +107,13 @@ Track::show_header_context_menu(guint button, guint32 time)
|
||||||
contextMenu.popup(button, time);
|
contextMenu.popup(button, time);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Track::on_title_menu_button()
|
||||||
|
{
|
||||||
|
g_message("Hello");
|
||||||
|
titleMenu.popup(0, gtk_get_current_event_time());
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Track::on_remove_track()
|
Track::on_remove_track()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,9 @@ public:
|
||||||
const = 0;
|
const = 0;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
void on_title_menu_button();
|
||||||
|
|
||||||
void on_remove_track();
|
void on_remove_track();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
@ -68,12 +71,16 @@ private:
|
||||||
|
|
||||||
Gtk::VBox headerWidget;
|
Gtk::VBox headerWidget;
|
||||||
|
|
||||||
|
Gtk::Button titleMenuButton;
|
||||||
|
|
||||||
Gtk::ToolButton enableButton;
|
Gtk::ToolButton enableButton;
|
||||||
Gtk::ToolButton lockButton;
|
Gtk::ToolButton lockButton;
|
||||||
|
|
||||||
Gtk::Entry titleBox;
|
Gtk::Entry titleBox;
|
||||||
Gtk::Toolbar buttonBar;
|
Gtk::Toolbar buttonBar;
|
||||||
|
|
||||||
|
Gtk::Menu titleMenu;
|
||||||
|
|
||||||
Gtk::Menu contextMenu;
|
Gtk::Menu contextMenu;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue