eric6/Preferences/ConfigurationPages/NotificationsPage.py

branch
maintenance
changeset 7944
6359e8b55505
parent 7924
8a96736d465e
child 8043
0acf98cd089a
equal deleted inserted replaced
7943:cbe676f46e4e 7944:6359e8b55505
52 self.xSpinBox.setMaximum(maxX) 52 self.xSpinBox.setMaximum(maxX)
53 self.ySpinBox.setMinimum(minY) 53 self.ySpinBox.setMinimum(minY)
54 self.ySpinBox.setMaximum(maxY) 54 self.ySpinBox.setMaximum(maxY)
55 55
56 self.__notification = None 56 self.__notification = None
57 self.__firstTime = True
57 58
58 # set initial values 59 # set initial values
59 self.enableCheckBox.setChecked( 60 self.enableCheckBox.setChecked(
60 Preferences.getUI("NotificationsEnabled")) 61 Preferences.getUI("NotificationsEnabled"))
61 self.timeoutSpinBox.setValue(Preferences.getUI("NotificationTimeout")) 62 self.timeoutSpinBox.setValue(Preferences.getUI("NotificationTimeout"))
91 self.tr("Drag the notification window to" 92 self.tr("Drag the notification window to"
92 " the desired place and release the button.")) 93 " the desired place and release the button."))
93 self.__notification.move( 94 self.__notification.move(
94 QPoint(self.xSpinBox.value(), self.ySpinBox.value())) 95 QPoint(self.xSpinBox.value(), self.ySpinBox.value()))
95 self.__notification.show() 96 self.__notification.show()
97 if self.__firstTime:
98 # adjust the maximum values to the width of the notification
99 self.xSpinBox.setMaximum(
100 self.xSpinBox.maximum() - self.__notification.width())
101 self.ySpinBox.setMaximum(
102 self.ySpinBox.maximum() - self.__notification.height())
103 self.__firstTime = False
96 else: 104 else:
97 # retrieve the position 105 # retrieve the position
98 point = self.__notification.frameGeometry().topLeft() 106 point = self.__notification.frameGeometry().topLeft()
99 self.xSpinBox.setValue(point.x()) 107 self.xSpinBox.setValue(point.x())
100 self.ySpinBox.setValue(point.y()) 108 self.ySpinBox.setValue(point.y())

eric ide

mercurial