toggle for moving locked panels implemented

This commit is contained in:
itsmattkc
2019-09-24 17:43:16 +10:00
parent cad9fc8e48
commit c33a0b50ce
9 changed files with 110 additions and 33 deletions
@@ -171,7 +171,7 @@ void NodeParamViewWidgetBridge::CreateWidgets()
// FIXME: Test code
// Pretty hacky way of getting the root folder for this node's sequence
ProjectPanel* pp = olive::panel_focus_manager->MostRecentlyFocused<ProjectPanel>();
ProjectPanel* pp = olive::panel_manager->MostRecentlyFocused<ProjectPanel>();
footage_combobox->SetRoot(pp->project()->root());
// Use multiple values
+17
View File
@@ -32,6 +32,23 @@ PanelWidget::PanelWidget(QWidget *parent) :
setFocusPolicy(Qt::ClickFocus);
}
void PanelWidget::SetMovementLocked(bool locked)
{
if (locked) {
// Disable moving on QDockWidget
setFeatures(features() & ~QDockWidget::DockWidgetMovable);
// Hide the title bar (only real way to do this is to replace it with an empty QWidget)
setTitleBarWidget(new QWidget(this));
} else {
// Re-enable moving on QDockWidget
setFeatures(features() | QDockWidget::DockWidgetMovable);
// Set the "custom" titlebar to null so the default gets restored
setTitleBarWidget(nullptr);
}
}
void PanelWidget::SetBorderVisible(bool enabled)
{
border_visible_ = enabled;
+5
View File
@@ -40,6 +40,11 @@ public:
*/
PanelWidget(QWidget* parent);
/**
* @brief Set whether panel movement is locked or not
*/
void SetMovementLocked(bool locked);
/**
* @brief Set visibility of panel's highlighted border, mostly used for showing panel focus
*