Fixes alignment of the toggle button

This commit is contained in:
Saptak S 2021-12-17 18:54:31 +05:30
parent 47d6f39c06
commit 094e469f0d
No known key found for this signature in database
GPG Key ID: 7B7F1772C0C6FCBF

View File

@ -586,7 +586,7 @@ class ToggleCheckbox(QtWidgets.QCheckBox):
x = (
rect.width() - rect.x() - self.w + 20
) # 20 is the padding between text and toggle
y = self.height() / 2 - self.h / 2 + self.y() / 2
y = self.height() / 2 - self.h / 2 + 16 # 16 is the padding top for the checkbox
self.toggleRect = QtCore.QRect(x, y, self.w, self.h)
painter.setBrush(QtGui.QColor(self.bg_color))
painter.drawRoundedRect(x, y, self.w, self.h, self.h / 2, self.h / 2)