Fix layout margins and z-order of some dialogs (#834)

* Fix layout margins on paged dialogs
* Make sure non-modal dialogs are only shown once and are on top
This commit is contained in:
Veronica Berglyd Olsen
2021-07-26 16:40:20 +02:00
committed by GitHub
parent 732450e163
commit b517276156
2 changed files with 17 additions and 7 deletions
+5 -5
View File
@@ -393,11 +393,11 @@ class PagedDialog(QDialog):
self._outerBox.addLayout(self._buttonBox) self._outerBox.addLayout(self._buttonBox)
# Default Margins # Default Margins
qM = self._outerBox.contentsMargins() thisStyle = self.style()
mL = qM.left() mL = thisStyle.pixelMetric(QStyle.PM_LayoutLeftMargin)
mR = qM.right() mR = thisStyle.pixelMetric(QStyle.PM_LayoutRightMargin)
mT = qM.top() mT = thisStyle.pixelMetric(QStyle.PM_LayoutLeftMargin)
mB = qM.bottom() mB = thisStyle.pixelMetric(QStyle.PM_LayoutBottomMargin)
# Set Margins # Set Margins
self.setContentsMargins(0, 0, 0, 0) self.setContentsMargins(0, 0, 0, 0)
+12 -2
View File
@@ -1002,9 +1002,13 @@ class GuiMain(QMainWindow):
self.treeView.flushTreeOrder() self.treeView.flushTreeOrder()
dlgDetails = GuiProjectDetails(self) dlgDetails = getGuiItem("GuiProjectDetails")
if dlgDetails is None:
dlgDetails = GuiProjectDetails(self)
dlgDetails.setModal(False) dlgDetails.setModal(False)
dlgDetails.show() dlgDetails.show()
dlgDetails.raise_()
return return
@@ -1021,6 +1025,7 @@ class GuiMain(QMainWindow):
dlgBuild.setModal(False) dlgBuild.setModal(False)
dlgBuild.show() dlgBuild.show()
dlgBuild.raise_()
qApp.processEvents() qApp.processEvents()
dlgBuild.viewCachedDoc() dlgBuild.viewCachedDoc()
@@ -1055,6 +1060,7 @@ class GuiMain(QMainWindow):
dlgStats.setModal(False) dlgStats.setModal(False)
dlgStats.show() dlgStats.show()
dlgStats.raise_()
qApp.processEvents() qApp.processEvents()
dlgStats.populateGUI() dlgStats.populateGUI()
@@ -1063,9 +1069,13 @@ class GuiMain(QMainWindow):
def showAboutNWDialog(self, showNotes=False): def showAboutNWDialog(self, showNotes=False):
"""Show the about dialog for novelWriter. """Show the about dialog for novelWriter.
""" """
dlgAbout = GuiAbout(self) dlgAbout = getGuiItem("GuiAbout")
if dlgAbout is None:
dlgAbout = GuiAbout(self)
dlgAbout.setModal(True) dlgAbout.setModal(True)
dlgAbout.show() dlgAbout.show()
dlgAbout.raise_()
qApp.processEvents() qApp.processEvents()
dlgAbout.populateGUI() dlgAbout.populateGUI()