src/eric7/Snapshot/SnapshotTimer.py

branch
eric7
changeset 10431
64157aeb0312
parent 9653
e67609152c5e
child 10439
21c28b0f9e41
equal deleted inserted replaced
10430:e440aaf179ce 10431:64157aeb0312
49 49
50 def start(self, seconds): 50 def start(self, seconds):
51 """ 51 """
52 Public method to start the timer. 52 Public method to start the timer.
53 53
54 @param seconds timeout value (integer) 54 @param seconds timeout value
55 @type int
55 """ 56 """
56 screenGeom = QApplication.screens()[0].geometry() 57 screenGeom = QApplication.screens()[0].geometry()
57 self.move(screenGeom.width() // 2 - self.size().width() // 2, screenGeom.top()) 58 self.move(screenGeom.width() // 2 - self.size().width() // 2, screenGeom.top())
58 self.__toggle = True 59 self.__toggle = True
59 self.__time = 0 60 self.__time = 0
86 87
87 def paintEvent(self, evt): 88 def paintEvent(self, evt):
88 """ 89 """
89 Protected method handling paint events. 90 Protected method handling paint events.
90 91
91 @param evt paint event (QPaintEvent) 92 @param evt paint event
93 @type QPaintEvent
92 """ 94 """
93 painter = QPainter(self) 95 painter = QPainter(self)
94 96
95 if self.__time < self.__length: 97 if self.__time < self.__length:
96 pal = QToolTip.palette() 98 pal = QToolTip.palette()
123 125
124 def enterEvent(self, evt): 126 def enterEvent(self, evt):
125 """ 127 """
126 Protected method handling the mouse cursor entering the widget. 128 Protected method handling the mouse cursor entering the widget.
127 129
128 @param evt enter event (QEvent) 130 @param evt enter event
131 @type QEvent
129 """ 132 """
130 screenGeom = QApplication.screens()[0].geometry() 133 screenGeom = QApplication.screens()[0].geometry()
131 if self.x() == screenGeom.left(): 134 if self.x() == screenGeom.left():
132 self.move( 135 self.move(
133 screenGeom.x() + (screenGeom.width() // 2 - self.size().width() // 2), 136 screenGeom.x() + (screenGeom.width() // 2 - self.size().width() // 2),

eric ide

mercurial