Fix scaling of QSwitch on high DPI
This commit is contained in:
+11
-3
@@ -218,11 +218,19 @@ class QHelpLabel(QLabel):
|
|||||||
|
|
||||||
class QSwitch(QAbstractButton):
|
class QSwitch(QAbstractButton):
|
||||||
|
|
||||||
def __init__(self, parent=None, width=40, height=20):
|
def __init__(self, parent=None, width=None, height=None):
|
||||||
super().__init__(parent=parent)
|
super().__init__(parent=parent)
|
||||||
|
|
||||||
self._xW = int(nw.CONFIG.guiScale*width)
|
if width is None:
|
||||||
self._xH = int(nw.CONFIG.guiScale*height)
|
self._xW = nw.CONFIG.pxInt(40)
|
||||||
|
else:
|
||||||
|
self._xW = width
|
||||||
|
|
||||||
|
if height is None:
|
||||||
|
self._xH = nw.CONFIG.pxInt(20)
|
||||||
|
else:
|
||||||
|
self._xH = height
|
||||||
|
|
||||||
self._xR = int(self._xH*0.5)
|
self._xR = int(self._xH*0.5)
|
||||||
self._xT = int(self._xH*0.6)
|
self._xT = int(self._xH*0.6)
|
||||||
self._rB = int(nw.CONFIG.guiScale*2)
|
self._rB = int(nw.CONFIG.guiScale*2)
|
||||||
|
|||||||
Reference in New Issue
Block a user