support global edit mode
ClosedPublic

Authored by mart on Sep 27 2019, 3:01 PM.

Details

Summary

desktop and panel toolboxes are only visible in "edit mode"
edit mode can be triggered by

  • long press in desktop
  • context menu action
  • dbus property (to be eventually used by systemsettings)

The desktop toolbox becomes a "toolbar" with just few selected actions
the presence of that toolbar both fullfills "long press should usually show some
contextual actions" and being a very visible hint that "we are now in edit mode"
toolbox is still movable around in case would obscure any important stuff where it's
by default

Depends on D24263
Depends on D24264
Closes T10402

Test Plan

ui works as planned, toolbox position is saved and restored correctly

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.
There are a very large number of changes, so older changes are hidden. Show Older Changes
Restricted Application added a project: Plasma. · View Herald TranscriptSep 27 2019, 3:01 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
mart requested review of this revision.Sep 27 2019, 3:01 PM
mart added a comment.Sep 27 2019, 3:12 PM

still has the problem of long press not working with the folderview layout (stolen events) will look into that

GB_2 added a subscriber: GB_2.Sep 27 2019, 3:19 PM

Nice! I guess D23951 is still relevant?

mart added a comment.Sep 27 2019, 3:25 PM

yes, it's completely ortogonal to that one

ngraham added inline comments.
toolboxes/desktoptoolbox/contents/ui/ToolBoxButton.qml
222

Locking the widgets while in edit mode doesn't update the menu item, so it's possible to end up in this state:

mart marked an inline comment as done.Sep 30 2019, 9:01 AM
mart added inline comments.
toolboxes/desktoptoolbox/contents/ui/ToolBoxButton.qml
222

latest revision should fix that

mart marked an inline comment as done.Sep 30 2019, 10:01 AM
mart added inline comments.
toolboxes/desktoptoolbox/contents/ui/ToolBoxButton.qml
222

actually, revision of D24263

mart updated this revision to Diff 67069.Sep 30 2019, 1:41 PM
  • state machine for right order of opacity and visible
mart updated this revision to Diff 67186.EditedOct 2 2019, 1:16 PM

use eventManagerToFilter

mart updated this revision to Diff 67189.Oct 2 2019, 1:48 PM
  • don't raise the icons over the toolbox
GB_2 added a comment.Oct 3 2019, 12:02 PM

A few bugs I found:

  • when you open the desktop context menu it enters the edit mode automatically (probably because it thinks you still click)
  • after closing the panel controller or "Add Widgets..." sidebar it closes the edit mode too
mart added a comment.Oct 7 2019, 4:55 PM
In D24265#541411, @GB_2 wrote:

A few bugs I found:

  • when you open the desktop context menu it enters the edit mode automatically (probably because it thinks you still click)

gah, yet another bug of the folderview mode :/

  • after closing the panel controller or "Add Widgets..." sidebar it closes the edit mode too

hmm, not sure it's a bad thing, it all makes this mode to automatically exit.. which makes it almost a "quasimode", countering a bit the evils of being a modal ui

mart added a comment.Oct 8 2019, 5:20 PM
In D24265#541411, @GB_2 wrote:
  • when you open the desktop context menu it enters the edit mode automatically (probably because it thinks you still click)

with latest version of D24264 this shouldn't happen anymore

GB_2 added a comment.Oct 8 2019, 5:32 PM
In D24265#543173, @mart wrote:

hmm, not sure it's a bad thing, it all makes this mode to automatically exit.. which makes it almost a "quasimode", countering a bit the evils of being a modal ui

When you are done editing a panel or adding a widget and then still want to edit another panel or just close the add widgets sidebar then I don't want to have to go back into edit mode after that, it would be quite annoying to do that. I think it should only finish the customization when the user decides he is done, that's what the menu item implies. Finishing the customization and exiting the mode if you still want to do more would be unexpected. Thoughts VDG?

I would tend to agree. If we feel that it's too difficult to exit this mode, maybe we should make it more obvious, like changing the X button in the toolbox to a toolbutton with the "finish editing" text.

GB_2 added a comment.EditedOct 8 2019, 5:35 PM

I would tend to agree. If we feel that it's too difficult to exit this mode, maybe we should make it more obvious, like changing the X button in the toolbox to a toolbutton with the "finish editing" text.

+1. Maybe also the apply icon in both the toolbutton with label and the menu item.

mart added a comment.EditedOct 9 2019, 8:58 AM

this happens because some other window and not the desktop gets focus (that behavior is in somewhere deep in kwin and makes sense). If no other app windows are visible, the focus stays on the desktop and stays in edit mode
Would you keep edit mode active when the focus goes to another app?
I'm very hesitant about that as i wouldn't like that behavior that much...

A thing that i would prefer prefer to it is to trigger "show desktop" when you go in edit mode (and going out of show desktop when going out of edit mode, then the mode becomes suuper obvious)

GB_2 added a comment.Oct 9 2019, 9:34 AM
In D24265#544016, @mart wrote:

this happens because some other window gets focus (that behavior in somewhere deep in kwin and i think makes sense).
Would you keep edit mode active when the focus goes to another app? I'm very hesitant about that and don't really like the concept...

If it's not really solvable then yes, only exit the edit mode after you press "Finish customizing layout", that would be much better than having to re-enter edit mode every time if you want do more than 1 different thing (which is common if you really want to customize your complete desktop layout). You can easily exit it if you are done too, so I don't think it would be a problem.

mart added a comment.Oct 9 2019, 9:35 AM

I would tend to agree. If we feel that it's too difficult to exit this mode, maybe we should make it more obvious, like changing the X button in the toolbox to a toolbutton with the "finish editing" text.

The x is well obvious enough without cluttering with even more long text, but I do like to just start using an application (which means: my locus of attention is not on the shell anymore) and not have a stray mode there tough which i can forget about it being active, maybe the window has even been maximized, making it easier to forget about it even (Air France Flight 447)

mart added a comment.Oct 9 2019, 3:14 PM

latest version of D24264 does show the desktop when in edit mode (and as sideeffect edit mode doesn't close when the widget explorer is closed)

ngraham requested changes to this revision.EditedOct 9 2019, 3:42 PM

Hmm, I have some UX concerns here after trying it out:

If I invoke Present Windows to see the desktop so that I can right-click on it to enter edit mode, when I exit the mode, all the windows return again unexpectedly. Exiting edit mode should only restore the windows if the Present Windows effect was invoked by entering edit mode, not if the effect was already invoked manually by the user.

While in Edit mode, if I click on the desktop, it exits edit mode. This feels very unnatural and I find myself accidentally exiting the mode a lot. I think it makes sense to automatically exit the mode when another application is focused, but not the Plasma desktop itself.

If we're eventually going to hide the "Lock Widgets" functionality from the context menu, we need to remove it from the toolbox as well, or else you can enter edit mode, lock widgets, and be unable to re-enter edit mode because the menu item to do it is disabled when widgets are locked (maybe this should be in another patch though?)

This revision now requires changes to proceed.Oct 9 2019, 3:42 PM
mart added a comment.Oct 10 2019, 8:12 AM

Hmm, I have some UX concerns here after trying it out:

If I invoke Present Windows to see the desktop so that I can right-click on it to enter edit mode, when I exit the mode, all the windows return again unexpectedly. Exiting edit mode should only restore the windows if the Present Windows effect was invoked by entering edit mode, not if the effect was already invoked manually by the user.

eh. that's potentially a problem. not sure how to do that.

While in Edit mode, if I click on the desktop, it exits edit mode. This feels very unnatural and I find myself accidentally exiting the mode a lot. I think it makes sense to automatically exit the mode when another application is focused, but not the Plasma desktop itself.

I actually like that a lot, to me is really the click anywhere to dismiss pattern all over the place in modal dialogs, websites and what not.
If I have to remove it, i would at least keep it for touch events, as i really want it in plasma mobile (and is harder to exit from edit mode there)

In D24265#544549, @mart wrote:

I actually like that a lot, to me is really the click anywhere to dismiss pattern all over the place in modal dialogs, websites and what not.
If I have to remove it, i would at least keep it for touch events, as i really want it in plasma mobile (and is harder to exit from edit mode there)

I'm okay keeping it on Plasma Mobile. To me it feels out of place on desktop because I don't have a mental model that clicking on the desktop does something like this and I do it a lot. :)

mart added a comment.Oct 11 2019, 10:38 AM
In D24265#544549, @mart wrote:

I actually like that a lot, to me is really the click anywhere to dismiss pattern all over the place in modal dialogs, websites and what not.
If I have to remove it, i would at least keep it for touch events, as i really want it in plasma mobile (and is harder to exit from edit mode there)

I'm okay keeping it on Plasma Mobile. To me it feels out of place on desktop because I don't have a mental model that clicking on the desktop does something like this and I do it a lot. :)

tough i think then it should be there also for pure touch events as well (as opposed to clicks)

As any change i'll do in plasma is primarly be in the direction of making touch a first class citizen on normal plasma shell

In D24265#545274, @mart wrote:

tough i think then it should be there also for pure touch events as well (as opposed to clicks)

As any change i'll do in plasma is primarly be in the direction of making touch a first class citizen on normal plasma shell

Sure, no objection to that.

mart added a comment.Oct 11 2019, 2:55 PM

does that on current version of D24264

GB_2 added a comment.Oct 11 2019, 2:56 PM

It would be nice if the desktop toolbox had a shadow and had the standard background.

In D24265#545400, @GB_2 wrote:

It would be nice if the desktop toolbox had a shadow and had the standard background.

Yeah.

mart added a comment.Oct 11 2019, 3:14 PM
In D24265#545400, @GB_2 wrote:

It would be nice if the desktop toolbox had a shadow and had the standard background.

it has, as it has the standard background of plasmoids (is not a window, so it can't technically look like popups)

mart added a comment.Oct 11 2019, 4:06 PM

hold on, there is some clipping going on actually

mart updated this revision to Diff 67719.Oct 11 2019, 4:19 PM
  • proper plasmoid background
mart added a comment.Oct 11 2019, 4:20 PM

proper look now

ngraham accepted this revision.Oct 11 2019, 4:26 PM

LGTM now!

This revision is now accepted and ready to land.Oct 11 2019, 4:26 PM
GB_2 added a comment.EditedOct 12 2019, 1:43 PM

This works very well now except for the vertical desktop toolbox. I don't think being able to have a vertical toolbox is practical, you can't really read the button labels and it's also glitching around when switching between horizontal and vertical mode. I think just having a horizontal toolbox that can be moved anywhere on the screen would be the best solution.

GB_2 added inline comments.Oct 12 2019, 2:11 PM
toolboxes/desktoptoolbox/contents/ui/ToolBoxButton.qml
236

This should probably be changed to "Finish Customizing Layout" to match the current menu entry.

GB_2 added a comment.Oct 12 2019, 2:30 PM

BTW, it would also be nice to have click and hold on the panel to open the panel controller toolbox :-)

mart added a comment.Oct 14 2019, 9:22 AM
In D24265#546025, @GB_2 wrote:

BTW, it would also be nice to have click and hold on the panel to open the panel controller toolbox :-)

maybe. Ii feel it kinda overkill

mart updated this revision to Diff 67898.Oct 14 2019, 1:16 PM
  • don't auto close edit mode
mart updated this revision to Diff 67899.Oct 14 2019, 1:26 PM
  • get rid of the vertical mode
In D24265#545990, @GB_2 wrote:

This works very well now except for the vertical desktop toolbox. I don't think being able to have a vertical toolbox is practical, you can't really read the button labels and it's also glitching around when switching between horizontal and vertical mode. I think just having a horizontal toolbox that can be moved anywhere on the screen would be the best solution.

now in the latest version i completely killed the vertical mode, simpler stuff now

GB_2 added a comment.EditedOct 18 2019, 8:42 AM

Only one last issue: the widget resizing handles disappear if the cursor is on a blank area of the widget handle (the bar to the left/right).

toolboxes/desktoptoolbox/contents/ui/ToolBoxButton.qml
236

Not done.

GB_2 added a comment.Oct 18 2019, 8:45 AM

An "Add Panel..." button in the toolbox would be very useful too :-)

mart added a comment.Oct 18 2019, 9:34 AM
In D24265#549583, @GB_2 wrote:

An "Add Panel..." button in the toolbox would be very useful too :-)

maybe.. tough it must have a submenus that loads the available installed panel layouts... may get messy

GB_2 added a comment.EditedOct 18 2019, 10:19 AM

I'd also add the "Customize Layout..." menu item to the widget context menu, that way you can discover it much more easily.

mart added a comment.EditedOct 18 2019, 10:53 AM
In D24265#549634, @GB_2 wrote:

I'd also add the "Customize Layout..." menu item to the widget context menu, that way you can discover it much more easily.

i would prefer not to, but can be tried with eventually in the future

GB_2 added a comment.EditedOct 18 2019, 11:28 AM

Why not? Currently you have to open the context menu for the panel or desktop, so it's inconsistent and confusing if you want to move a widget and then don't get the option to in the menu (without click+hold).

Can you explain the intended difference between top and topcenter?

toolboxes/desktoptoolbox/contents/ui/ToolBoxButton.qml
87

fix

toolboxes/desktoptoolbox/contents/ui/ToolBoxRoot.qml
42–43

fix

mart updated this revision to Diff 68235.Oct 18 2019, 12:42 PM
  • remove dead code
mart marked 2 inline comments as done.Oct 18 2019, 12:43 PM
mart added a comment.Oct 18 2019, 12:56 PM

Can you explain the intended difference between top and topcenter?

when the toolbox is at topcenter, it snaps at center screen ,and if the resolution changes it will be moved to keeping being at center.
while is it's just top, it will just do its best to keep the same absolute position (unless it has to be moved for decreased resolution

GB_2 added a comment.Oct 20 2019, 10:57 AM
In D24265#549640, @mart wrote:

i would prefer not to, but can be tried with eventually in the future

Ok, we can do that in another patch. This is fine once you address my inline comment "Not done." and fix this:

In D24265#549581, @GB_2 wrote:

Only one last issue: the widget resizing handles disappear if the cursor is on a blank area of the widget handle (the bar to the left/right).

mart updated this revision to Diff 68414.Mon, Oct 21, 10:03 AM
  • don't dismiss applet edit mode when overing the handle
GB_2 added inline comments.Mon, Oct 21, 10:12 AM
toolboxes/desktoptoolbox/contents/ui/ToolBoxButton.qml
230

Please change to "Finish Customizing Layout" to match the menu entry.

This revision was automatically updated to reflect the committed changes.
GB_2 added a comment.Wed, Oct 23, 9:10 AM
In D24265#551189, @mart wrote:
  • don't dismiss applet edit mode when overing the handle

Also happens with the resize handles :/