Skip to content

Commit afd1a15

Browse files
committed
feat: add sorting to tray items
Added sortRoleName and sortOrder properties to DDT.SortFilterProxyModel to enable proper sorting of tray items by visual index in ascending order. This ensures that tray icons are displayed in a consistent and predictable sequence, improving the user experience by maintaining stable icon positions. feat: 为托盘项添加排序功能 在 DDT.SortFilterProxyModel 中添加了 sortRoleName 和 sortOrder 属性,以 支持按视觉索引升序排列托盘项。这确保了托盘图标以一致且可预测的顺序显示, 通过保持稳定的图标位置来改善用户体验。 Pms: BUG-288745
1 parent ab68297 commit afd1a15

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

panels/dock/tray/package/tray.qml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ AppletItem {
5757
color: "transparent"
5858
model: DDT.SortFilterProxyModel {
5959
sourceModel: DDT.TraySortOrderModel
60+
sortRoleName: "visualIndex"
61+
sortOrder: Qt.AscendingOrder
6062
filterRowCallback: (sourceRow, sourceParent) => {
6163
let index = sourceModel.index(sourceRow, 0, sourceParent)
6264
return sourceModel.data(index, DDT.TraySortOrderModel.SectionTypeRole) === "stashed" &&

0 commit comments

Comments
 (0)