Clean up a lot more namespace flags

This commit is contained in:
Veronica Berglyd Olsen
2024-04-03 20:25:54 +02:00
parent 46c5f1c10d
commit 20c5993e2d
38 changed files with 184 additions and 142 deletions
+6 -6
View File
@@ -32,7 +32,7 @@ from PyQt5.QtWidgets import (
QStyleOptionToolButton, QToolBar, QToolButton, QWidget
)
from novelwriter.types import QtAlignLeft, QtNoBrush, QtNoPen
from novelwriter.types import QtPaintAnitAlias, QtAlignLeft, QtMouseOver, QtNoBrush, QtNoPen
class NPagedSideBar(QToolBar):
@@ -125,7 +125,7 @@ class _NPagedToolButton(QToolButton):
fH = self.fontMetrics().height()
self._bH = round(fH * 1.7)
self._tM = (self._bH - fH)//2
self._lM = 3*self.style().pixelMetric(QStyle.PM_ButtonMargin)//2
self._lM = 3*self.style().pixelMetric(QStyle.PixelMetric.PM_ButtonMargin)//2
self._cR = self._lM//2
self._aH = 2*fH//7
self.setFixedHeight(self._bH)
@@ -145,7 +145,7 @@ class _NPagedToolButton(QToolButton):
opt.initFrom(self)
paint = QPainter(self)
paint.setRenderHint(QPainter.Antialiasing, True)
paint.setRenderHint(QtPaintAnitAlias, True)
paint.setPen(QtNoPen)
paint.setBrush(QtNoBrush)
@@ -153,7 +153,7 @@ class _NPagedToolButton(QToolButton):
height = self.height()
palette = self.palette()
if opt.state & QStyle.State_MouseOver == QStyle.State_MouseOver:
if opt.state & QtMouseOver == QtMouseOver:
backCol = palette.base()
paint.setBrush(backCol)
paint.setOpacity(0.75)
@@ -202,7 +202,7 @@ class _NPagedToolLabel(QLabel):
fH = self.fontMetrics().height()
self._bH = round(fH * 1.7)
self._tM = (self._bH - fH)//2
self._lM = self.style().pixelMetric(QStyle.PM_ButtonMargin)//2
self._lM = self.style().pixelMetric(QStyle.PixelMetric.PM_ButtonMargin)//2
self.setFixedHeight(self._bH)
self._textCol = textColor or self.palette().text().color()
@@ -214,7 +214,7 @@ class _NPagedToolLabel(QLabel):
label that matches the button style.
"""
paint = QPainter(self)
paint.setRenderHint(QPainter.Antialiasing, True)
paint.setRenderHint(QtPaintAnitAlias, True)
paint.setPen(QtNoPen)
width = self.width()