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

Authored by kmaterka on Mar 21 2020, 11:01 AM.

Details

Summary

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

Diff Detail

Repository
R120 Plasma Workspace
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
kmaterka created this revision.Mar 21 2020, 11:01 AM
Restricted Application added a subscriber: plasma-devel. · View Herald TranscriptMar 21 2020, 11:01 AM
kmaterka requested review of this revision.Mar 21 2020, 11:01 AM
kmaterka added inline comments.Mar 21 2020, 11:02 AM
applets/systemtray/package/contents/ui/ExpanderArrow.qml
31

ideally root.hiddenLayout.count should be used, but count is not updated until ListView is rendered.

This works, but I wonder if there's a conceptually cleaner way to do it. Not that I know of one, so I'll wait for a Plasma person to comment.

Oh and thanks for the code comments. Always very helpful!

This works, but I wonder if there's a conceptually cleaner way to do it. Not that I know of one, so I'll wait for a Plasma person to comment.

Yes, this code looks smelly, but I don't have better idea now.

Anyone can take a look and help with this?

ngraham edited the summary of this revision. (Show Details)May 7 2020, 2:06 PM

Plasma ping

I would suggest we add a count property with a NOTIFY signal on the model which is then updated on C++ side? I find that cleaner than doing that from QML like this

Ah, right, we just use the sort filter model, no model from C++. Meh, so I can't think of a better way right now either..

broulik accepted this revision.May 7 2020, 2:14 PM
This revision is now accepted and ready to land.May 7 2020, 2:14 PM
davidedmundson accepted this revision.May 7 2020, 2:19 PM
This revision was automatically updated to reflect the committed changes.