[KCM] Disallow dropping screen outside of reachable area
AbandonedPublic

Authored by broulik on Oct 16 2019, 8:08 AM.

Details

Reviewers
romangg
Group Reviewers
Plasma
VDG
Summary

In the old KCM it was annoying that you couldn't drag screens outside when arranging them. However, in the new KCM you can lose the screens outside visible boundaries and only get them back by clicking "Center View".
This patch ensures that when *dropping* a screen, a corner of it stays visible so you can drag it back. Movement while dragging remains unrestricted.

Test Plan

5.17?
This is the furthest I can drag a screen out.

Diff Detail

Repository
R104 KScreen
Lint
Lint Skipped
Unit
Unit Tests Skipped
broulik created this revision.Oct 16 2019, 8:08 AM
Restricted Application added a project: Plasma. · View Herald TranscriptOct 16 2019, 8:08 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
broulik requested review of this revision.Oct 16 2019, 8:08 AM
mart added a subscriber: mart.Oct 16 2019, 8:50 AM
mart added inline comments.
kcm/package/contents/ui/Screen.qml
83

magic numbers?

broulik added inline comments.Oct 16 2019, 8:51 AM
kcm/package/contents/ui/Screen.qml
83

Suggestions?

ngraham added inline comments.
kcm/package/contents/ui/Screen.qml
83

IMO magic numbers are probably okay here, but 20 is pretty similar to GridUnit so maybe just use multiples of that instead?

broulik updated this revision to Diff 68125.Oct 17 2019, 12:40 PM
  • No magic numbers

There was also the idea to drop the Center View button and instead resize the view whenever an output is dropped to a different position. I feel this would be also a more elegant solution for the issue trying to be solved here, if we agree that this would be in general a good idea. Do we? @ngraham: I mean I talked about this with you.

That could also work, however the view wastes a lot of space right now, the screens could be a lot bigger, if we were to auto-zoom.

+1 for auto-zoom and making the screens bigger. Then we can remove the buttons that centers the view too.

So, what about this now? Or is there an auto scale patch anywhere?

broulik abandoned this revision.Mon, Nov 11, 10:53 AM