Use updateView() convenience function in EditorSession
This commit is contained in:
parent
35d1f13a46
commit
084613ebf8
@ -478,6 +478,7 @@ class EditorSession(QtCore.QObject):
|
|||||||
self.editorTab.currentView().setFocus()
|
self.editorTab.currentView().setFocus()
|
||||||
|
|
||||||
def updateView(self):
|
def updateView(self):
|
||||||
|
if self.editorTab:
|
||||||
self.editorTab.currentView().update()
|
self.editorTab.currentView().update()
|
||||||
|
|
||||||
def toolDidChange(self, tool):
|
def toolDidChange(self, tool):
|
||||||
@ -826,7 +827,7 @@ class EditorSession(QtCore.QObject):
|
|||||||
revisionChanged = QtCore.Signal(RevisionChanges)
|
revisionChanged = QtCore.Signal(RevisionChanges)
|
||||||
|
|
||||||
def undoIndexChanged(self, index):
|
def undoIndexChanged(self, index):
|
||||||
self.editorTab.currentView().update()
|
self.updateView()
|
||||||
|
|
||||||
def pushCommand(self, command):
|
def pushCommand(self, command):
|
||||||
log.info("Pushing command %s" % command.text())
|
log.info("Pushing command %s" % command.text())
|
||||||
@ -962,25 +963,25 @@ class EditorSession(QtCore.QObject):
|
|||||||
self.updateStatusFromEvent(event)
|
self.updateStatusFromEvent(event)
|
||||||
if hasattr(self.currentTool, 'mousePress') and event.blockPosition is not None:
|
if hasattr(self.currentTool, 'mousePress') and event.blockPosition is not None:
|
||||||
self.currentTool.mousePress(event)
|
self.currentTool.mousePress(event)
|
||||||
self.editorTab.currentView().update()
|
self.updateView()
|
||||||
|
|
||||||
def viewMouseMove(self, event):
|
def viewMouseMove(self, event):
|
||||||
self.updateStatusFromEvent(event)
|
self.updateStatusFromEvent(event)
|
||||||
if hasattr(self.currentTool, 'mouseMove'):
|
if hasattr(self.currentTool, 'mouseMove'):
|
||||||
self.currentTool.mouseMove(event)
|
self.currentTool.mouseMove(event)
|
||||||
self.editorTab.currentView().update()
|
self.updateView()
|
||||||
|
|
||||||
def viewMouseDrag(self, event):
|
def viewMouseDrag(self, event):
|
||||||
self.updateStatusFromEvent(event)
|
self.updateStatusFromEvent(event)
|
||||||
if hasattr(self.currentTool, 'mouseDrag'):
|
if hasattr(self.currentTool, 'mouseDrag'):
|
||||||
self.currentTool.mouseDrag(event)
|
self.currentTool.mouseDrag(event)
|
||||||
self.editorTab.currentView().update()
|
self.updateView()
|
||||||
|
|
||||||
def viewMouseRelease(self, event):
|
def viewMouseRelease(self, event):
|
||||||
self.updateStatusFromEvent(event)
|
self.updateStatusFromEvent(event)
|
||||||
if hasattr(self.currentTool, 'mouseRelease'):
|
if hasattr(self.currentTool, 'mouseRelease'):
|
||||||
self.currentTool.mouseRelease(event)
|
self.currentTool.mouseRelease(event)
|
||||||
self.editorTab.currentView().update()
|
self.updateView()
|
||||||
|
|
||||||
# --- EditorTab handling ---
|
# --- EditorTab handling ---
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user