mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-24 13:32:50 -05:00
dgop: fix default sort direction
This commit is contained in:
@@ -105,7 +105,7 @@ Item {
|
|||||||
sortKey: "name"
|
sortKey: "name"
|
||||||
currentSort: DgopService.currentSort
|
currentSort: DgopService.currentSort
|
||||||
sortAscending: DgopService.sortAscending
|
sortAscending: DgopService.sortAscending
|
||||||
onClicked: DgopService.setSortBy("name")
|
onClicked: DgopService.toggleSort("name")
|
||||||
alignment: Text.AlignLeft
|
alignment: Text.AlignLeft
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -115,7 +115,7 @@ Item {
|
|||||||
sortKey: "cpu"
|
sortKey: "cpu"
|
||||||
currentSort: DgopService.currentSort
|
currentSort: DgopService.currentSort
|
||||||
sortAscending: DgopService.sortAscending
|
sortAscending: DgopService.sortAscending
|
||||||
onClicked: DgopService.setSortBy("cpu")
|
onClicked: DgopService.toggleSort("cpu")
|
||||||
}
|
}
|
||||||
|
|
||||||
SortableHeader {
|
SortableHeader {
|
||||||
@@ -124,7 +124,7 @@ Item {
|
|||||||
sortKey: "memory"
|
sortKey: "memory"
|
||||||
currentSort: DgopService.currentSort
|
currentSort: DgopService.currentSort
|
||||||
sortAscending: DgopService.sortAscending
|
sortAscending: DgopService.sortAscending
|
||||||
onClicked: DgopService.setSortBy("memory")
|
onClicked: DgopService.toggleSort("memory")
|
||||||
}
|
}
|
||||||
|
|
||||||
SortableHeader {
|
SortableHeader {
|
||||||
@@ -133,7 +133,7 @@ Item {
|
|||||||
sortKey: "pid"
|
sortKey: "pid"
|
||||||
currentSort: DgopService.currentSort
|
currentSort: DgopService.currentSort
|
||||||
sortAscending: DgopService.sortAscending
|
sortAscending: DgopService.sortAscending
|
||||||
onClicked: DgopService.setSortBy("pid")
|
onClicked: DgopService.toggleSort("pid")
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
|||||||
@@ -569,10 +569,18 @@ Singleton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function setSortBy(newSortBy) {
|
function setSortBy(newSortBy) {
|
||||||
if (newSortBy === currentSort) {
|
if (newSortBy !== currentSort) {
|
||||||
|
currentSort = newSortBy;
|
||||||
|
sortAscending = false;
|
||||||
|
applySorting();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function toggleSort(column) {
|
||||||
|
if (column === currentSort) {
|
||||||
sortAscending = !sortAscending;
|
sortAscending = !sortAscending;
|
||||||
} else {
|
} else {
|
||||||
currentSort = newSortBy;
|
currentSort = column;
|
||||||
sortAscending = false;
|
sortAscending = false;
|
||||||
}
|
}
|
||||||
applySorting();
|
applySorting();
|
||||||
|
|||||||
Reference in New Issue
Block a user