Another post on devicenotifier :), so let me introduce his shiny new look:
The code derives directly from the kickoff delegate (with some fixes to RTL layouts), but the interesting part is that it has been pushed in libplasma, so all listviews in plasma that works like a menu can use it and have a consistent look (At the moment kickoff is still independent but i will port it shortly)
This will make possible for third party applets that wants to have a listview/menu that is well integrated into plasma without much hassle.
To use it you must use the new Plasma::Delegate class (or a subclass of it) and either use the roles that Plasma::delegate defines or if you can’t modify the model, use its function setRole(internalrole, yourrole) to map a role of the model to a role of Plesma::Delegate
If you want to paint additional data into an item you can subclass the delegate, and in the paint function calling Plasma::Delegate::paint and then paint the additional things in the space left empty that you can retrieve with the functions rectAfterTitle, rectAfterSubTitle and emptyRect.
That’s it 😀