Add a widget gallery page to the Dashboard.
ClosedPublic

Authored by hein on Oct 30 2016, 12:43 AM.

Details

Summary

This is one of the tasks on the Plasma 5.9 release todo, as
agreed at the kick-off meeting. Dashboard is about enabling
an alternative fullscreen workflow for people who want one,
and this extends the coverage to widget management. It's also
a widget management workflow many people are used to from
their phone.

This is quite early code, but already works fairly nicely.
There's even polish like pre-loading the widget explorer model
as soon as the tab is hovered to speed up the tab switch, and
keyboard nav is working, too.

I would like to get it reviewed now and merged once egregious
technical founds are identified and eliminated. Please don't
be too picky on the visual or even workflow details - one
reason I want it merged early is so that I can get it into
the VDG's hands via Neon for advice, and also because I want
people to spend some time using it in general. It's early
enough in the 5.9 cycle to iterate more.

In addition to the attached screenshot, here is a video demo:
https://www.youtube.com/watch?v=ajIzfU0eJtI

Diff Detail

Repository
R119 Plasma Desktop
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
hein updated this revision to Diff 7751.Oct 30 2016, 12:43 AM
hein retitled this revision from to Add a widget gallery page to the Dashboard..
hein updated this object.
hein edited the test plan for this revision. (Show Details)
hein added a reviewer: Plasma.
hein added a subscriber: plasma-devel.
Restricted Application added a project: Plasma. · View Herald TranscriptOct 30 2016, 12:43 AM
hein added a comment.Oct 30 2016, 12:44 AM

Screenshot.

mart added a subscriber: mart.Nov 1 2016, 11:55 AM
mart added inline comments.
applets/kicker/package/contents/ui/DashboardRepresentation.qml
56

any reason for the odd specificity of 0.737? and, seems an unrelated change with adding a widget gallery?

529

this is not directly related to this review in particular but i see it in several places in this file and should be paid attention to: if the opacity is being animated, this line is going to be quite heavy, as well asproperty bindings on conditions on opacity, like for enabled and z just there, that would cause a lot of slot invocations during the animation, and is easily avoided.

applets/kicker/plugin/containmentinterface.h
52

i think it could well use the immutability properties of plasmoid.. as it tries hard to have a single immutability for the whole shell (and i would like to keep it that way) tough if you feel safer to check the property on the final containment, fine

applets/kicker/plugin/dashboardwindow.h
52

seems an unrelated change?

hein marked 3 inline comments as done.Nov 1 2016, 12:00 PM
hein added inline comments.
applets/kicker/package/contents/ui/DashboardRepresentation.qml
56

No, it's the equivalent of the hardcoded RGB triplet that was in the C++ code before. I decided to move it into QML as part of the widget gallery change because the tab button background colors relate to the background color, so I wanted all three colors in the presentation/QML code.

529

Good point, what style do you suggest?

applets/kicker/plugin/containmentinterface.h
52

Mostly because the Widget Explorer model takes a containment assignment to work, and I don't know what that code does (or will do in the future) if passed an immutable containment, so it seemed safer.

applets/kicker/plugin/dashboardwindow.h
52

See earlier explanation :)

mart accepted this revision.Nov 1 2016, 12:04 PM
mart added a reviewer: mart.
mart added inline comments.
applets/kicker/package/contents/ui/DashboardRepresentation.qml
529

to be done in a separate commit, but to me it suggests a state machine should be used.
even with just two states, but opacity, z and enabled would be PropertyChanges and opacity would have a transition set on it

applets/kicker/plugin/containmentinterface.h
52

ok

This revision is now accepted and ready to land.Nov 1 2016, 12:04 PM
hein updated this revision to Diff 7801.Nov 1 2016, 12:17 PM
hein marked 3 inline comments as done.
hein edited edge metadata.

Don't show the tab bar if the system is immutable.

davidedmundson added inline comments.
applets/kicker/package/contents/ui/DashboardRepresentation.qml
101

I don't get why we are we creating this dynamically? and why on hover?

I assume it's because WE is costly? and doing it on hover makes it seem faster?

but this code has a quirk that if you hover and then click (a fairly common pattern) you'll actually be creating this component twice.

A Loader with: active: activeTab == 1 || hoveredTab ==1 would be ideal and more declarative.

180

It's better to just adjust Widget Explorer if we need to add functionality into WidgetExplorer

Doing something like this is the sort of thing that's going to unnoticeably break in the future when someone re-arranges those categories.

applets/kicker/package/contents/ui/DashboardTabBar.qml
30

for every mouse move you have two of these being emitted in sequence

one from the old tab, one from the new tab.

Can you be guarantee what order that happens in?

This revision was automatically updated to reflect the committed changes.
hein marked 2 inline comments as done.Nov 1 2016, 12:36 PM
hein added inline comments.
applets/kicker/package/contents/ui/DashboardRepresentation.qml
101

Good catch thanks, fixed in follow-up commit.

About not using a Loader: I need guaranteed ordering between the component instanciation and reset() being called in onActiveTabChanged, but I'm also instanciating on hover, when calling reset() is inappropriate. Using a Loader and Component.onCompleted isn't good enough, because the handler wouldn't have the "why" information needed to decide whether to call reset() or not. Ultimately going procedural was a tad easier here, even if it suffers the decentralization cost.

180

Agreed, will look into it (I didn't like it much while writing ...).

applets/kicker/package/contents/ui/DashboardTabBar.qml
30

Yeah, the leave/enter ordering is reliable and unit-tested in Qt (I remember from working on the hover code in Qt Quick).

broulik added a subscriber: broulik.Nov 1 2016, 2:18 PM

Sorry for being late to the party

applets/kicker/package/contents/ui/DashboardRepresentation.qml
102

Would it help if you pass the containment to the createObject call to avoid some re-evaluation?

root.widgetExplorer = widgetExplorerComponent.createObject(root, {
    containment: containmentInterface.screenContainment(plasmoid)
})
applets/kicker/plugin/containmentinterface.h
53

Note that you cannot unlock widgets if kiosk restrictions (SystemImmutable) apply in which case this entire feature should be disabled or else you open a neat way for users to screw with a locked-down desktop.

hein marked 4 inline comments as done.Nov 1 2016, 2:22 PM
hein added inline comments.
applets/kicker/package/contents/ui/DashboardRepresentation.qml
102

Doesn't hurt, will do.

applets/kicker/plugin/containmentinterface.h
53

Yep, note the review update that added a SystemImmutable check hiding the tab bar (and thus the entire feature).