Merge pull request #898 from poixen/sb_clean_lines
Refactored code and made lines cleaner
This commit is contained in:
commit
6c35253bcc
2 changed files with 10 additions and 11 deletions
|
@ -81,14 +81,12 @@ void DeckViewCard::paint(QPainter *painter, const QStyleOptionGraphicsItem *opti
|
|||
AbstractCardItem::paint(painter, option, widget);
|
||||
|
||||
painter->save();
|
||||
QPen pen;//(Qt::DotLine);
|
||||
QPen pen;
|
||||
pen.setWidth(3);
|
||||
if (originZone == "main")
|
||||
pen.setColor(QColor(0, 255, 0));
|
||||
else
|
||||
pen.setColor(QColor(255, 0, 0));
|
||||
pen.setJoinStyle(Qt::MiterJoin);
|
||||
pen.setColor(originZone == "main" ? Qt::green : Qt::red);
|
||||
painter->setPen(pen);
|
||||
painter->drawRect(QRectF(1.5, 1.5, CARD_WIDTH - 3, CARD_HEIGHT - 3));
|
||||
painter->drawRect(QRectF(1, 1, CARD_WIDTH - 2, CARD_HEIGHT - 2.5));
|
||||
painter->restore();
|
||||
}
|
||||
|
||||
|
|
|
@ -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…
Reference in a new issue