Fixed an issue configuring the notification position on multi screen computers.

Tue, 13 Nov 2012 18:47:49 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 13 Nov 2012 18:47:49 +0100
changeset 2224
c681f765d64d
parent 2223
054c285dab38
child 2225
0139003972cd

Fixed an issue configuring the notification position on multi screen computers.

Preferences/ConfigurationPages/NotificationsPage.py file | annotate | diff | comparison | revisions
Preferences/ConfigurationPages/NotificationsPage.ui file | annotate | diff | comparison | revisions
--- a/Preferences/ConfigurationPages/NotificationsPage.py	Mon Nov 12 19:04:11 2012 +0100
+++ b/Preferences/ConfigurationPages/NotificationsPage.py	Tue Nov 13 18:47:49 2012 +0100
@@ -33,9 +33,19 @@
         self.setupUi(self)
         self.setObjectName("NotificationsPage")
         
-        geom = QApplication.desktop().availableGeometry()
-        self.xSpinBox.setMaximum(geom.width())
-        self.ySpinBox.setMaximum(geom.height())
+        minX, maxX = self.xSpinBox.maximum(), self.xSpinBox.minimum()
+        minY, maxY = self.ySpinBox.maximum(), self.ySpinBox.minimum() 
+        desk = QApplication.desktop()
+        for screen in range(desk.screenCount()):
+            geom = desk.availableGeometry(screen)
+            minX = min(minX, geom.x())
+            maxX = max(maxX, geom.x() + geom.width())
+            minY = min(minY, geom.y())
+            maxY = max(maxY, geom.y() + geom.height())
+        self.xSpinBox.setMinimum(minX)
+        self.xSpinBox.setMaximum(maxX)
+        self.ySpinBox.setMinimum(minY)
+        self.ySpinBox.setMaximum(maxY)
         
         self.__notification = None
         
--- a/Preferences/ConfigurationPages/NotificationsPage.ui	Mon Nov 12 19:04:11 2012 +0100
+++ b/Preferences/ConfigurationPages/NotificationsPage.ui	Tue Nov 13 18:47:49 2012 +0100
@@ -106,6 +106,9 @@
           <property name="alignment">
            <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
           </property>
+          <property name="minimum">
+           <number>-10000</number>
+          </property>
           <property name="maximum">
            <number>10000</number>
           </property>
@@ -126,6 +129,9 @@
           <property name="alignment">
            <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
           </property>
+          <property name="minimum">
+           <number>-10000</number>
+          </property>
           <property name="maximum">
            <number>10000</number>
           </property>

eric ide

mercurial