summaryrefslogtreecommitdiff
path: root/gr-qtgui/python/qtgui/toggleswitch.py
diff options
context:
space:
mode:
Diffstat (limited to 'gr-qtgui/python/qtgui/toggleswitch.py')
-rw-r--r--gr-qtgui/python/qtgui/toggleswitch.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/gr-qtgui/python/qtgui/toggleswitch.py b/gr-qtgui/python/qtgui/toggleswitch.py
index 7ef5a113fa..ea5b98ee82 100644
--- a/gr-qtgui/python/qtgui/toggleswitch.py
+++ b/gr-qtgui/python/qtgui/toggleswitch.py
@@ -136,15 +136,15 @@ class ToggleSwitch(QFrame):
painter.setBrush(brush)
painter.setPen(QPen(QColor('white'), 0))
if self.curState:
- painter.drawEllipse(2, 2, size.height() - 4, size.height() - 4)
- else:
painter.drawEllipse(center_x+2, 2, size.height() - 4, size.height() - 4)
+ else:
+ painter.drawEllipse(2, 2, size.height() - 4, size.height() - 4)
def mousePressEvent(self, event):
if event.x() <= self.size().width()/2:
- self.setState(True)
- else:
self.setState(False)
+ else:
+ self.setState(True)
super().update()