eric7/UI/NotificationWidget.py

branch
eric7
changeset 8318
962bce857696
parent 8312
800c432b34c8
child 8319
ea11a3948f40
equal deleted inserted replaced
8316:0c7a44af84bc 8318:962bce857696
8 """ 8 """
9 9
10 import contextlib 10 import contextlib
11 import enum 11 import enum
12 12
13 from PyQt5.QtCore import Qt, QTimer, QPoint 13 from PyQt6.QtCore import Qt, QTimer, QPoint
14 from PyQt5.QtWidgets import QFrame, QWidget, QVBoxLayout 14 from PyQt6.QtWidgets import QFrame, QWidget, QVBoxLayout
15 15
16 from .Ui_NotificationFrame import Ui_NotificationFrame 16 from .Ui_NotificationFrame import Ui_NotificationFrame
17 17
18 import Globals 18 import Globals
19 import Preferences 19 import Preferences
201 pos = Preferences.getUI("NotificationPosition") 201 pos = Preferences.getUI("NotificationPosition")
202 try: 202 try:
203 screen = self.screen() 203 screen = self.screen()
204 except AttributeError: 204 except AttributeError:
205 # < Qt 5.15 205 # < Qt 5.15
206 from PyQt5.QtGui import QGuiApplication 206 from PyQt6.QtGui import QGuiApplication
207 screen = QGuiApplication.screenAt(pos) 207 screen = QGuiApplication.screenAt(pos)
208 screenGeom = screen.geometry() 208 screenGeom = screen.geometry()
209 209
210 newX = pos.x() 210 newX = pos.x()
211 newY = pos.y() 211 newY = pos.y()
252 Protected method to handle presses of a mouse button. 252 Protected method to handle presses of a mouse button.
253 253
254 @param evt reference to the mouse event (QMouseEvent) 254 @param evt reference to the mouse event (QMouseEvent)
255 """ 255 """
256 if not self.__settingPosition: 256 if not self.__settingPosition:
257 clickedLabel = self.childAt(evt.pos()) 257 clickedLabel = self.childAt(evt.position().toPoint())
258 if clickedLabel: 258 if clickedLabel:
259 clickedNotification = clickedLabel.parent() 259 clickedNotification = clickedLabel.parent()
260 self.__removeNotification(clickedNotification) 260 self.__removeNotification(clickedNotification)
261 return 261 return
262 262

eric ide

mercurial