Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shortcuts in statusbar #239

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions eddy/core/items/edges/common/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,9 @@ def hoverEnterEvent(self, hoverEvent):
:type hoverEvent: QGraphicsSceneHoverEvent
"""
self.setCursor(QtCore.Qt.PointingHandCursor)
if not self.breakpoints and self.source.pos() != self.target.pos():
self.session.statusBar().showMessage(
'Double-click to add breakpoint and obtain right-angled edge')
super().hoverEnterEvent(hoverEvent)

def hoverMoveEvent(self, hoverEvent):
Expand All @@ -414,6 +417,7 @@ def hoverLeaveEvent(self, hoverEvent):
:type hoverEvent: QGraphicsSceneHoverEvent
"""
self.setCursor(QtCore.Qt.ArrowCursor)
self.session.statusBar().clearMessage()
super().hoverLeaveEvent(hoverEvent)

def itemChange(self, change, value):
Expand Down
19 changes: 19 additions & 0 deletions eddy/core/items/nodes/common/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -908,3 +908,22 @@ def onPrefixModified(self,pref):
rendering = settings.value('ontology/iri/render', IRIRender.PREFIX.value, str)
if rendering==IRIRender.PREFIX.value or rendering==IRIRender.LABEL.value:
self.doUpdateNodeLabel()

#############################################
# EVENTS
#################################
def hoverEnterEvent(self, hoverEvent):
"""
Executed when the mouse enters the shape (NOT PRESSED).
:type hoverEvent: QGraphicsSceneHoverEvent
"""
self.session.statusBar().showMessage('Hold Shift ⇧ and drag the label to move it')
super().hoverEnterEvent(hoverEvent)

def hoverLeaveEvent(self, hoverEvent):
"""
Executed when the mouse leaves the shape (NOT PRESSED).
:type hoverEvent: QGraphicsSceneHoverEvent
"""
self.session.statusBar().clearMessage()
super().hoverLeaveEvent(hoverEvent)