mirror of
https://github.com/wassname/sloth.git
synced 2026-06-28 23:42:17 +08:00
Fix going to next/previous frame/image
This commit is contained in:
@@ -53,7 +53,7 @@ class ModelItem:
|
||||
p = self.parent()
|
||||
if p is not None:
|
||||
row = p.getPosOfChild(self)
|
||||
if row < len(p.children()) - 2:
|
||||
if row < len(p.children()) - 1:
|
||||
return p.getChildAt(row+1)
|
||||
return None
|
||||
|
||||
|
||||
@@ -250,16 +250,16 @@ class LabelTool(QObject):
|
||||
return self._model
|
||||
|
||||
def gotoNext(self):
|
||||
# TODO move this to the scene
|
||||
if self._model is not None and self._current_image is not None:
|
||||
next_image = self._current_image.getNextSibling()
|
||||
self.setCurrentImage(next_image)
|
||||
if next_image is not None:
|
||||
self.setCurrentImage(next_image)
|
||||
|
||||
def gotoPrevious(self):
|
||||
# TODO move this to the scene
|
||||
if self._model is not None and self._current_image is not None:
|
||||
prev_image = self._current_image.getPreviousSibling()
|
||||
self.setCurrentImage(prev_image)
|
||||
if prev_image is not None:
|
||||
self.setCurrentImage(prev_image)
|
||||
|
||||
def updateModified(self):
|
||||
"""update all GUI elements which depend on the state of the model,
|
||||
|
||||
Reference in New Issue
Block a user