Try setting build non-modal dialogs as tools
This commit is contained in:
+1
-22
@@ -32,7 +32,7 @@ from pathlib import Path
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
from PyQt5.QtCore import Qt, QTimer, QThreadPool, pyqtSlot
|
from PyQt5.QtCore import Qt, QTimer, QThreadPool, pyqtSlot
|
||||||
from PyQt5.QtGui import QCursor, QIcon, QKeySequence, QWindow
|
from PyQt5.QtGui import QCursor, QIcon, QKeySequence
|
||||||
from PyQt5.QtWidgets import (
|
from PyQt5.QtWidgets import (
|
||||||
qApp, QDialog, QFileDialog, QMainWindow, QMessageBox, QShortcut, QSplitter,
|
qApp, QDialog, QFileDialog, QMainWindow, QMessageBox, QShortcut, QSplitter,
|
||||||
QStackedWidget, QVBoxLayout, QWidget
|
QStackedWidget, QVBoxLayout, QWidget
|
||||||
@@ -350,27 +350,6 @@ class GuiMain(QMainWindow):
|
|||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def restackGUI(self):
|
|
||||||
"""Reorder the visibility of windows."""
|
|
||||||
subOne: list[QWindow] = []
|
|
||||||
subTwo: list[QWindow] = []
|
|
||||||
for window in qApp.allWindows():
|
|
||||||
name = window.objectName()
|
|
||||||
if name == "GuiManuscriptWindow":
|
|
||||||
subOne.append(window)
|
|
||||||
elif name == "GuiBuildSettingsWindow":
|
|
||||||
subTwo.append(window)
|
|
||||||
elif name == "GuiManuscriptBuildWindow":
|
|
||||||
subTwo.append(window)
|
|
||||||
self.raise_()
|
|
||||||
for window in subOne:
|
|
||||||
if window.isExposed():
|
|
||||||
window.raise_()
|
|
||||||
for window in subTwo:
|
|
||||||
if window.isExposed():
|
|
||||||
window.raise_()
|
|
||||||
return
|
|
||||||
|
|
||||||
def initMain(self):
|
def initMain(self):
|
||||||
"""Initialise elements that depend on user settings.
|
"""Initialise elements that depend on user settings.
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -250,7 +250,6 @@ class GuiManuscriptBuild(QDialog):
|
|||||||
"""
|
"""
|
||||||
self._saveSettings()
|
self._saveSettings()
|
||||||
event.accept()
|
event.accept()
|
||||||
self.mainGui.restackGUI()
|
|
||||||
self.deleteLater()
|
self.deleteLater()
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -278,7 +277,6 @@ class GuiManuscriptBuild(QDialog):
|
|||||||
)
|
)
|
||||||
if savePath:
|
if savePath:
|
||||||
self.buildPath.setText(savePath)
|
self.buildPath.setText(savePath)
|
||||||
self.mainGui.restackGUI()
|
|
||||||
return
|
return
|
||||||
|
|
||||||
@pyqtSlot()
|
@pyqtSlot()
|
||||||
|
|||||||
@@ -69,6 +69,8 @@ class GuiManuscript(QDialog):
|
|||||||
|
|
||||||
logger.debug("Create: GuiManuscript")
|
logger.debug("Create: GuiManuscript")
|
||||||
self.setObjectName("GuiManuscript")
|
self.setObjectName("GuiManuscript")
|
||||||
|
if CONFIG.osDarwin:
|
||||||
|
self.setWindowFlag(Qt.WindowType.Tool)
|
||||||
|
|
||||||
self.mainGui = mainGui
|
self.mainGui = mainGui
|
||||||
self.mainTheme = mainGui.mainTheme
|
self.mainTheme = mainGui.mainTheme
|
||||||
|
|||||||
@@ -74,6 +74,8 @@ class GuiBuildSettings(QDialog):
|
|||||||
|
|
||||||
logger.debug("Create: GuiBuildSettings")
|
logger.debug("Create: GuiBuildSettings")
|
||||||
self.setObjectName("GuiBuildSettings")
|
self.setObjectName("GuiBuildSettings")
|
||||||
|
if CONFIG.osDarwin:
|
||||||
|
self.setWindowFlag(Qt.WindowType.Tool)
|
||||||
|
|
||||||
self.guiParent = parent
|
self.guiParent = parent
|
||||||
self.mainGui = mainGui
|
self.mainGui = mainGui
|
||||||
@@ -225,7 +227,6 @@ class GuiBuildSettings(QDialog):
|
|||||||
self._askToSaveBuild()
|
self._askToSaveBuild()
|
||||||
self._saveSettings()
|
self._saveSettings()
|
||||||
event.accept()
|
event.accept()
|
||||||
self.mainGui.restackGUI()
|
|
||||||
self.deleteLater()
|
self.deleteLater()
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -1163,7 +1164,6 @@ class _FormatTab(QWidget):
|
|||||||
if theStatus:
|
if theStatus:
|
||||||
self.textFont.setText(theFont.family())
|
self.textFont.setText(theFont.family())
|
||||||
self.textSize.setValue(theFont.pointSize())
|
self.textSize.setValue(theFont.pointSize())
|
||||||
self.mainGui.restackGUI()
|
|
||||||
return
|
return
|
||||||
|
|
||||||
@pyqtSlot(int)
|
@pyqtSlot(int)
|
||||||
|
|||||||
Reference in New Issue
Block a user