MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / showNodePanel

Method showNodePanel

Gui/NodeGraph25.cpp:63–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61#include "Global/QtCompat.h"
62
63NATRON_NAMESPACE_ENTER
64
65void
66NodeGraph::showNodePanel(bool casIsCtrl, bool casIsShift, NodeGui* nearbyNode)
67{
68 if (!nearbyNode) {
69 return;
70 }
71 if ( casIsCtrl ) {
72 nearbyNode->ensurePanelCreated();
73 if ( nearbyNode->getSettingPanel() ) {
74 nearbyNode->getSettingPanel()->floatPanel();
75 }
76 } else {
77 nearbyNode->setVisibleSettingsPanel(true);
78 if ( nearbyNode->getSettingPanel() ) {
79 getGui()->putSettingsPanelFirst( nearbyNode->getSettingPanel() );
80 } else {
81 ViewerInstance* isViewer = nearbyNode->getNode()->isEffectViewer();
82 if (isViewer) {
83 ViewerGL* viewer = dynamic_cast<ViewerGL*>( isViewer->getUiContext() );
84 assert(viewer);
85 if (viewer) {
86 ViewerTab* tab = viewer->getViewerTab();
87 assert(tab);
88
89 TabWidget* foundTab = 0;
90 QWidget* parent = 0;
91 if (tab) {
92 parent = tab->parentWidget();
93 }
94 while (parent) {
95 foundTab = dynamic_cast<TabWidget*>(parent);
96 if (foundTab) {
97 break;
98 }
99 parent = parent->parentWidget();
100 }
101 if (foundTab) {
102 foundTab->setCurrentWidget(tab);
103 } else {
104 //try to find a floating window
105 FloatingWidget* floating = 0;
106 if (tab) {
107 parent = tab->parentWidget();
108 }
109 while (parent) {
110 floating = dynamic_cast<FloatingWidget*>(parent);
111 if (floating) {
112 break;
113 }
114 parent = parent->parentWidget();
115 }
116 if (floating) {
117 floating->activateWindow();
118 }
119 }
120 } // if (viewer)

Callers

nothing calls this directly

Calls 15

getGuiFunction · 0.85
ensurePanelCreatedMethod · 0.80
getSettingPanelMethod · 0.80
floatPanelMethod · 0.80
putSettingsPanelFirstMethod · 0.80
getUiContextMethod · 0.80
getViewerTabMethod · 0.80
setCurrentWidgetMethod · 0.80
wasBeginEditCalledMethod · 0.80
isSubGraphUserVisibleMethod · 0.80
getLastSelectedGraphMethod · 0.80

Tested by

no test coverage detected