Tweaked the doc title bar sizes a bit more
This commit is contained in:
+15
-16
@@ -33,7 +33,7 @@ from PyQt5.QtCore import Qt, QSize
|
|||||||
from PyQt5.QtGui import QPalette, QColor
|
from PyQt5.QtGui import QPalette, QColor
|
||||||
from PyQt5.QtWidgets import (
|
from PyQt5.QtWidgets import (
|
||||||
qApp, QWidget, QFrame, QGridLayout, QLabel, QLineEdit, QPushButton,
|
qApp, QWidget, QFrame, QGridLayout, QLabel, QLineEdit, QPushButton,
|
||||||
QHBoxLayout, QSizePolicy
|
QHBoxLayout
|
||||||
)
|
)
|
||||||
|
|
||||||
from nw.constants import nwDocAction, nwUnicode
|
from nw.constants import nwDocAction, nwUnicode
|
||||||
@@ -187,9 +187,9 @@ class GuiDocTitleBar(QWidget):
|
|||||||
self.thePalette.setColor(QPalette.Window, QColor(*self.theTheme.colBack))
|
self.thePalette.setColor(QPalette.Window, QColor(*self.theTheme.colBack))
|
||||||
self.thePalette.setColor(QPalette.Text, QColor(*self.theTheme.colText))
|
self.thePalette.setColor(QPalette.Text, QColor(*self.theTheme.colText))
|
||||||
|
|
||||||
iPx = self.theTheme.textIconSize
|
fPx = int(0.9*self.theTheme.fontPixelSize)
|
||||||
hSp = self.mainConf.pxInt(6)
|
hSp = self.mainConf.pxInt(6)
|
||||||
self.buttonSize = iPx + hSp
|
self.buttonSize = fPx + hSp
|
||||||
|
|
||||||
# Main Widget Settings
|
# Main Widget Settings
|
||||||
self.setContentsMargins(2*self.buttonSize, 0, 0, 0)
|
self.setContentsMargins(2*self.buttonSize, 0, 0, 0)
|
||||||
@@ -203,9 +203,8 @@ class GuiDocTitleBar(QWidget):
|
|||||||
self.theTitle.setMargin(0)
|
self.theTitle.setMargin(0)
|
||||||
self.theTitle.setContentsMargins(0, 0, 0, 0)
|
self.theTitle.setContentsMargins(0, 0, 0, 0)
|
||||||
self.theTitle.setAutoFillBackground(True)
|
self.theTitle.setAutoFillBackground(True)
|
||||||
self.theTitle.setAlignment(Qt.AlignTop | Qt.AlignHCenter)
|
self.theTitle.setAlignment(Qt.AlignHCenter | Qt.AlignTop)
|
||||||
self.theTitle.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Minimum)
|
self.theTitle.setFixedHeight(fPx)
|
||||||
self.theTitle.setMinimumHeight(self.theTheme.fontPixelSize)
|
|
||||||
self.theTitle.setFrameShape(QFrame.NoFrame)
|
self.theTitle.setFrameShape(QFrame.NoFrame)
|
||||||
self.theTitle.setLineWidth(0)
|
self.theTitle.setLineWidth(0)
|
||||||
self.theTitle.setPalette(self.thePalette)
|
self.theTitle.setPalette(self.thePalette)
|
||||||
@@ -218,8 +217,8 @@ class GuiDocTitleBar(QWidget):
|
|||||||
self.closeButton = QPushButton("")
|
self.closeButton = QPushButton("")
|
||||||
self.closeButton.setIcon(self.theTheme.getIcon("close"))
|
self.closeButton.setIcon(self.theTheme.getIcon("close"))
|
||||||
self.closeButton.setContentsMargins(0, 0, 0, 0)
|
self.closeButton.setContentsMargins(0, 0, 0, 0)
|
||||||
self.closeButton.setIconSize(QSize(iPx, iPx))
|
self.closeButton.setIconSize(QSize(fPx, fPx))
|
||||||
self.closeButton.setFixedSize(iPx, iPx)
|
self.closeButton.setFixedSize(fPx, fPx)
|
||||||
self.closeButton.setFlat(True)
|
self.closeButton.setFlat(True)
|
||||||
self.closeButton.setVisible(False)
|
self.closeButton.setVisible(False)
|
||||||
self.closeButton.clicked.connect(self._closeDocument)
|
self.closeButton.clicked.connect(self._closeDocument)
|
||||||
@@ -228,8 +227,8 @@ class GuiDocTitleBar(QWidget):
|
|||||||
self.minmaxButton = QPushButton("")
|
self.minmaxButton = QPushButton("")
|
||||||
self.minmaxButton.setIcon(self.theTheme.getIcon("maximise"))
|
self.minmaxButton.setIcon(self.theTheme.getIcon("maximise"))
|
||||||
self.minmaxButton.setContentsMargins(0, 0, 0, 0)
|
self.minmaxButton.setContentsMargins(0, 0, 0, 0)
|
||||||
self.minmaxButton.setIconSize(QSize(iPx, iPx))
|
self.minmaxButton.setIconSize(QSize(fPx, fPx))
|
||||||
self.minmaxButton.setFixedSize(iPx, iPx)
|
self.minmaxButton.setFixedSize(fPx, fPx)
|
||||||
self.minmaxButton.setFlat(True)
|
self.minmaxButton.setFlat(True)
|
||||||
self.minmaxButton.setVisible(False)
|
self.minmaxButton.setVisible(False)
|
||||||
self.minmaxButton.clicked.connect(self._minmaxDocument)
|
self.minmaxButton.clicked.connect(self._minmaxDocument)
|
||||||
@@ -237,8 +236,8 @@ class GuiDocTitleBar(QWidget):
|
|||||||
self.refreshButton = QPushButton("")
|
self.refreshButton = QPushButton("")
|
||||||
self.refreshButton.setIcon(self.theTheme.getIcon("refresh"))
|
self.refreshButton.setIcon(self.theTheme.getIcon("refresh"))
|
||||||
self.refreshButton.setContentsMargins(0, 0, 0, 0)
|
self.refreshButton.setContentsMargins(0, 0, 0, 0)
|
||||||
self.refreshButton.setIconSize(QSize(iPx, iPx))
|
self.refreshButton.setIconSize(QSize(fPx, fPx))
|
||||||
self.refreshButton.setFixedSize(iPx, iPx)
|
self.refreshButton.setFixedSize(fPx, fPx)
|
||||||
self.refreshButton.setFlat(True)
|
self.refreshButton.setFlat(True)
|
||||||
self.refreshButton.setVisible(False)
|
self.refreshButton.setVisible(False)
|
||||||
self.refreshButton.clicked.connect(self._refreshDocument)
|
self.refreshButton.clicked.connect(self._refreshDocument)
|
||||||
@@ -246,12 +245,12 @@ class GuiDocTitleBar(QWidget):
|
|||||||
# Assemble Layout
|
# Assemble Layout
|
||||||
self.outerBox = QHBoxLayout()
|
self.outerBox = QHBoxLayout()
|
||||||
self.outerBox.setSpacing(hSp)
|
self.outerBox.setSpacing(hSp)
|
||||||
self.outerBox.addWidget(self.theTitle, 1)
|
self.outerBox.addWidget(self.theTitle, 1, Qt.AlignBottom)
|
||||||
if self.isEditor:
|
if self.isEditor:
|
||||||
self.outerBox.addWidget(self.minmaxButton, 0)
|
self.outerBox.addWidget(self.minmaxButton, 0, Qt.AlignBottom)
|
||||||
else:
|
else:
|
||||||
self.outerBox.addWidget(self.refreshButton, 0)
|
self.outerBox.addWidget(self.refreshButton, 0, Qt.AlignBottom)
|
||||||
self.outerBox.addWidget(self.closeButton, 0)
|
self.outerBox.addWidget(self.closeButton, 0, Qt.AlignBottom)
|
||||||
self.setLayout(self.outerBox)
|
self.setLayout(self.outerBox)
|
||||||
|
|
||||||
logger.debug("GuiDocTitleBar initialisation complete")
|
logger.debug("GuiDocTitleBar initialisation complete")
|
||||||
|
|||||||
Reference in New Issue
Block a user