mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +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
|
||||
}
|
||||
|
||||
property Item draggingItem
|
||||
property var dragData
|
||||
|
||||
cellWidth: root.buttonHeight
|
||||
|
|
@ -391,7 +390,6 @@ MouseEventListener {
|
|||
flow: GridView.FlowTopToBottom
|
||||
cellWidth: root.buttonHeight
|
||||
cellHeight: cellWidth
|
||||
property Item draggingItem
|
||||
|
||||
model: appListModel
|
||||
delegate: HomeLauncher {}
|
||||
|
|
|
|||
|
|
@ -182,8 +182,14 @@ Q_INVOKABLE void ApplicationListModel::moveItem(int row, int destination)
|
|||
}
|
||||
|
||||
beginMoveRows(QModelIndex(), row, row, QModelIndex(), destination);
|
||||
ApplicationData data = m_applicationList.takeAt(row);
|
||||
m_applicationList.insert(destination, data);
|
||||
if (destination > row) {
|
||||
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();
|
||||
|
|
|
|||
Loading…
Reference in a new issue