|
|
@ -19,14 +19,14 @@ void Toggle::paintEvent(QPaintEvent *e) { |
|
|
|
p.setRenderHint(QPainter::Antialiasing, true); |
|
|
|
p.setRenderHint(QPainter::Antialiasing, true); |
|
|
|
|
|
|
|
|
|
|
|
// Draw toggle background left
|
|
|
|
// Draw toggle background left
|
|
|
|
p.setBrush(QColor("#33ab4c")); |
|
|
|
p.setBrush(QColor(0x33ab4c)); |
|
|
|
p.drawRoundedRect(QRect(0, _y_rect, _x_circle + _radius, _height_rect), _height_rect/2, _height_rect/2); |
|
|
|
p.drawRoundedRect(QRect(0, _y_rect, _x_circle + _radius, _height_rect), _height_rect/2, _height_rect/2); |
|
|
|
// Draw toggle background right
|
|
|
|
// Draw toggle background right
|
|
|
|
p.setBrush(QColor("#0a1a26")); |
|
|
|
p.setBrush(QColor(0x0a1a26)); |
|
|
|
p.drawRoundedRect(QRect(_x_circle - _radius, _y_rect, width() -(_x_circle - _radius), _height_rect), _height_rect/2, _height_rect/2); |
|
|
|
p.drawRoundedRect(QRect(_x_circle - _radius, _y_rect, width() -(_x_circle - _radius), _height_rect), _height_rect/2, _height_rect/2); |
|
|
|
|
|
|
|
|
|
|
|
// Draw toggle circle
|
|
|
|
// Draw toggle circle
|
|
|
|
p.setBrush(QColor("#fafafa")); |
|
|
|
p.setBrush(QColor(0xfafafa)); |
|
|
|
p.drawEllipse(QRectF(_x_circle - _radius, _y_circle - _radius, 2 * _radius, 2 * _radius)); |
|
|
|
p.drawEllipse(QRectF(_x_circle - _radius, _y_circle - _radius, 2 * _radius, 2 * _radius)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|