[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-kimageshop
Subject: Multi-Screen Brush Settings Popup bug patch
From: William Steidtmann <billstei () hbci ! com>
Date: 2010-12-10 23:16:40
Message-ID: 4D02B4D8.8010303 () hbci ! com
[Download RAW message or body]
The attached patch fixes a problem when the desktop is comprised of more
than one screen (monitor). The old code was getting the geometry of the
default screen (which is not necessarily the screen where the Krita main
window is), and the new code gets the geometry of the screen which
contains the KisPopupButton widget (i.e. the button that invokes the
popup window).
William Steidtmann
["MultiScreenBrushSettingsPopupBug.patch" (text/x-patch)]
diff --git a/krita/ui/widgets/kis_popup_button.cc b/krita/ui/widgets/kis_popup_button.cc
index dddb865..b5fd1fd 100644
--- a/krita/ui/widgets/kis_popup_button.cc
+++ b/krita/ui/widgets/kis_popup_button.cc
@@ -94,10 +94,12 @@ void KisPopupButton::showPopupWidget()
QSize popSize = m_d->popupWidget->size();
QRect popupRect(this->mapToGlobal(QPoint(0, this->size().height())), popSize);
- // Make sure the popup is not drawn outside the screen area
+ // Get the available geometry of the screen which contains this KisPopupButton
QDesktopWidget* desktopWidget = QApplication::desktop();
- QRect screenRect = desktopWidget->availableGeometry(desktopWidget->screenNumber());
- if (popupRect.right() > screenRect.right())
+ QRect screenRect = desktopWidget->availableGeometry(this);
+
+ // Make sure the popup is not drawn outside the screen area
+ if (popupRect.right() > screenRect.right())
popupRect.translate(screenRect.right() - popupRect.right(), 0);
if (popupRect.left() < screenRect.left())
popupRect.translate(screenRect.left() - popupRect.left(), 0);
_______________________________________________
kimageshop mailing list
kimageshop@kde.org
https://mail.kde.org/mailman/listinfo/kimageshop
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic