[Panel Containment] Fix re-arranging applets in right-to-left mode
ClosedPublic

Authored by broulik on Aug 22 2016, 7:03 PM.

Details

Summary

While dragging a widget, it is reparented to "root" so it can be moved freely without the other applets reacting on that. However, in right-to-left mode, the toolbox is on the left side, the coordinate system of the applet parented to "root" did not match with the applets in "currentLayout".

This happened to work in left-to-right as there "currentLayout" was at coordinates 0,0. Instead of manually fiddling the margins into the positioning, just reparent the widget to another Item which is anchors.fill'd to the layout (and thus has its margins) and let QML figure it out.

Moreover, mirror the flyout that shows the applet name and config/delete buttons.

Test Plan

I can now properly re-arrange widgets in a horizontal panel with

plasmashell -reverse

When the applet is over the right-most widget (Kickoff in the default case) it glitches slightly but that's still way better than placing the applet at seemingly random positions when letting go of the mouse pointer.

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.
broulik updated this revision to Diff 6152.Aug 22 2016, 7:03 PM
broulik retitled this revision from to [Panel Containment] Fix re-arranging applets in right-to-left mode.
broulik updated this object.
broulik edited the test plan for this revision. (Show Details)
broulik added reviewers: Plasma, safaalfulaij.
broulik set the repository for this revision to R119 Plasma Desktop.
Restricted Application added a project: Plasma. · View Herald TranscriptAug 22 2016, 7:03 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
broulik updated this object.Aug 22 2016, 7:03 PM
davidedmundson accepted this revision.Aug 22 2016, 7:09 PM
davidedmundson added a reviewer: davidedmundson.
This revision is now accepted and ready to land.Aug 22 2016, 7:09 PM
mart accepted this revision.Aug 22 2016, 7:17 PM
mart added a reviewer: mart.
This revision was automatically updated to reflect the committed changes.