Skip to content

Commit 233fae6

Browse files
committed
menu fix to shortcuts.
1 parent 28c11e1 commit 233fae6

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

NodeGraphQt/widgets/viewer.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/usr/bin/python
22
import os
3-
from sys import platform
43

54
from PySide2 import QtGui, QtCore, QtWidgets
65

@@ -26,7 +25,7 @@ class NodeViewer(QtWidgets.QGraphicsView):
2625
node viewer is the widget used for displaying the scene and nodes
2726
2827
functions in this class is used internally by the
29-
`NodeGraphQt.NodeGraph` class.
28+
class:`NodeGraphQt.NodeGraph` class.
3029
"""
3130

3231
moved_nodes = QtCore.Signal(dict)
@@ -66,14 +65,13 @@ def __init__(self, parent=None):
6665
self._search_widget = TabSearchWidget(self)
6766
self._search_widget.search_submitted.connect(self._on_search_submitted)
6867

69-
# workaround fix for OSX & linux, shortcuts from the non-native menu
70-
# actions don't seem to trigger so we create a hidden menu bar.
71-
if platform in ['darwin', 'linux2']:
72-
menu_bar = QtWidgets.QMenuBar(self)
73-
menu_bar.setNativeMenuBar(False)
74-
# can't use setVisibility(False) or shortcuts don't work.
75-
menu_bar.resize(0, 0)
76-
menu_bar.addMenu(self._context_menu)
68+
# workaround fix for shortcuts from the non-native menu actions
69+
# don't seem to trigger so we create a hidden menu bar.
70+
menu_bar = QtWidgets.QMenuBar(self)
71+
menu_bar.setNativeMenuBar(False)
72+
# shortcuts don't work with "setVisibility(False)".
73+
menu_bar.resize(0, 0)
74+
menu_bar.addMenu(self._context_menu)
7775

7876
self.acyclic = True
7977
self.LMB_state = False

0 commit comments

Comments
 (0)