diff --git a/applets/systemtray/package/contents/ui/ExpanderArrow.qml b/applets/systemtray/package/contents/ui/ExpanderArrow.qml --- a/applets/systemtray/package/contents/ui/ExpanderArrow.qml +++ b/applets/systemtray/package/contents/ui/ExpanderArrow.qml @@ -28,7 +28,7 @@ property bool vertical: plasmoid.formFactor === PlasmaCore.Types.Vertical implicitWidth: units.iconSizes.smallMedium implicitHeight: implicitWidth - visible: root.hiddenLayout.count > 0 + visible: root.hiddenLayout.itemCount > 0 subText: root.expanded ? i18n("Close popup") : i18n("Show hidden icons") diff --git a/applets/systemtray/package/contents/ui/HiddenItemsView.qml b/applets/systemtray/package/contents/ui/HiddenItemsView.qml --- a/applets/systemtray/package/contents/ui/HiddenItemsView.qml +++ b/applets/systemtray/package/contents/ui/HiddenItemsView.qml @@ -56,6 +56,7 @@ highlightResizeDuration: 0 readonly property int iconItemHeight: root.hiddenItemSize + highlight.marginHints.top + highlight.marginHints.bottom + property int itemCount: model.rowCount() model: PlasmaCore.SortFilterModel { sourceModel: plasmoid.nativeInterface.systemTrayModel @@ -68,6 +69,16 @@ } } + Connections { + target: hiddenTasksColumn.model + // hiddenTasksColumn.count is not updated when ListView is hidden and is not rendered + // manually update itemCount so that expander arrow hides/shows itself correctly + onModelReset: hiddenTasksColumn.itemCount = hiddenTasksColumn.model.rowCount() + onRowsInserted: hiddenTasksColumn.itemCount = hiddenTasksColumn.model.rowCount() + onRowsRemoved: hiddenTasksColumn.itemCount = hiddenTasksColumn.model.rowCount() + onLayoutChanged: hiddenTasksColumn.itemCount = hiddenTasksColumn.model.rowCount() + } + PlasmaComponents.Highlight { id: highlight visible: false