Skip to content

Commit 8fade98

Browse files
author
Leandro Inocencio
committed
Save visible value into port + clean up
1 parent 98576f2 commit 8fade98

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

NodeGraphQt/base/port.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,13 @@ def set_visible(self, visible=True):
104104
Args:
105105
visible (bool): true if visible.
106106
"""
107+
self.model.visible = visible
107108
label = 'show' if visible else 'hide'
108109
undo_stack = self.node().graph.undo_stack()
109110
undo_stack.beginMacro('{} port {}'.format(label, self.name()))
110111

111-
connected_ports = self.connected_ports()
112-
if connected_ports:
113-
for port in connected_ports:
114-
undo_stack.push(PortDisconnectedCmd(self, port))
112+
for port in self.connected_ports():
113+
undo_stack.push(PortDisconnectedCmd(self, port))
115114

116115
undo_stack.push(PortVisibleCmd(self))
117116
undo_stack.endMacro()

0 commit comments

Comments
 (0)