do not use the leaveEvent on macos

This commit is contained in:
dries.k
2022-09-01 21:41:01 +02:00
parent 5e77a82629
commit 4e555631ed
2 changed files with 10 additions and 9 deletions

View File

@@ -1,3 +1,4 @@
import platform
from PyQt6 import QtCore, QtGui, QtWidgets
from gotify_tray.database import Settings
@@ -18,7 +19,7 @@ class ImagePopup(QtWidgets.QLabel):
super(ImagePopup, self).__init__()
self.link = link
self.setWindowFlags(QtCore.Qt.WindowType.ToolTip)
self.setWindowFlags(QtCore.Qt.WindowType.Popup)
self.installEventFilter(self)
# Prevent leaving the pop-up open when moving quickly out of the widget
@@ -46,7 +47,7 @@ class ImagePopup(QtWidgets.QLabel):
super(ImagePopup, self).close()
def eventFilter(self, object: QtCore.QObject, event: QtCore.QEvent) -> bool:
if event.type() == QtCore.QEvent.Type.Leave:
if platform.system() != "Darwin" and event.type() == QtCore.QEvent.Type.Leave:
# Close the pop-up on mouse leave
self.close()
elif (

View File

@@ -4,7 +4,7 @@ from PyQt6 import QtCore, QtGui, QtWidgets
from ..models.MessagesModel import MessageItemDataRole, MessagesModelItem
from ..designs.widget_message import Ui_Form
from gotify_tray.database import Cache, Settings
from gotify_tray.database import Settings
from gotify_tray.utils import convert_links, get_abs_path