mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 00:04:48 -07:00
Refactored code and made lines cleaner
Before: After:
This commit is contained in:
parent
580927a50b
commit
e78747241d
2 changed files with 10 additions and 11 deletions
|
|
@ -73,11 +73,12 @@ void ToggleButton::paintEvent(QPaintEvent *event)
|
|||
QPushButton::paintEvent(event);
|
||||
|
||||
QPainter painter(this);
|
||||
if (state)
|
||||
painter.setPen(QPen(Qt::green, 3));
|
||||
else
|
||||
painter.setPen(QPen(Qt::red, 3));
|
||||
painter.drawRect(1, 1, width() - 3, height() - 3);
|
||||
QPen pen;
|
||||
pen.setWidth(3);
|
||||
pen.setJoinStyle(Qt::MiterJoin);
|
||||
pen.setColor(state ? Qt::green : Qt::red);
|
||||
painter.setPen(pen);
|
||||
painter.drawRect(QRect(1, 1, width() - 3, height() - 3));
|
||||
}
|
||||
|
||||
void ToggleButton::setState(bool _state)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue