mirror of
https://github.com/LorenEteval/Furious.git
synced 2026-10-11 00:38:24 +03:00
Fix macOS compatibility issues
Signed-off-by: Loren Eteval <loren.eteval@proton.me>
This commit is contained in:
@@ -106,8 +106,6 @@ class AppQDialog(QTranslatable, SupportConnectedCallback, QDialog):
|
||||
|
||||
if PLATFORM == 'Darwin':
|
||||
if self._firstShowCall:
|
||||
APP().processEvents()
|
||||
|
||||
self.setWidthAndHeight()
|
||||
|
||||
self._firstShowCall = False
|
||||
@@ -289,16 +287,16 @@ class AppQMainWindow(
|
||||
|
||||
if PLATFORM == 'Darwin':
|
||||
if self._firstShowCall:
|
||||
APP().processEvents()
|
||||
|
||||
self.setWidthAndHeight()
|
||||
|
||||
APP().processEvents()
|
||||
|
||||
self._firstShowCall = False
|
||||
|
||||
moveToCenter(self)
|
||||
|
||||
if PLATFORM == 'Darwin':
|
||||
self.activateWindow()
|
||||
self.raise_()
|
||||
|
||||
def closeEvent(self, event):
|
||||
event.ignore()
|
||||
|
||||
|
||||
@@ -383,6 +383,18 @@ class Application(ApplicationFactory, SingletonApplication):
|
||||
if AppSettings.isStateON_('DarkMode'):
|
||||
self.switchToDarkMode()
|
||||
|
||||
def onApplicationStateChange(state):
|
||||
if state == QtCore.Qt.ApplicationState.ApplicationActive:
|
||||
if (
|
||||
not self.mainWindow.isVisible()
|
||||
and not self.systemTray.ConnectAction.isConnecting()
|
||||
):
|
||||
self.mainWindow.show()
|
||||
|
||||
if PLATFORM == 'Darwin':
|
||||
# Ensure the main window is shown when the dock icon is clicked
|
||||
self.applicationStateChanged.connect(onApplicationStateChange)
|
||||
|
||||
self.systemTray.show()
|
||||
self.systemTray.setCustomToolTip()
|
||||
self.systemTray.bootstrap()
|
||||
|
||||
@@ -32,6 +32,9 @@ class ConnectProgressBar(QTranslatable, SupportConnectedCallback, QWidget):
|
||||
|
||||
self.setWindowTitle(_(APPLICATION_NAME))
|
||||
self.setWindowIcon(AppHue.currentWindowIcon())
|
||||
self.setAttribute(QtCore.Qt.WidgetAttribute.WA_ShowWithoutActivating)
|
||||
self.setWindowFlags(QtCore.Qt.WindowType.WindowStaysOnTopHint)
|
||||
self.setFocusPolicy(QtCore.Qt.FocusPolicy.NoFocus)
|
||||
self.setFixedSize(280, 61)
|
||||
|
||||
@QtCore.Slot()
|
||||
|
||||
@@ -158,13 +158,13 @@ class AppMainWindow(AppQMainWindow):
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
self.setWindowTitle(_(APPLICATION_NAME))
|
||||
self.setAttribute(QtCore.Qt.WidgetAttribute.WA_ShowWithoutActivating)
|
||||
|
||||
self.updatesManager = UpdatesManager()
|
||||
self.networkStateManager = AppNetworkStateManager(parent=self)
|
||||
|
||||
self.userServersQTableWidget = UserServersQTableWidget(parent=self)
|
||||
self.userSubsWindow = UserSubsWindow(
|
||||
parent=self,
|
||||
deleteUniqueCallback=lambda unique: self.userServersQTableWidget.deleteItemByIndex(
|
||||
list(
|
||||
index
|
||||
|
||||
Reference in New Issue
Block a user