Bug 429063 - Top panel drag to resize directions should be mirrored
Summary: Top panel drag to resize directions should be mirrored
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Panel (show other bugs)
Version: 5.20.0
Platform: Other Linux
: VHI normal
Target Milestone: 1.0
Assignee: Nate Graham
URL:
Keywords: regression, usability
: 431616 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-11-13 14:03 UTC by David Redondo
Modified: 2021-01-28 18:28 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.21


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Redondo 2020-11-13 14:03:20 UTC
SUMMARY

When dragging a top panel the directions are reversed from what is expected. Same for a right panel

OBSERVED RESULT
Dragging down makes the panel smaller, dragging up makes the panel bigger.

EXPECTED RESULT
Dragging inwards should make the panel always bigger, dragging to the screen edges smaller
Comment 1 Nate Graham 2020-11-13 14:03:52 UTC
Yeah.
Comment 2 Bug Janitor Service 2020-11-13 16:53:33 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/222
Comment 3 Nate Graham 2020-11-16 21:05:42 UTC
Git commit b62ed146e0c9b5cf9b69ae3c194f8614ab61c23e by Nate Graham.
Committed on 16/11/2020 at 21:05.
Pushed by ngraham into branch 'master'.

[panel] Fix dragging panel to resize for top and right panels

Previously, dragging up or right was always required to increase the
value of the spinbox and hance increase the thickness of the panel.
This makes sense for bottom and left panels, but is inverted for top
and right panels.

This commit reverses the stepSize when using a top or right panel, which
has the result that you can now always drag the SpinBox in the direction
of where you want the panel to resize no matter which screen edge the
panel is on.
FIXED-IN: 5.20.4

M  +5    -1    desktoppackage/contents/configuration/panelconfiguration/ToolBar.qml

https://invent.kde.org/plasma/plasma-desktop/commit/b62ed146e0c9b5cf9b69ae3c194f8614ab61c23e
Comment 4 Nate Graham 2020-11-16 21:06:36 UTC
Git commit bf7d64b37479c40ad137b9e2a38c35032c2ff66e by Nate Graham.
Committed on 16/11/2020 at 21:06.
Pushed by ngraham into branch 'Plasma/5.20'.

[panel] Fix dragging panel to resize for top and right panels

Previously, dragging up or right was always required to increase the
value of the spinbox and hance increase the thickness of the panel.
This makes sense for bottom and left panels, but is inverted for top
and right panels.

This commit reverses the stepSize when using a top or right panel, which
has the result that you can now always drag the SpinBox in the direction
of where you want the panel to resize no matter which screen edge the
panel is on.
FIXED-IN: 5.20.4


(cherry picked from commit b62ed146e0c9b5cf9b69ae3c194f8614ab61c23e)

M  +5    -1    desktoppackage/contents/configuration/panelconfiguration/ToolBar.qml

https://invent.kde.org/plasma/plasma-desktop/commit/bf7d64b37479c40ad137b9e2a38c35032c2ff66e
Comment 5 Nate Graham 2020-12-26 15:28:39 UTC
Re-opening since the fix was reverted. See Bug 430050.

I'm copying David Edmundson's comment over there about options to fix this without regressions:




In terms of moving forward and options within the current code.

Option 1:
Go with your original patch in frameworks. This must remain an exception and not a rule.

Guard usage on the client side with

` 
Component.onCompleted: if (self.hasOwnProperty("reverseDragAndScrollDirections")) {
self.reverseDragAndScrollDirections = true;
}
`
so it's backportable and won't break when we move to generic styles.
and drop the stepSize change

Option 2:
Same but in reverse. Have the style query `control.hasOwnProperty("reverseDragAndScrollDirections") && control.reverseDragAndScrollDirections`

Then declare that as a new property in the panel's spinbox.
It'd be closer to how Breeze does additional things from widget controls

Option3:
Spinbox.down.indicator is public API, we can re-implement the relevant FrameSVG code, but swap the +/-
and keep the current negative stepsize

Option4:
override contentItem inside the panel
and keep the current negative stepsize
Comment 6 Justin Zobel 2021-01-12 00:40:24 UTC
Adding myself to CC.
Comment 7 Nate Graham 2021-01-15 02:51:00 UTC
*** Bug 431616 has been marked as a duplicate of this bug. ***
Comment 8 Nate Graham 2021-01-15 02:51:42 UTC
Migrating David E's comment:


In terms of moving forward and options within the current code.

Option 1:
Go with your original patch in frameworks. This must remain an exception and not a rule.

Guard usage on the client side with

` 
Component.onCompleted: if (self.hasOwnProperty("reverseDragAndScrollDirections")) {
self.reverseDragAndScrollDirections = true;
}
`
so it's backportable and won't break when we move to generic styles.
and drop the stepSize change

Option 2:
Same but in reverse. Have the style query `control.hasOwnProperty("reverseDragAndScrollDirections") && control.reverseDragAndScrollDirections`

Then declare that as a new property in the panel's spinbox.
It'd be closer to how Breeze does additional things from widget controls

Option3:
Spinbox.down.indicator is public API, we can re-implement the relevant FrameSVG code, but swap the +/-
and keep the current negative stepsize

Option4:
override contentItem inside the panel
and keep the current negative stepsize
Comment 9 David Redondo 2021-01-28 15:05:56 UTC
Maybe instead of reimplementing the controls we could add own scroll and dragHandlers?
Comment 10 Bug Janitor Service 2021-01-28 16:23:49 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/333
Comment 11 David Redondo 2021-01-28 18:19:44 UTC
Git commit bca6d228cc7a45e8294e88e5f44600193da551e7 by David Redondo.
Committed on 28/01/2021 at 16:21.
Pushed by davidre into branch 'master'.

Fix drag directions for  top and right panels

We can use a dragHandler and depending on the edge and direction  do the right
thing. By taking over from anything but not alowwing taking over the DragHandler
in the style doesn't interfere with us.

M  +29   -1    desktoppackage/contents/configuration/panelconfiguration/ToolBar.qml

https://invent.kde.org/plasma/plasma-desktop/commit/bca6d228cc7a45e8294e88e5f44600193da551e7
Comment 12 David Redondo 2021-01-28 18:21:02 UTC
Git commit 40be77a06cac85ffd496ea77e3b19e093b872eaf by David Redondo.
Committed on 28/01/2021 at 18:20.
Pushed by davidre into branch 'Plasma/5.21'.

Fix drag directions for  top and right panels

We can use a dragHandler and depending on the edge and direction  do the right
thing. By taking over from anything but not alowwing taking over the DragHandler
in the style doesn't interfere with us.


(cherry picked from commit bca6d228cc7a45e8294e88e5f44600193da551e7)

M  +29   -1    desktoppackage/contents/configuration/panelconfiguration/ToolBar.qml

https://invent.kde.org/plasma/plasma-desktop/commit/40be77a06cac85ffd496ea77e3b19e093b872eaf