mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-01-25 02:44:51 -08:00
mess with the font rendering of the home screen until it works (#6563)
* mess with the font rendering of the home screen until it works * add more fonts
This commit is contained in:
@@ -41,6 +41,8 @@ QString HomeStyledButton::generateButtonStylesheet(const QPair<QColor, QColor> &
|
||||
return QString(R"(
|
||||
QPushButton {
|
||||
font-size: 34px;
|
||||
font-weight: bold;
|
||||
font-family: sans-serif, "Segoe UI", "Helvetica Neue";
|
||||
padding: 30px;
|
||||
color: white;
|
||||
border: 2px solid %1;
|
||||
@@ -88,16 +90,12 @@ void HomeStyledButton::paintEvent(QPaintEvent *event)
|
||||
painter.setRenderHint(QPainter::Antialiasing);
|
||||
painter.setRenderHint(QPainter::TextAntialiasing);
|
||||
|
||||
QFont font = this->font();
|
||||
font.setBold(true);
|
||||
painter.setFont(font);
|
||||
|
||||
QFontMetrics fm(font);
|
||||
QSize textSize = fm.size(Qt::TextSingleLine, this->text());
|
||||
QFontMetrics fm(font());
|
||||
QSize textSize = fm.size(Qt::TextSingleLine, text());
|
||||
QPointF center((width() - textSize.width()) / 2.0, (height() + textSize.height() / 2.0) / 2.0);
|
||||
|
||||
QPainterPath path;
|
||||
path.addText(center, font, this->text());
|
||||
path.addText(center, font(), text());
|
||||
|
||||
painter.setPen(QPen(Qt::black, 2.0, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
||||
painter.setBrush(Qt::white);
|
||||
|
||||
Reference in New Issue
Block a user