Changeset View
Changeset View
Standalone View
Standalone View
applets/systemtray/package/contents/ui/HiddenItemsView.qml
Show First 20 Lines • Show All 50 Lines • ▼ Show 20 Line(s) | 48 | ListView { | |||
---|---|---|---|---|---|
51 | spacing: units.smallSpacing | 51 | spacing: units.smallSpacing | ||
52 | 52 | | |||
53 | currentIndex: -1 | 53 | currentIndex: -1 | ||
54 | highlight: PlasmaComponents.Highlight {} | 54 | highlight: PlasmaComponents.Highlight {} | ||
55 | highlightMoveDuration: 0 | 55 | highlightMoveDuration: 0 | ||
56 | highlightResizeDuration: 0 | 56 | highlightResizeDuration: 0 | ||
57 | 57 | | |||
58 | readonly property int iconItemHeight: root.hiddenItemSize + highlight.marginHints.top + highlight.marginHints.bottom | 58 | readonly property int iconItemHeight: root.hiddenItemSize + highlight.marginHints.top + highlight.marginHints.bottom | ||
59 | property int itemCount: model.rowCount() | ||||
59 | 60 | | |||
60 | model: PlasmaCore.SortFilterModel { | 61 | model: PlasmaCore.SortFilterModel { | ||
61 | sourceModel: plasmoid.nativeInterface.systemTrayModel | 62 | sourceModel: plasmoid.nativeInterface.systemTrayModel | ||
62 | filterRole: "effectiveStatus" | 63 | filterRole: "effectiveStatus" | ||
63 | filterCallback: function(source_row, value) { | 64 | filterCallback: function(source_row, value) { | ||
64 | return value === PlasmaCore.Types.PassiveStatus | 65 | return value === PlasmaCore.Types.PassiveStatus | ||
65 | } | 66 | } | ||
66 | } | 67 | } | ||
67 | delegate: ItemLoader {} | 68 | delegate: ItemLoader {} | ||
68 | } | 69 | } | ||
69 | } | 70 | } | ||
70 | 71 | | |||
72 | Connections { | ||||
73 | target: hiddenTasksColumn.model | ||||
74 | // hiddenTasksColumn.count is not updated when ListView is hidden and is not rendered | ||||
75 | // manually update itemCount so that expander arrow hides/shows itself correctly | ||||
76 | onModelReset: hiddenTasksColumn.itemCount = hiddenTasksColumn.model.rowCount() | ||||
77 | onRowsInserted: hiddenTasksColumn.itemCount = hiddenTasksColumn.model.rowCount() | ||||
78 | onRowsRemoved: hiddenTasksColumn.itemCount = hiddenTasksColumn.model.rowCount() | ||||
79 | onLayoutChanged: hiddenTasksColumn.itemCount = hiddenTasksColumn.model.rowCount() | ||||
80 | } | ||||
81 | | ||||
71 | PlasmaComponents.Highlight { | 82 | PlasmaComponents.Highlight { | ||
72 | id: highlight | 83 | id: highlight | ||
73 | visible: false | 84 | visible: false | ||
74 | } | 85 | } | ||
75 | 86 | | |||
76 | CurrentItemHighLight { | 87 | CurrentItemHighLight { | ||
77 | parent: hiddenTasksColumn.contentItem | 88 | parent: hiddenTasksColumn.contentItem | ||
78 | target: root.activeApplet && root.activeApplet.parent && root.activeApplet.parent.inHiddenLayout ? root.activeApplet.parent.parent : null | 89 | target: root.activeApplet && root.activeApplet.parent && root.activeApplet.parent.inHiddenLayout ? root.activeApplet.parent.parent : null | ||
79 | location: PlasmaCore.Types.LeftEdge | 90 | location: PlasmaCore.Types.LeftEdge | ||
80 | } | 91 | } | ||
81 | } | 92 | } |