Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
timeline-panel.cpp
Go to the documentation of this file.
1/*
2 TimelinePanel - Dockable panel to hold the main timeline view
3
4 Copyright (C)
5 2016, Hermann Vosseler <Ichthyostega@web.de>
6
7  **Lumiera** is free software; you can redistribute it and/or modify it
8  under the terms of the GNU General Public License as published by the
9  Free Software Foundation; either version 2 of the License, or (at your
10  option) any later version. See the file COPYING for further details.
11
12* *****************************************************************/
13
14
25#include "stage/gtk-base.hpp"
29
30using std::make_unique;
31
32
33namespace stage {
34namespace panel {
35
36 using timeline::TimelinePage;
37 using timeline::TimelineWidget;
38 using timeline::TimelineWidgetEmpty;
39
40
42 Gdl::DockItem& dockItem)
43 : Panel(panelManager, dockItem, getTitle(), getStockID())
44 , tabs_{}
45 , pages_{}
46 {
48
49 // show everything....
50 this->add(tabs_);
51 this->show_all();
52 }
53
54 const char*
56 {
57 return _("Timeline");
58 }
59
60 const gchar*
62 {
63 return "panel_timeline";
64 }
65
66
67 namespace {
68 template<class P>
69 inline bool
70 isEmptyTimeline (P const& pages)
71 {
72 return 1 == pages.size()
73 and dynamic_cast<TimelineWidgetEmpty*> (pages[0].get());
74 }
75 }
76
77 void
79 {
80 if (isEmptyTimeline (pages_))
81 {
82 tabs_.remove_page();
83 pages_.clear();
84 }
85 pages_.push_back (move (pTimelineWidget));
86 TimelinePage& addedPage = *pages_.back();
87 tabs_.append_page (addedPage, addedPage.getLabel());
88 }
89
90
91}} // namespace stage::panel
The base class for all dockable panels.
Definition panel.hpp:42
void addTimeline(PageHandle &&)
take ownership of the widget and place it into a new tab
std::unique_ptr< timeline::TimelinePage > PageHandle
TimelinePanel(workspace::PanelManager &, Gdl::DockItem &)
static const char * getTitle()
static const gchar * getStockID()
Interface: GUI page holding a timeline display.
virtual cuString getLabel() const =0
Placeholder to show when no actual Timeline is present.
A class to manage DockItem objects for WorkspaceWindow.
A set of basic GTK includes for the UI.
#define _(String)
Definition gtk-base.hpp:68
Lumiera GTK UI implementation root.
Definition guifacade.cpp:37
A dockable container to hold a notebook of timeline displays.
Empty placeholder to be rendered when the UI starts without session.
This file defines the core component of the Lumiera GUI.