toggle for moving locked panels implemented
This commit is contained in:
@@ -191,11 +191,10 @@ MainMenu::MainMenu(QMainWindow *parent) :
|
||||
//
|
||||
// WINDOW MENU
|
||||
//
|
||||
window_menu_ = new Menu(this);
|
||||
window_menu_->addAction("No window support");
|
||||
window_menu_->addSeparator();
|
||||
window_menu_ = new Menu(this, this, SLOT(WindowMenuAboutToShow()));
|
||||
window_menu_separator_ = window_menu_->addSeparator();
|
||||
window_maximize_panel_item_ = window_menu_->AddItem("maximizepanel", nullptr, nullptr, "`");
|
||||
window_lock_layout_item_ = window_menu_->AddItem("lockpanels", nullptr, nullptr);
|
||||
window_lock_layout_item_ = window_menu_->AddItem("lockpanels", olive::panel_manager, SLOT(SetPanelsLocked(bool)));
|
||||
window_lock_layout_item_->setCheckable(true);
|
||||
window_menu_->addSeparator();
|
||||
window_reset_layout_item_ = window_menu_->AddItem("resetdefaultlayout", nullptr, nullptr);
|
||||
@@ -345,49 +344,67 @@ void MainMenu::ToolsMenuAboutToShow()
|
||||
tools_snapping_item_->setChecked(olive::core.snapping());
|
||||
}
|
||||
|
||||
void MainMenu::WindowMenuAboutToShow()
|
||||
{
|
||||
// QMainWindow generates a perfectly usable menu for this purpose, we just need to copy it to the window menu
|
||||
QMenu* panel_menu = static_cast<QMainWindow*>(parentWidget())->createPopupMenu();
|
||||
QList<QAction*> panel_menu_actions = panel_menu->actions();
|
||||
|
||||
// Make sure when we delete the panel_menu, it doesn't delete the actions
|
||||
foreach (QAction* panel_action, panel_menu_actions) {
|
||||
panel_action->setParent(window_menu_);
|
||||
}
|
||||
|
||||
delete panel_menu;
|
||||
|
||||
window_menu_->insertActions(window_menu_separator_, panel_menu_actions);
|
||||
|
||||
window_lock_layout_item_->setChecked(olive::panel_manager->ArePanelsLocked());
|
||||
}
|
||||
|
||||
void MainMenu::ZoomInTriggered()
|
||||
{
|
||||
olive::panel_focus_manager->CurrentlyFocused()->ZoomIn();
|
||||
olive::panel_manager->CurrentlyFocused()->ZoomIn();
|
||||
}
|
||||
|
||||
void MainMenu::ZoomOutTriggered()
|
||||
{
|
||||
olive::panel_focus_manager->CurrentlyFocused()->ZoomOut();
|
||||
olive::panel_manager->CurrentlyFocused()->ZoomOut();
|
||||
}
|
||||
|
||||
void MainMenu::GoToStartTriggered()
|
||||
{
|
||||
olive::panel_focus_manager->CurrentlyFocused()->GoToStart();
|
||||
olive::panel_manager->CurrentlyFocused()->GoToStart();
|
||||
}
|
||||
|
||||
void MainMenu::PrevFrameTriggered()
|
||||
{
|
||||
olive::panel_focus_manager->CurrentlyFocused()->PrevFrame();
|
||||
olive::panel_manager->CurrentlyFocused()->PrevFrame();
|
||||
}
|
||||
|
||||
void MainMenu::PlayPauseTriggered()
|
||||
{
|
||||
olive::panel_focus_manager->CurrentlyFocused()->PlayPause();
|
||||
olive::panel_manager->CurrentlyFocused()->PlayPause();
|
||||
}
|
||||
|
||||
void MainMenu::NextFrameTriggered()
|
||||
{
|
||||
olive::panel_focus_manager->CurrentlyFocused()->NextFrame();
|
||||
olive::panel_manager->CurrentlyFocused()->NextFrame();
|
||||
}
|
||||
|
||||
void MainMenu::GoToEndTriggered()
|
||||
{
|
||||
olive::panel_focus_manager->CurrentlyFocused()->GoToEnd();
|
||||
olive::panel_manager->CurrentlyFocused()->GoToEnd();
|
||||
}
|
||||
|
||||
void MainMenu::SelectAllTriggered()
|
||||
{
|
||||
olive::panel_focus_manager->CurrentlyFocused()->SelectAll();
|
||||
olive::panel_manager->CurrentlyFocused()->SelectAll();
|
||||
}
|
||||
|
||||
void MainMenu::DeselectAllTriggered()
|
||||
{
|
||||
olive::panel_focus_manager->CurrentlyFocused()->DeselectAll();
|
||||
olive::panel_manager->CurrentlyFocused()->DeselectAll();
|
||||
}
|
||||
|
||||
void MainMenu::Retranslate()
|
||||
|
||||
@@ -66,6 +66,11 @@ private slots:
|
||||
*/
|
||||
void ToolsMenuAboutToShow();
|
||||
|
||||
/**
|
||||
* @brief Slot triggered just before the Window menu shows
|
||||
*/
|
||||
void WindowMenuAboutToShow();
|
||||
|
||||
/**
|
||||
* @brief Slot for zooming in
|
||||
*
|
||||
@@ -163,6 +168,7 @@ private:
|
||||
QAction* playback_loop_item_;
|
||||
|
||||
Menu* window_menu_;
|
||||
QAction* window_menu_separator_;
|
||||
QAction* window_maximize_panel_item_;
|
||||
QAction* window_lock_layout_item_;
|
||||
QAction* window_reset_layout_item_;
|
||||
|
||||
@@ -67,23 +67,23 @@ void olive::MainWindow::SetFullscreen(bool fullscreen)
|
||||
void olive::MainWindow::ProjectOpen(Project* p)
|
||||
{
|
||||
// FIXME Use settings data to create panels and restore state if they exist
|
||||
NodePanel* node_panel = olive::panel_focus_manager->CreatePanel<NodePanel>(this);
|
||||
NodePanel* node_panel = olive::panel_manager->CreatePanel<NodePanel>(this);
|
||||
addDockWidget(Qt::TopDockWidgetArea, node_panel);
|
||||
|
||||
ParamPanel* param_panel = olive::panel_focus_manager->CreatePanel<ParamPanel>(this);
|
||||
ParamPanel* param_panel = olive::panel_manager->CreatePanel<ParamPanel>(this);
|
||||
addDockWidget(Qt::TopDockWidgetArea, param_panel);
|
||||
|
||||
ViewerPanel* viewer_panel2 = olive::panel_focus_manager->CreatePanel<ViewerPanel>(this);
|
||||
ViewerPanel* viewer_panel2 = olive::panel_manager->CreatePanel<ViewerPanel>(this);
|
||||
addDockWidget(Qt::TopDockWidgetArea, viewer_panel2);
|
||||
|
||||
ProjectPanel* project_panel = olive::panel_focus_manager->CreatePanel<ProjectPanel>(this);
|
||||
ProjectPanel* project_panel = olive::panel_manager->CreatePanel<ProjectPanel>(this);
|
||||
project_panel->set_project(p);
|
||||
addDockWidget(Qt::BottomDockWidgetArea, project_panel);
|
||||
|
||||
ToolPanel* tool_panel = olive::panel_focus_manager->CreatePanel<ToolPanel>(this);
|
||||
ToolPanel* tool_panel = olive::panel_manager->CreatePanel<ToolPanel>(this);
|
||||
addDockWidget(Qt::BottomDockWidgetArea, tool_panel);
|
||||
|
||||
TimelinePanel* timeline_panel = olive::panel_focus_manager->CreatePanel<TimelinePanel>(this);
|
||||
TimelinePanel* timeline_panel = olive::panel_manager->CreatePanel<TimelinePanel>(this);
|
||||
addDockWidget(Qt::BottomDockWidgetArea, timeline_panel);
|
||||
|
||||
connect(node_panel, SIGNAL(SelectionChanged(QList<Node*>)), param_panel, SLOT(SetNodes(QList<Node*>)));
|
||||
@@ -96,7 +96,7 @@ void olive::MainWindow::ProjectOpen(Project* p)
|
||||
|
||||
void olive::MainWindow::closeEvent(QCloseEvent *e)
|
||||
{
|
||||
olive::panel_focus_manager->DeleteAllPanels();
|
||||
olive::panel_manager->DeleteAllPanels();
|
||||
|
||||
// FIXME: Test code - We have no cache management and the cache is very much testing only, so we delete it on close
|
||||
// as to not clog up HDD space
|
||||
|
||||
Reference in New Issue
Block a user