Merge branch 'gui' of git://git.lumiera.org/LUMIERA into doxygen_fixes
This commit is contained in:
commit
4184dcf253
11 changed files with 261 additions and 202 deletions
|
|
@ -21,27 +21,38 @@
|
||||||
* *****************************************************/
|
* *****************************************************/
|
||||||
|
|
||||||
#include "panel.hpp"
|
#include "panel.hpp"
|
||||||
|
#include "../gtk-lumiera.hpp"
|
||||||
|
|
||||||
namespace lumiera {
|
namespace lumiera {
|
||||||
namespace gui {
|
namespace gui {
|
||||||
namespace panels {
|
namespace panels {
|
||||||
|
|
||||||
Panel::Panel(const gchar *name, const gchar *long_name, GdlDockItemBehavior behavior)
|
Panel::Panel(const gchar *name, const gchar *long_name,
|
||||||
|
GdlDockItemBehavior behavior)
|
||||||
{
|
{
|
||||||
dock_item = (GdlDockItem*)gdl_dock_item_new (name, long_name, behavior);
|
dock_item = (GdlDockItem*)gdl_dock_item_new (
|
||||||
|
name, long_name, behavior);
|
||||||
internal_setup();
|
internal_setup();
|
||||||
|
|
||||||
|
ENSURE(dock_item != NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
Panel::Panel(const gchar *name, const gchar *long_name, const gchar *stock_id,
|
Panel::Panel(const gchar *name, const gchar *long_name, const gchar *stock_id,
|
||||||
GdlDockItemBehavior behavior)
|
GdlDockItemBehavior behavior)
|
||||||
{
|
{
|
||||||
dock_item = (GdlDockItem*)gdl_dock_item_new_with_stock (name, long_name, stock_id, behavior);
|
dock_item = (GdlDockItem*)gdl_dock_item_new_with_stock (
|
||||||
|
name, long_name, stock_id, behavior);
|
||||||
|
g_object_ref(dock_item);
|
||||||
internal_setup();
|
internal_setup();
|
||||||
|
|
||||||
|
ENSURE(dock_item != NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
Panel::~Panel()
|
Panel::~Panel()
|
||||||
{
|
{
|
||||||
#warning Im not sure that dock_item is freed - is it self deleting?
|
REQUIRE(dock_item != NULL);
|
||||||
|
g_object_unref(dock_item);
|
||||||
|
dock_item = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
GdlDockItem*
|
GdlDockItem*
|
||||||
|
|
@ -53,6 +64,7 @@ Panel::get_dock_item() const
|
||||||
void
|
void
|
||||||
Panel::show(bool show)
|
Panel::show(bool show)
|
||||||
{
|
{
|
||||||
|
REQUIRE(dock_item != NULL);
|
||||||
if(show) gdl_dock_item_show_item (dock_item);
|
if(show) gdl_dock_item_show_item (dock_item);
|
||||||
else gdl_dock_item_hide_item (dock_item);
|
else gdl_dock_item_hide_item (dock_item);
|
||||||
}
|
}
|
||||||
|
|
@ -60,12 +72,17 @@ Panel::show(bool show)
|
||||||
bool
|
bool
|
||||||
Panel::is_shown() const
|
Panel::is_shown() const
|
||||||
{
|
{
|
||||||
|
REQUIRE(dock_item != NULL);
|
||||||
return GTK_WIDGET_VISIBLE((GtkWidget*)dock_item);
|
return GTK_WIDGET_VISIBLE((GtkWidget*)dock_item);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Panel::internal_setup()
|
Panel::internal_setup()
|
||||||
{
|
{
|
||||||
|
REQUIRE(dock_item != NULL);
|
||||||
|
REQUIRE(gobj() != NULL);
|
||||||
|
|
||||||
|
gdl_dock_item_hide_grip(dock_item);
|
||||||
gtk_container_add ((GtkContainer*)dock_item, (GtkWidget*)gobj());
|
gtk_container_add ((GtkContainer*)dock_item, (GtkWidget*)gobj());
|
||||||
gtk_widget_show ((GtkWidget*)dock_item);
|
gtk_widget_show ((GtkWidget*)dock_item);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,8 +30,17 @@ namespace gui {
|
||||||
namespace panels {
|
namespace panels {
|
||||||
|
|
||||||
TimelinePanel::TimelinePanel() :
|
TimelinePanel::TimelinePanel() :
|
||||||
Panel("timeline", _("Timeline"), "timeline_panel")
|
Panel("timeline", _("Timeline"), "timeline_panel"),
|
||||||
|
button(Stock::OK)
|
||||||
{
|
{
|
||||||
|
// Setup the toolbar
|
||||||
|
toolbar.append(button);
|
||||||
|
|
||||||
|
toolbar.set_icon_size(IconSize(ICON_SIZE_MENU));
|
||||||
|
toolbar.set_toolbar_style(TOOLBAR_ICONS);
|
||||||
|
|
||||||
|
// Add the toolbar
|
||||||
|
pack_start(toolbar, PACK_SHRINK);
|
||||||
pack_start(timeline_widget, PACK_EXPAND_WIDGET);
|
pack_start(timeline_widget, PACK_EXPAND_WIDGET);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,13 @@ namespace panels {
|
||||||
TimelinePanel();
|
TimelinePanel();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
// Widgets
|
||||||
|
Gtk::Toolbar toolbar;
|
||||||
TimelineWidget timeline_widget;
|
TimelineWidget timeline_widget;
|
||||||
|
|
||||||
|
// Toolbar Widgets
|
||||||
|
Gtk::ToolButton button;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace panels
|
} // namespace panels
|
||||||
|
|
|
||||||
|
|
@ -210,7 +210,7 @@ TimelineWidget::zoom_view(int point, int zoom_size)
|
||||||
void
|
void
|
||||||
TimelineWidget::on_mouse_move_in_body(int x, int y)
|
TimelineWidget::on_mouse_move_in_body(int x, int y)
|
||||||
{
|
{
|
||||||
ruler.set_mouse_chevron_time(x * timeScale + timeOffset);
|
ruler.set_mouse_chevron_offset(x);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace widgets
|
} // namespace widgets
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ TimelineBody::on_realize()
|
||||||
Widget::on_realize();
|
Widget::on_realize();
|
||||||
|
|
||||||
// We wish to receive all event notifications
|
// We wish to receive all event notifications
|
||||||
add_events(Gdk::POINTER_MOTION_MASK);
|
add_events(Gdk::POINTER_MOTION_MASK | Gdk::SCROLL_MASK);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -140,7 +140,7 @@ TimelineBody::on_expose_event(GdkEventExpose* event)
|
||||||
|
|
||||||
// Prepare to render via cairo
|
// Prepare to render via cairo
|
||||||
Glib::RefPtr<Style> style = get_style();
|
Glib::RefPtr<Style> style = get_style();
|
||||||
Gtk::Allocation allocation = get_allocation();
|
const Allocation allocation = get_allocation();
|
||||||
Cairo::RefPtr<Cairo::Context> cairo = window->create_cairo_context();
|
Cairo::RefPtr<Cairo::Context> cairo = window->create_cairo_context();
|
||||||
|
|
||||||
REQUIRE(style);
|
REQUIRE(style);
|
||||||
|
|
|
||||||
|
|
@ -43,16 +43,15 @@ namespace timeline {
|
||||||
|
|
||||||
TimelineRuler::TimelineRuler() :
|
TimelineRuler::TimelineRuler() :
|
||||||
Glib::ObjectBase("TimelineRuler"),
|
Glib::ObjectBase("TimelineRuler"),
|
||||||
timeOffset(0),
|
timeOffset(-1),
|
||||||
timeScale(1),
|
timeScale(1),
|
||||||
mouseChevronTime(0),
|
mouseChevronOffset(0),
|
||||||
annotationHorzMargin(0),
|
annotationHorzMargin(0),
|
||||||
annotationVertMargin(0),
|
annotationVertMargin(0),
|
||||||
majorTickHeight(0),
|
majorTickHeight(0),
|
||||||
minorLongTickHeight(0),
|
minorLongTickHeight(0),
|
||||||
minorShortTickHeight(0),
|
minorShortTickHeight(0),
|
||||||
minDivisionWidth(100),
|
minDivisionWidth(100)
|
||||||
mouseChevronSize(0)
|
|
||||||
{
|
{
|
||||||
// Install style properties
|
// Install style properties
|
||||||
register_styles();
|
register_styles();
|
||||||
|
|
@ -76,9 +75,9 @@ TimelineRuler::set_time_scale(int64_t time_scale)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
TimelineRuler::set_mouse_chevron_time(gavl_time_t time)
|
TimelineRuler::set_mouse_chevron_offset(int offset)
|
||||||
{
|
{
|
||||||
mouseChevronTime = time;
|
mouseChevronOffset = offset;
|
||||||
queue_draw();
|
queue_draw();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -88,7 +87,7 @@ TimelineRuler::on_realize()
|
||||||
Widget::on_realize();
|
Widget::on_realize();
|
||||||
|
|
||||||
// Set event notifications
|
// Set event notifications
|
||||||
add_events(Gdk::POINTER_MOTION_MASK);
|
add_events(Gdk::POINTER_MOTION_MASK | Gdk::SCROLL_MASK);
|
||||||
|
|
||||||
// Load styles
|
// Load styles
|
||||||
read_styles();
|
read_styles();
|
||||||
|
|
@ -144,7 +143,7 @@ TimelineRuler::on_motion_notify_event(GdkEventMotion *event)
|
||||||
{
|
{
|
||||||
REQUIRE(event != NULL);
|
REQUIRE(event != NULL);
|
||||||
|
|
||||||
set_mouse_chevron_time(event->x * timeScale + timeOffset);
|
set_mouse_chevron_offset(event->x);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -248,16 +247,20 @@ TimelineRuler::draw_mouse_chevron(Cairo::RefPtr<Cairo::Context> cairo,
|
||||||
REQUIRE(ruler_rect.get_width() > 0);
|
REQUIRE(ruler_rect.get_width() > 0);
|
||||||
REQUIRE(ruler_rect.get_height() > 0);
|
REQUIRE(ruler_rect.get_height() > 0);
|
||||||
|
|
||||||
|
// Is the mouse chevron in view?
|
||||||
|
if(mouseChevronOffset < 0 ||
|
||||||
|
mouseChevronOffset >= ruler_rect.get_width())
|
||||||
|
return;
|
||||||
|
|
||||||
// Set the source colour
|
// Set the source colour
|
||||||
Glib::RefPtr<Style> style = get_style();
|
Glib::RefPtr<Style> style = get_style();
|
||||||
Gdk::Cairo::set_source_color(cairo, style->get_fg(STATE_NORMAL));
|
Gdk::Cairo::set_source_color(cairo, style->get_fg(STATE_NORMAL));
|
||||||
|
|
||||||
const int x = (mouseChevronTime - timeOffset) / timeScale;
|
cairo->move_to(mouseChevronOffset + 0.5,
|
||||||
cairo->move_to(x + 0.5,
|
|
||||||
ruler_rect.get_height());
|
ruler_rect.get_height());
|
||||||
cairo->line_to(x + mouseChevronSize + 0.5,
|
cairo->line_to(mouseChevronOffset + mouseChevronSize + 0.5,
|
||||||
ruler_rect.get_height() - mouseChevronSize);
|
ruler_rect.get_height() - mouseChevronSize);
|
||||||
cairo->line_to(x - mouseChevronSize + 0.5,
|
cairo->line_to(mouseChevronOffset - mouseChevronSize + 0.5,
|
||||||
ruler_rect.get_height() - mouseChevronSize);
|
ruler_rect.get_height() - mouseChevronSize);
|
||||||
|
|
||||||
cairo->fill();
|
cairo->fill();
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,12 @@ public:
|
||||||
*/
|
*/
|
||||||
void set_time_scale(int64_t time_scale);
|
void set_time_scale(int64_t time_scale);
|
||||||
|
|
||||||
void set_mouse_chevron_time(gavl_time_t time);
|
/**
|
||||||
|
* Sets the offset of the mouse chevron in pixels from the left
|
||||||
|
* edge of the widget. If offset is less than 0 or greater than the
|
||||||
|
* width, the chevron will not be visible.
|
||||||
|
*/
|
||||||
|
void set_mouse_chevron_offset(int offset);
|
||||||
|
|
||||||
/* ===== Events ===== */
|
/* ===== Events ===== */
|
||||||
protected:
|
protected:
|
||||||
|
|
@ -86,7 +91,9 @@ private:
|
||||||
// View values
|
// View values
|
||||||
gavl_time_t timeOffset;
|
gavl_time_t timeOffset;
|
||||||
int64_t timeScale;
|
int64_t timeScale;
|
||||||
int mouseChevronTime;
|
|
||||||
|
// Indicated values
|
||||||
|
int mouseChevronOffset;
|
||||||
|
|
||||||
// Style values
|
// Style values
|
||||||
int annotationHorzMargin;
|
int annotationHorzMargin;
|
||||||
|
|
|
||||||
|
|
@ -28,17 +28,22 @@
|
||||||
|
|
||||||
using namespace Gtk;
|
using namespace Gtk;
|
||||||
using namespace Glib;
|
using namespace Glib;
|
||||||
|
using namespace sigc;
|
||||||
using namespace lumiera::gui;
|
using namespace lumiera::gui;
|
||||||
|
|
||||||
namespace lumiera {
|
namespace lumiera {
|
||||||
namespace gui {
|
namespace gui {
|
||||||
namespace workspace {
|
namespace workspace {
|
||||||
|
|
||||||
Actions::Actions(WorkspaceWindow &workspace_window) :
|
Actions::Actions(WorkspaceWindow &workspace_window) :
|
||||||
workspaceWindow(workspace_window)
|
workspaceWindow(workspace_window),
|
||||||
{
|
is_updating_action_state(false)
|
||||||
|
{
|
||||||
register_stock_items();
|
register_stock_items();
|
||||||
|
|
||||||
|
workspace_window.signal_show ().connect_notify(mem_fun(this, &Actions::update_action_state));
|
||||||
|
|
||||||
|
//----- Create the Action Group -----//
|
||||||
actionGroup = ActionGroup::create();
|
actionGroup = ActionGroup::create();
|
||||||
|
|
||||||
// File menu
|
// File menu
|
||||||
|
|
@ -84,26 +89,23 @@ namespace workspace {
|
||||||
actionGroup->add(Action::create("HelpMenu", _("_Help")) );
|
actionGroup->add(Action::create("HelpMenu", _("_Help")) );
|
||||||
actionGroup->add(Action::create("HelpAbout", Stock::ABOUT),
|
actionGroup->add(Action::create("HelpAbout", Stock::ABOUT),
|
||||||
sigc::mem_fun(*this, &Actions::on_menu_help_about) );
|
sigc::mem_fun(*this, &Actions::on_menu_help_about) );
|
||||||
|
}
|
||||||
|
|
||||||
// Refresh the UI state
|
void
|
||||||
update_action_state();
|
Actions::register_stock_items()
|
||||||
}
|
{
|
||||||
|
|
||||||
void
|
|
||||||
Actions::register_stock_items()
|
|
||||||
{
|
|
||||||
RefPtr<IconFactory> factory = IconFactory::create();
|
RefPtr<IconFactory> factory = IconFactory::create();
|
||||||
add_stock_item(factory, "assets-panel.png", "assets_panel", _("_Assets"));
|
add_stock_item(factory, "assets-panel.png", "assets_panel", _("_Assets"));
|
||||||
add_stock_item(factory, "timeline-panel.png", "timeline_panel", _("_Timeline"));
|
add_stock_item(factory, "timeline-panel.png", "timeline_panel", _("_Timeline"));
|
||||||
add_stock_item(factory, "viewer-panel.png", "viewer_panel", _("_Viewer"));
|
add_stock_item(factory, "viewer-panel.png", "viewer_panel", _("_Viewer"));
|
||||||
factory->add_default(); //Add factory to list of factories.
|
factory->add_default(); //Add factory to list of factories.
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Actions::add_stock_item(const Glib::RefPtr<IconFactory>& factory,
|
Actions::add_stock_item(const Glib::RefPtr<IconFactory>& factory,
|
||||||
const Glib::ustring& filepath,
|
const Glib::ustring& filepath,
|
||||||
const Glib::ustring& id, const Glib::ustring& label)
|
const Glib::ustring& id, const Glib::ustring& label)
|
||||||
{
|
{
|
||||||
Gtk::IconSource source;
|
Gtk::IconSource source;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
@ -124,78 +126,84 @@ namespace workspace {
|
||||||
const Gtk::StockID stock_id(id);
|
const Gtk::StockID stock_id(id);
|
||||||
factory->add(stock_id, icon_set);
|
factory->add(stock_id, icon_set);
|
||||||
Gtk::Stock::add(Gtk::StockItem(stock_id, label));
|
Gtk::Stock::add(Gtk::StockItem(stock_id, label));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Actions::update_action_state()
|
Actions::update_action_state()
|
||||||
{
|
{
|
||||||
assetsPanelAction->set_active(workspaceWindow.assets_panel.is_shown());
|
REQUIRE(workspaceWindow.assets_panel);
|
||||||
timelinePanelAction->set_active(workspaceWindow.timeline_panel.is_shown());
|
REQUIRE(workspaceWindow.timeline_panel);
|
||||||
viewerPanelAction->set_active(workspaceWindow.viewer_panel.is_shown());
|
REQUIRE(workspaceWindow.viewer_panel);
|
||||||
}
|
|
||||||
|
|
||||||
/* ===== File Menu Event Handlers ===== */
|
is_updating_action_state = true;
|
||||||
|
assetsPanelAction->set_active(workspaceWindow.assets_panel->is_shown());
|
||||||
|
timelinePanelAction->set_active(workspaceWindow.timeline_panel->is_shown());
|
||||||
|
viewerPanelAction->set_active(workspaceWindow.viewer_panel->is_shown());
|
||||||
|
is_updating_action_state = false;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
/* ===== File Menu Event Handlers ===== */
|
||||||
Actions::on_menu_file_new_project()
|
|
||||||
{
|
void
|
||||||
|
Actions::on_menu_file_new_project()
|
||||||
|
{
|
||||||
g_message("A File|New menu item was selecteda.");
|
g_message("A File|New menu item was selecteda.");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Actions::on_menu_file_open_project()
|
Actions::on_menu_file_open_project()
|
||||||
{
|
{
|
||||||
g_message("A File|Open menu item was selecteda.");
|
g_message("A File|Open menu item was selecteda.");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Actions::on_menu_file_render()
|
Actions::on_menu_file_render()
|
||||||
{
|
{
|
||||||
dialogs::Render dialog(workspaceWindow);
|
dialogs::Render dialog(workspaceWindow);
|
||||||
dialog.run();
|
dialog.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Actions::on_menu_file_quit()
|
Actions::on_menu_file_quit()
|
||||||
{
|
{
|
||||||
workspaceWindow.hide(); // Closes the main window to stop the Gtk::Main::run().
|
workspaceWindow.hide(); // Closes the main window to stop the Gtk::Main::run().
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ===== Edit Menu Event Handlers ===== */
|
/* ===== Edit Menu Event Handlers ===== */
|
||||||
|
|
||||||
void
|
void
|
||||||
Actions::on_menu_edit_preferences()
|
Actions::on_menu_edit_preferences()
|
||||||
{
|
{
|
||||||
dialogs::PreferencesDialog dialog(workspaceWindow);
|
dialogs::PreferencesDialog dialog(workspaceWindow);
|
||||||
dialog.run();
|
dialog.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ===== View Menu Event Handlers ===== */
|
/* ===== View Menu Event Handlers ===== */
|
||||||
|
|
||||||
void
|
void
|
||||||
Actions::on_menu_view_assets()
|
Actions::on_menu_view_assets()
|
||||||
{
|
{
|
||||||
workspaceWindow.assets_panel.show(!workspaceWindow.assets_panel.is_shown());
|
if(!is_updating_action_state)
|
||||||
update_action_state();
|
workspaceWindow.assets_panel->show(assetsPanelAction->get_active());
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Actions::on_menu_view_timeline()
|
Actions::on_menu_view_timeline()
|
||||||
{
|
{
|
||||||
workspaceWindow.timeline_panel.show(!workspaceWindow.timeline_panel.is_shown());
|
if(!is_updating_action_state)
|
||||||
update_action_state();
|
workspaceWindow.timeline_panel->show(timelinePanelAction->get_active());
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Actions::on_menu_view_viewer()
|
Actions::on_menu_view_viewer()
|
||||||
{
|
{
|
||||||
workspaceWindow.viewer_panel.show(!workspaceWindow.viewer_panel.is_shown());
|
if(!is_updating_action_state)
|
||||||
update_action_state();
|
workspaceWindow.viewer_panel->show(viewerPanelAction->get_active());
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Actions::on_menu_help_about()
|
Actions::on_menu_help_about()
|
||||||
{
|
{
|
||||||
// Configure the about dialog
|
// Configure the about dialog
|
||||||
AboutDialog dialog;
|
AboutDialog dialog;
|
||||||
|
|
||||||
|
|
@ -212,16 +220,16 @@ namespace workspace {
|
||||||
|
|
||||||
// Show the about dialog
|
// Show the about dialog
|
||||||
dialog.run();
|
dialog.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//----- Temporary junk
|
//----- Temporary junk
|
||||||
void
|
void
|
||||||
Actions::on_menu_others()
|
Actions::on_menu_others()
|
||||||
{
|
{
|
||||||
g_message("A menu item was selected.");
|
g_message("A menu item was selected.");
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace workspace
|
} // namespace workspace
|
||||||
} // namespace gui
|
} // namespace gui
|
||||||
|
|
|
||||||
|
|
@ -94,6 +94,10 @@ class WorkspaceWindow;
|
||||||
Glib::RefPtr<Gtk::ToggleAction> timelinePanelAction;
|
Glib::RefPtr<Gtk::ToggleAction> timelinePanelAction;
|
||||||
Glib::RefPtr<Gtk::ToggleAction> viewerPanelAction;
|
Glib::RefPtr<Gtk::ToggleAction> viewerPanelAction;
|
||||||
|
|
||||||
|
/* ===== Internals ===== */
|
||||||
|
private:
|
||||||
|
bool is_updating_action_state;
|
||||||
|
|
||||||
friend class WorkspaceWindow;
|
friend class WorkspaceWindow;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -128,7 +128,12 @@ WorkspaceWindow::create_ui()
|
||||||
toolbar->set_toolbar_style(TOOLBAR_ICONS);
|
toolbar->set_toolbar_style(TOOLBAR_ICONS);
|
||||||
base_container.pack_start(*toolbar, Gtk::PACK_SHRINK);
|
base_container.pack_start(*toolbar, Gtk::PACK_SHRINK);
|
||||||
|
|
||||||
//----- Create the dock -----//
|
//----- Create the Panels -----//
|
||||||
|
assets_panel = Glib::RefPtr<AssetsPanel>(new AssetsPanel());
|
||||||
|
viewer_panel = Glib::RefPtr<ViewerPanel>(new ViewerPanel());
|
||||||
|
timeline_panel = Glib::RefPtr<TimelinePanel>(new TimelinePanel());
|
||||||
|
|
||||||
|
//----- Create the Dock -----//
|
||||||
dock = Glib::wrap(gdl_dock_new());
|
dock = Glib::wrap(gdl_dock_new());
|
||||||
|
|
||||||
layout = gdl_dock_layout_new((GdlDock*)dock->gobj());
|
layout = gdl_dock_layout_new((GdlDock*)dock->gobj());
|
||||||
|
|
@ -139,15 +144,15 @@ WorkspaceWindow::create_ui()
|
||||||
dock_container.pack_end(*dock, PACK_EXPAND_WIDGET);
|
dock_container.pack_end(*dock, PACK_EXPAND_WIDGET);
|
||||||
base_container.pack_start(dock_container, PACK_EXPAND_WIDGET);
|
base_container.pack_start(dock_container, PACK_EXPAND_WIDGET);
|
||||||
|
|
||||||
gdl_dock_add_item ((GdlDock*)dock->gobj(), assets_panel.get_dock_item(), GDL_DOCK_LEFT);
|
gdl_dock_add_item ((GdlDock*)dock->gobj(), assets_panel->get_dock_item(), GDL_DOCK_LEFT);
|
||||||
gdl_dock_add_item ((GdlDock*)dock->gobj(), viewer_panel.get_dock_item(), GDL_DOCK_RIGHT);
|
gdl_dock_add_item ((GdlDock*)dock->gobj(), viewer_panel->get_dock_item(), GDL_DOCK_RIGHT);
|
||||||
gdl_dock_add_item ((GdlDock*)dock->gobj(), timeline_panel.get_dock_item(), GDL_DOCK_BOTTOM);
|
gdl_dock_add_item ((GdlDock*)dock->gobj(), timeline_panel->get_dock_item(), GDL_DOCK_BOTTOM);
|
||||||
|
|
||||||
// Manually dock and move around some of the items
|
// Manually dock and move around some of the items
|
||||||
gdl_dock_item_dock_to (timeline_panel.get_dock_item(), assets_panel.get_dock_item(),
|
gdl_dock_item_dock_to (timeline_panel->get_dock_item(),
|
||||||
GDL_DOCK_BOTTOM, -1);
|
assets_panel->get_dock_item(), GDL_DOCK_BOTTOM, -1);
|
||||||
gdl_dock_item_dock_to (viewer_panel.get_dock_item(), assets_panel.get_dock_item(),
|
gdl_dock_item_dock_to (viewer_panel->get_dock_item(),
|
||||||
GDL_DOCK_RIGHT, -1);
|
assets_panel->get_dock_item(), GDL_DOCK_RIGHT, -1);
|
||||||
|
|
||||||
show_all_children();
|
show_all_children();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -77,9 +77,9 @@ namespace workspace {
|
||||||
|
|
||||||
/* ===== Panels ===== */
|
/* ===== Panels ===== */
|
||||||
private:
|
private:
|
||||||
AssetsPanel assets_panel;
|
Glib::RefPtr<AssetsPanel> assets_panel;
|
||||||
ViewerPanel viewer_panel;
|
Glib::RefPtr<ViewerPanel> viewer_panel;
|
||||||
TimelinePanel timeline_panel;
|
Glib::RefPtr<TimelinePanel> timeline_panel;
|
||||||
|
|
||||||
/* ===== Helpers ===== */
|
/* ===== Helpers ===== */
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue