[RFC] Ordered system tray v2
AbandonedPublic

Authored by Pitel on Mar 13 2018, 5:31 PM.

Details

Reviewers
None
Group Reviewers
Plasma
VDG
Summary

My try at ordered system try heavily inspired by D11233.

Features (and problems):

  • the main intention was to keep code as simple as possible
  • items can be reordered by drag & drop and removed from config by dragging into trash bin
  • item list is by design loaded only at opening settings dialog (doing on-the-fly updates seems complicated for very little gain)
  • new items are added at right end of systray and remeber their position (so the first start the order will be random but on subsequent starts the order will remain the same, any solutions? I tried patch proposed in B383828 and after closing setting it does not crash anymore but systray goes crazy -- applets no longer react to clicking)
  • all this is backed by only one new config option itemOrder of type StringList
  • items currently not existent are displayed in italics (and without icon because there is nowhere to get it)
  • now also all status notifier items are always in italics because I removed using statusNotifierModel from setting which solves crash after closing setting (and ugly > crash)
  • contains an ugly hack to workaround ComboBox'es going crazy when TableView model is changed (I have no clue what causes this, only than currentItem binding is not to blame)
  • the drag & drop support was adapted from R884 (most notably OrderedItem.qml comes from there and was only lightly modified)

Any comments or ideas are welcome.

Diff Detail

Repository
R120 Plasma Workspace
Branch
stableSystray
Lint
No Linters Available
Unit
No Unit Test Coverage
Pitel created this revision.Mar 13 2018, 5:31 PM
Restricted Application added a project: Plasma. · View Herald TranscriptMar 13 2018, 5:31 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
Pitel requested review of this revision.Mar 13 2018, 5:31 PM
Pitel edited the summary of this revision. (Show Details)Mar 13 2018, 5:34 PM
Pitel edited the summary of this revision. (Show Details)Mar 13 2018, 6:18 PM
This comment was removed by 7hdk8g5b.
Pitel added a comment.Mar 13 2018, 7:01 PM

I am aware of getFixedItemId, only forgot to mention it in summary. Right now it is not included mostly because it is another hack (but fixing stupid behavior of someone else so unavoidable) and I do not use DropBox, but if this gets any closer to landing, we should reintroduce it.

This comment was removed by 7hdk8g5b.
anthonyfieroni added inline comments.
applets/systemtray/package/contents/ui/ConfigEntries.qml
150–159

Commented code is not allowed to get in, you should decide it's needed or not.

FWIW, the crash you're referring to is also fixed with an up-to-date (not released yet) Qt.

Pitel added a comment.Mar 13 2018, 9:05 PM

FWIW, the crash you're referring to is also fixed with an up-to-date (not released yet) Qt.

If you are referring to https://codereview.qt-project.org/#/c/222250/ I tried patching my Qt with it and it prevents the crash but after closing settings the systray starts to misbehave instead. Qml reports a lot of TypeError's in AbstractItem.qml in assignment:

onContainsMouseChanged: {
    if (hidden && containsMouse) {
        root.hiddenLayout.hoveredItem = abstractItem
    }
}

And plasmoids in systray stop responding to mouse clicks or expand inside of systray (like if some objects got reparented wrong?).

But that might be result of me cherry-picking one patch on top of 5.9.4 qt...

This comment was removed by 7hdk8g5b.
zzag added a subscriber: zzag.Mar 14 2018, 3:59 AM
Pitel updated this revision to Diff 29457.Mar 14 2018, 6:46 AM
  • modified onConfigurationChanged so it triggers updates of properties depending on cfg_shownItems and cfg_hiddenItems
  • make trash bin not draggable
  • removed ComboBox hack (which was not working anyway) and added an overlay label to combobox showing S for items in cfg_shownItems and H for items in cfg_hiddenItems (this is meant as debugging tool only) -- when dragging the visibility values in comboboxes go wrong but those letter remain correct which leads me to conclusion that the problem is ComboBox component (@wsdfhjxc can you verify this behavior?)
This comment was removed by 7hdk8g5b.
applets/systemtray/package/contents/ui/ConfigEntries.qml
201
height: measureButton.height
319
Rectangle {
    SystemPalette {
        id: sysPalette
        colorGroup: SystemPalette.Active
    }
                
    color: sysPalette.mid
    opacity: 0.85
    anchors.fill: parent
}
328
icon: "albumfolder-user-trash"
This comment was removed by 7hdk8g5b.
mart added a subscriber: mart.Mar 15 2018, 10:23 AM

i'm still against this, but in favor of just forcing sort by type and alphabetic

To compare with auto ordering (as @mart would like) see D11352.

Pitel abandoned this revision.Mar 21 2018, 12:41 PM

Replaced by D11352.