finished refactoring copy/paste code

This commit is contained in:
itsmattkc
2021-12-30 19:35:52 -08:00
parent 8daa83b682
commit a7be16fec9
11 changed files with 143 additions and 75 deletions
+8 -4
View File
@@ -737,10 +737,14 @@ void MainWindow::FocusedPanelChanged(PanelWidget *panel)
if (NodePanel *node_panel = dynamic_cast<NodePanel*>(panel)) {
// Set param view contexts to these
bool is_default_node_panel = node_panel == node_panel_;
param_panel_->SetIgnoreNodeFlags(!is_default_node_panel);
param_panel_->SetCreateCheckBoxes(is_default_node_panel ? kNoCheckBoxes : kCheckBoxesOnNonConnected);
param_panel_->SetContexts(node_panel->GetContexts());
const QVector<Node*> &new_ctxs = node_panel->GetContexts();
if (new_ctxs != param_panel_->GetContexts()) {
bool is_default_node_panel = node_panel == node_panel_;
param_panel_->SetIgnoreNodeFlags(!is_default_node_panel);
param_panel_->SetCreateCheckBoxes(is_default_node_panel ? kNoCheckBoxes : kCheckBoxesOnNonConnected);
param_panel_->SetContexts(node_panel->GetContexts());
}
} else if (TimelinePanel* timeline = dynamic_cast<TimelinePanel*>(panel)) {
// Signal timeline focus
TimelineFocused(timeline->GetConnectedViewer());