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 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 (
|
||||
qApp, QDialog, QFileDialog, QMainWindow, QMessageBox, QShortcut, QSplitter,
|
||||
QStackedWidget, QVBoxLayout, QWidget
|
||||
@@ -350,27 +350,6 @@ class GuiMain(QMainWindow):
|
||||
|
||||
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):
|
||||
"""Initialise elements that depend on user settings.
|
||||
"""
|
||||
|
||||
@@ -250,7 +250,6 @@ class GuiManuscriptBuild(QDialog):
|
||||
"""
|
||||
self._saveSettings()
|
||||
event.accept()
|
||||
self.mainGui.restackGUI()
|
||||
self.deleteLater()
|
||||
return
|
||||
|
||||
@@ -278,7 +277,6 @@ class GuiManuscriptBuild(QDialog):
|
||||
)
|
||||
if savePath:
|
||||
self.buildPath.setText(savePath)
|
||||
self.mainGui.restackGUI()
|
||||
return
|
||||
|
||||
@pyqtSlot()
|
||||
|
||||
@@ -69,6 +69,8 @@ class GuiManuscript(QDialog):
|
||||
|
||||
logger.debug("Create: GuiManuscript")
|
||||
self.setObjectName("GuiManuscript")
|
||||
if CONFIG.osDarwin:
|
||||
self.setWindowFlag(Qt.WindowType.Tool)
|
||||
|
||||
self.mainGui = mainGui
|
||||
self.mainTheme = mainGui.mainTheme
|
||||
|
||||
@@ -74,6 +74,8 @@ class GuiBuildSettings(QDialog):
|
||||
|
||||
logger.debug("Create: GuiBuildSettings")
|
||||
self.setObjectName("GuiBuildSettings")
|
||||
if CONFIG.osDarwin:
|
||||
self.setWindowFlag(Qt.WindowType.Tool)
|
||||
|
||||
self.guiParent = parent
|
||||
self.mainGui = mainGui
|
||||
@@ -225,7 +227,6 @@ class GuiBuildSettings(QDialog):
|
||||
self._askToSaveBuild()
|
||||
self._saveSettings()
|
||||
event.accept()
|
||||
self.mainGui.restackGUI()
|
||||
self.deleteLater()
|
||||
return
|
||||
|
||||
@@ -1163,7 +1164,6 @@ class _FormatTab(QWidget):
|
||||
if theStatus:
|
||||
self.textFont.setText(theFont.family())
|
||||
self.textSize.setValue(theFont.pointSize())
|
||||
self.mainGui.restackGUI()
|
||||
return
|
||||
|
||||
@pyqtSlot(int)
|
||||
|
||||
Reference in New Issue
Block a user