mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2025-12-23 07:28:24 -08:00
font fix
This commit is contained in:
@@ -46,13 +46,12 @@ void CardItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
|||||||
}
|
}
|
||||||
painter->drawPixmap(translatedPixmap->rect(), *translatedPixmap, translatedPixmap->rect());
|
painter->drawPixmap(translatedPixmap->rect(), *translatedPixmap, translatedPixmap->rect());
|
||||||
} else {
|
} else {
|
||||||
QFont f;
|
QFont f("Serif");
|
||||||
f.setStyleHint(QFont::Serif);
|
f.setStyleHint(QFont::Serif);
|
||||||
f.setPointSize(8);
|
f.setPixelSize(11);
|
||||||
f.setWeight(QFont::Bold);
|
|
||||||
painter->setFont(f);
|
painter->setFont(f);
|
||||||
painter->setBrush(QColor(200, 200, 200));
|
painter->setBrush(QColor(230, 230, 230));
|
||||||
painter->setPen(QPen(Qt::black));
|
painter->setPen(Qt::black);
|
||||||
painter->drawRect(QRectF(0.5, 0.5, CARD_WIDTH - 1, CARD_HEIGHT - 1));
|
painter->drawRect(QRectF(0.5, 0.5, CARD_WIDTH - 1, CARD_HEIGHT - 1));
|
||||||
painter->drawText(QRectF(5, 5, CARD_WIDTH - 15, CARD_HEIGHT - 15), Qt::AlignTop | Qt::AlignLeft | Qt::TextWordWrap, name);
|
painter->drawText(QRectF(5, 5, CARD_WIDTH - 15, CARD_HEIGHT - 15), Qt::AlignTop | Qt::AlignLeft | Qt::TextWordWrap, name);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,10 @@ void Counter::paint(QPainter *painter, const QStyleOptionGraphicsItem */*option*
|
|||||||
painter->setBrush(QBrush(color));
|
painter->setBrush(QBrush(color));
|
||||||
painter->drawEllipse(boundingRect());
|
painter->drawEllipse(boundingRect());
|
||||||
if (value) {
|
if (value) {
|
||||||
painter->setFont(QFont("Times", 16, QFont::Bold));
|
QFont f("Times");
|
||||||
|
f.setPixelSize(20);
|
||||||
|
f.setWeight(QFont::Bold);
|
||||||
|
painter->setFont(f);
|
||||||
painter->drawText(boundingRect(), Qt::AlignCenter, QString::number(value));
|
painter->drawText(boundingRect(), Qt::AlignCenter, QString::number(value));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user