From 473ee3b3b0ce09feb23afcfc0ff276986db4f1af Mon Sep 17 00:00:00 2001 From: Eugene Paskevich Date: Sun, 4 Nov 2018 21:45:07 +0200 Subject: [PATCH] Qt: don't let the volume slider go beyong upper and/or left screen boundaries. --- src/libaudqt/volumebutton.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libaudqt/volumebutton.cc b/src/libaudqt/volumebutton.cc index e9144cb60..71edf16a1 100644 --- a/src/libaudqt/volumebutton.cc +++ b/src/libaudqt/volumebutton.cc @@ -134,7 +134,9 @@ void VolumeButton::showSlider () int dy = container_size.height () / 2 - button_size.height () / 2; QPoint pos = mapToGlobal (QPoint (0, 0)); - pos += QPoint (-dx, -dy); + pos -= QPoint (dx, dy); + pos.setX(qMax(pos.x(), 0)); + pos.setY(qMax(pos.y(), 0)); m_container->move (pos); window_bring_to_front (m_container);