Skip to content

Commit

Permalink
schemeedit: Show appropriate macro level on ActivateParentRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
ales-erjavec committed Aug 3, 2021
1 parent d572ab1 commit 9ab70c6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions orangecanvas/document/schemeedit.py
Original file line number Diff line number Diff line change
Expand Up @@ -1526,6 +1526,9 @@ def eventFilter(self, obj, event):
# Re post the event
self.__showHelpFor(event.href())
elif event.type() == WorkflowEvent.ActivateParentRequest:
node = event.node()
self.__historyPush(node.parent_node())
self.ensureVisible(node)
self.window().activateWindow()
self.window().raise_()

Expand Down
8 changes: 5 additions & 3 deletions orangecanvas/scheme/widgetmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,9 @@ def __add_widget_for_node(self, node):
toolTip=self.tr("Raise containing canvas workflow window"),
shortcut=QKeySequence(Qt.ControlModifier | Qt.Key_Up)
)
raise_canvas.triggered.connect(self.__on_activate_parent)
raise_canvas.triggered.connect(
partial(self.__on_activate_parent, node)
)
raise_descendants = QAction(
self.tr("Raise Descendants"), w,
objectName="action-canvas-raise-descendants",
Expand Down Expand Up @@ -566,8 +568,8 @@ def __activate_widget_for_node(self, node): # type: (SchemeNode) -> None
item.errorwidget.raise_()
item.errorwidget.activateWindow()

def __on_activate_parent(self):
event = WorkflowEvent(WorkflowEvent.ActivateParentRequest)
def __on_activate_parent(self, node):
event = NodeEvent(WorkflowEvent.ActivateParentRequest, node)
QCoreApplication.sendEvent(self.scheme(), event)

def eventFilter(self, recv, event):
Expand Down

0 comments on commit 9ab70c6

Please sign in to comment.