toggle for moving locked panels implemented
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user