Commit b34e88da authored by Konrad Materka's avatar Konrad Materka
Browse files

[applets/systemtray] Hide/show expander arrow - regression fix

Expander arrow should hide when all icons are visible and no icon is hidden. When dialog with hidden items is hidden ListView does not update its count property - property is update on redraw. As a result expander arrow is still visible/hidden until user clicks on any plasmoid to show dialog.

BUG: 420924

Test Plan:
* select/deselect "Show all items" in settings, save, expander arrow should hide/show imidiatelly
* select almost all items to "Always shown", leave "Keyboard indicator" as "Shown when relevant". Press Casp Lock, expander arrow should hide/show correctly

Reviewers: #plasma_workspaces, #plasma, ngraham, broulik, davidedmundson

Reviewed By: #plasma_workspaces, #plasma, broulik, davidedmundson

Subscribers: plasma-devel

Tags: #plasma

Differential Revision:
parent ce6a0ec0
......@@ -28,7 +28,7 @@ PlasmaCore.ToolTipArea {
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")
......@@ -56,6 +56,7 @@ MouseArea {
highlightResizeDuration: 0
readonly property int iconItemHeight: root.hiddenItemSize + + highlight.marginHints.bottom
property int itemCount: model.rowCount()
model: PlasmaCore.SortFilterModel {
sourceModel: plasmoid.nativeInterface.systemTrayModel
......@@ -68,6 +69,16 @@ MouseArea {
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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment