UI: flatten preferences behavior tabs and add node parameter editor shortcut
- Move Behavior-General options (hover focus, slider ladder, scroll zooms) into the General preferences tab. - Move Behavior-Audio option (audio scrubbing) into the Audio preferences tab. - Promote remaining Behavior categories (Timeline, Playback, Project, Nodes, Rendering) to top-level sidebar entries without the 'Behavior - ' prefix. - Update Chinese translations for the new sidebar titles and fill unfinished Behavior tab strings. NodeView: - Remove double-click jump-to-parameter-editor behavior; keep expand/collapse. - Add right-click context menu item 'Show in Parameter Editor'. - Add Shift+P shortcut bound to the same action. Render: - Fix crash in PreviewAutoCacher::ClearSingleFrameRenders when proxy playback causes a render ticket to finish synchronously before the watcher pointer is returned. Defer the watcher Finished signal via queued connection so the caller can safely register the watcher before it is deleted.
This commit is contained in:
@@ -58,6 +58,7 @@ NodeView::NodeView(QWidget *parent)
|
||||
, overlay_view_(nullptr)
|
||||
, scale_(1.0)
|
||||
, dont_emit_selection_signals_(false)
|
||||
, show_in_param_editor_action_(nullptr)
|
||||
{
|
||||
setScene(&scene_);
|
||||
SetDefaultDragMode(RubberBandDrag);
|
||||
@@ -73,6 +74,12 @@ NodeView::NodeView(QWidget *parent)
|
||||
|
||||
SetFlowDirection(NodeViewCommon::kLeftToRight);
|
||||
|
||||
show_in_param_editor_action_ = new QAction(tr("Show in Parameter Editor"), this);
|
||||
Menu::ConformItem(show_in_param_editor_action_, QStringLiteral("shownodeparams"), QKeySequence(tr("Shift+P")));
|
||||
show_in_param_editor_action_->setShortcutContext(Qt::WindowShortcut);
|
||||
addAction(show_in_param_editor_action_);
|
||||
connect(show_in_param_editor_action_, &QAction::triggered, this, &NodeView::ShowSelectedNodeInParamEditor);
|
||||
|
||||
UpdateSceneBoundingRect();
|
||||
connect(&scene_, &QGraphicsScene::changed, this,
|
||||
&NodeView::UpdateSceneBoundingRect);
|
||||
@@ -643,19 +650,6 @@ void NodeView::mouseDoubleClickEvent(QMouseEvent *event)
|
||||
dynamic_cast<NodeViewItem *>(itemAt(event->pos()));
|
||||
if (item_at_cursor) {
|
||||
item_at_cursor->ToggleExpanded();
|
||||
if (PanelManager::instance()) {
|
||||
if (PanelWidget *panel = PanelManager::instance()
|
||||
->GetPanelWithName(
|
||||
QStringLiteral("ParamPanel"))) {
|
||||
panel->show();
|
||||
panel->raise();
|
||||
panel->setFocus(Qt::OtherFocusReason);
|
||||
}
|
||||
}
|
||||
|
||||
// Scroll the parameter editor to this node
|
||||
emit NodeSelectionChangedWithContexts(
|
||||
{ { item_at_cursor->GetNode(), item_at_cursor->GetContext() } });
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -865,6 +859,14 @@ void NodeView::ShowContextMenu(const QPoint &pos)
|
||||
|
||||
m.addSeparator();
|
||||
|
||||
// Show in Parameter Editor
|
||||
QAction *show_in_param_editor_action = m.addAction(
|
||||
tr("Show in Parameter Editor"));
|
||||
show_in_param_editor_action->setShortcut(
|
||||
show_in_param_editor_action_->shortcut());
|
||||
connect(show_in_param_editor_action, &QAction::triggered, this,
|
||||
&NodeView::ShowSelectedNodeInParamEditor);
|
||||
|
||||
// Properties
|
||||
QAction *properties_action = m.addAction(tr("P&roperties"));
|
||||
connect(properties_action, &QAction::triggered, this,
|
||||
@@ -1641,6 +1643,30 @@ void NodeView::ShowNodeProperties()
|
||||
}
|
||||
}
|
||||
|
||||
void NodeView::ShowSelectedNodeInParamEditor()
|
||||
{
|
||||
if (selected_nodes_.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
NodeViewItem *item = scene_.GetSelectedItems().first();
|
||||
if (!item || !item->GetNode()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (PanelManager::instance()) {
|
||||
if (PanelWidget *panel = PanelManager::instance()->GetPanelWithName(
|
||||
QStringLiteral("ParamPanel"))) {
|
||||
panel->show();
|
||||
panel->raise();
|
||||
panel->setFocus(Qt::OtherFocusReason);
|
||||
}
|
||||
}
|
||||
|
||||
emit NodeSelectionChangedWithContexts(
|
||||
{ { item->GetNode(), item->GetContext() } });
|
||||
}
|
||||
|
||||
void NodeView::LabelSelectedNodes()
|
||||
{
|
||||
Core::instance()->LabelNodes(selected_nodes_);
|
||||
|
||||
Reference in New Issue
Block a user