mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 00:44:52 +01:00
fix horizontal/vertical naming
This commit is contained in:
parent
9b65ef84eb
commit
434db48bc8
2 changed files with 12 additions and 12 deletions
|
|
@ -647,7 +647,7 @@ class HierarchyModel(QtCore.QAbstractItemModel):
|
|||
index = self.index_for_item(item)
|
||||
self.setData(index, True, DUPLICATED_ROLE)
|
||||
|
||||
def _move_vertical_single(self, index, direction):
|
||||
def _move_horizontal_single(self, index, direction):
|
||||
if not index.isValid():
|
||||
return
|
||||
|
||||
|
|
@ -737,7 +737,7 @@ class HierarchyModel(QtCore.QAbstractItemModel):
|
|||
|
||||
self.index_moved.emit(index)
|
||||
|
||||
def move_vertical(self, indexes, direction):
|
||||
def move_horizontal(self, indexes, direction):
|
||||
if not indexes:
|
||||
return
|
||||
|
||||
|
|
@ -745,7 +745,7 @@ class HierarchyModel(QtCore.QAbstractItemModel):
|
|||
indexes = [indexes]
|
||||
|
||||
if len(indexes) == 1:
|
||||
self._move_vertical_single(indexes[0], direction)
|
||||
self._move_horizontal_single(indexes[0], direction)
|
||||
return
|
||||
|
||||
items_by_id = {}
|
||||
|
|
@ -802,9 +802,9 @@ class HierarchyModel(QtCore.QAbstractItemModel):
|
|||
|
||||
for item in items:
|
||||
index = self.index_for_item(item)
|
||||
self._move_vertical_single(index, direction)
|
||||
self._move_horizontal_single(index, direction)
|
||||
|
||||
def _move_horizontal_single(self, index, direction):
|
||||
def _move_vertical_single(self, index, direction):
|
||||
if not index.isValid():
|
||||
return
|
||||
|
||||
|
|
@ -891,7 +891,7 @@ class HierarchyModel(QtCore.QAbstractItemModel):
|
|||
|
||||
self.index_moved.emit(index)
|
||||
|
||||
def move_horizontal(self, indexes, direction):
|
||||
def move_vertical(self, indexes, direction):
|
||||
if not indexes:
|
||||
return
|
||||
|
||||
|
|
@ -899,7 +899,7 @@ class HierarchyModel(QtCore.QAbstractItemModel):
|
|||
indexes = [indexes]
|
||||
|
||||
if len(indexes) == 1:
|
||||
self._move_horizontal_single(indexes[0], direction)
|
||||
self._move_vertical_single(indexes[0], direction)
|
||||
return
|
||||
|
||||
items_by_id = {}
|
||||
|
|
@ -929,7 +929,7 @@ class HierarchyModel(QtCore.QAbstractItemModel):
|
|||
|
||||
for item in items:
|
||||
index = self.index_for_item(item)
|
||||
self._move_horizontal_single(index, direction)
|
||||
self._move_vertical_single(index, direction)
|
||||
|
||||
def child_removed(self, child):
|
||||
self._items_by_id.pop(child.id, None)
|
||||
|
|
|
|||
|
|
@ -324,19 +324,19 @@ class HierarchyView(QtWidgets.QTreeView):
|
|||
|
||||
def _on_up_ctrl_pressed(self):
|
||||
indexes = self.selectedIndexes()
|
||||
self._source_model.move_horizontal(indexes, -1)
|
||||
self._source_model.move_vertical(indexes, -1)
|
||||
|
||||
def _on_down_ctrl_pressed(self):
|
||||
indexes = self.selectedIndexes()
|
||||
self._source_model.move_horizontal(indexes, 1)
|
||||
self._source_model.move_vertical(indexes, 1)
|
||||
|
||||
def _on_left_ctrl_pressed(self):
|
||||
indexes = self.selectedIndexes()
|
||||
self._source_model.move_vertical(indexes, -1)
|
||||
self._source_model.move_horizontal(indexes, -1)
|
||||
|
||||
def _on_right_ctrl_pressed(self):
|
||||
indexes = self.selectedIndexes()
|
||||
self._source_model.move_vertical(indexes, 1)
|
||||
self._source_model.move_horizontal(indexes, 1)
|
||||
|
||||
def _on_enter_pressed(self):
|
||||
index = self.currentIndex()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue