applets/taskmanager: correct for initial spacer in RtL

Reason for the change

  • applets/taskmanager: correct for initial spacer in RtL

If a horizontal task manager is set to RtL (either from the locale or from the widget's reverse setting), the option to fill the available space will place this extra space at the front of the widget, rather than at the end (as in LtR orientations). This space is part of the widget, but not of the GridLayout. When doing drag&drop reordering of the entries, we look up the mouse coordinates in the GridLayout to find where we should put things. These coordinates are in the widget's coordinate system. This breaks rather badly, as our attempts to look up the correct position are shifted to the right by the extra space.

Instead, we subtract the difference between widget width and layout width from the mouse X coordinate if the TaskList is RtL. This gives us the correct X position for vertical panels, and does nothing on vertical or non-filling widgets (as both have the same width, so the adjustment is zero anyway).

Test plan

Have a horizontal default panel.

plasmashell --reverse

Open a few apps (but make sure to keep enough free space between task manager and tray)

Try to reorder the apps with drag&drop

Screenshots or screen recordings

On request

Bugs fixed

BUG: 504898 FIXED-IN: 6.7.5

Merge request reports

Loading
Loading