mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-08-04 02:34:45 +00:00
fix reordering logic
This commit is contained in:
parent
33547e57b0
commit
0dca5a4a3f
2 changed files with 8 additions and 4 deletions
|
|
@ -262,7 +262,6 @@ MouseEventListener {
|
||||||
right: parent.right
|
right: parent.right
|
||||||
}
|
}
|
||||||
|
|
||||||
property Item draggingItem
|
|
||||||
property var dragData
|
property var dragData
|
||||||
|
|
||||||
cellWidth: root.buttonHeight
|
cellWidth: root.buttonHeight
|
||||||
|
|
@ -391,7 +390,6 @@ MouseEventListener {
|
||||||
flow: GridView.FlowTopToBottom
|
flow: GridView.FlowTopToBottom
|
||||||
cellWidth: root.buttonHeight
|
cellWidth: root.buttonHeight
|
||||||
cellHeight: cellWidth
|
cellHeight: cellWidth
|
||||||
property Item draggingItem
|
|
||||||
|
|
||||||
model: appListModel
|
model: appListModel
|
||||||
delegate: HomeLauncher {}
|
delegate: HomeLauncher {}
|
||||||
|
|
|
||||||
|
|
@ -182,8 +182,14 @@ Q_INVOKABLE void ApplicationListModel::moveItem(int row, int destination)
|
||||||
}
|
}
|
||||||
|
|
||||||
beginMoveRows(QModelIndex(), row, row, QModelIndex(), destination);
|
beginMoveRows(QModelIndex(), row, row, QModelIndex(), destination);
|
||||||
ApplicationData data = m_applicationList.takeAt(row);
|
if (destination > row) {
|
||||||
m_applicationList.insert(destination, data);
|
ApplicationData data = m_applicationList.at(row);
|
||||||
|
m_applicationList.insert(destination, data);
|
||||||
|
m_applicationList.takeAt(row);
|
||||||
|
} else {
|
||||||
|
ApplicationData data = m_applicationList.takeAt(row);
|
||||||
|
m_applicationList.insert(destination, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
m_appOrder.clear();
|
m_appOrder.clear();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue