mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
remove hardcoded white in vde banner widget (#6684)
* remove hardcoded white in vde banner widget * set text color to white on higher opacities
This commit is contained in:
parent
abf6e72ad1
commit
42bd8164a0
1 changed files with 8 additions and 3 deletions
|
|
@ -7,8 +7,8 @@
|
|||
#include <QPainter>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
BannerWidget::BannerWidget(QWidget *parent, const QString &text, Qt::Orientation orientation, int transparency)
|
||||
: QWidget(parent), gradientOrientation(orientation), transparency(qBound(0, transparency, 100))
|
||||
BannerWidget::BannerWidget(QWidget *parent, const QString &text, Qt::Orientation orientation, int transparency_)
|
||||
: QWidget(parent), gradientOrientation(orientation), transparency(qBound(0, transparency_, 100))
|
||||
{
|
||||
auto layout = new QHBoxLayout(this);
|
||||
|
||||
|
|
@ -18,7 +18,12 @@ BannerWidget::BannerWidget(QWidget *parent, const QString &text, Qt::Orientation
|
|||
// Create the banner label and set properties
|
||||
bannerLabel = new QLabel(text, this);
|
||||
bannerLabel->setAlignment(Qt::AlignCenter);
|
||||
bannerLabel->setStyleSheet("font-size: 24px; font-weight: bold; color: white;");
|
||||
|
||||
QString textColor;
|
||||
if (transparency > 50) {
|
||||
textColor = " color: white;";
|
||||
}
|
||||
bannerLabel->setStyleSheet("font-size: 24px; font-weight: bold;" + textColor);
|
||||
|
||||
layout->addWidget(iconLabel);
|
||||
layout->addWidget(bannerLabel);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue