Skip to content

Commit

Permalink
Fix font, we only have Droid Sans, set color style
Browse files Browse the repository at this point in the history
  • Loading branch information
KjellMorgenstern committed Dec 20, 2023
1 parent db80c5c commit 6e0beae
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions src/sketch/welcomeview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,28 +140,24 @@ CustomListItem::CustomListItem(const QString &leftText, const QIcon &leftIcon, c
rightButton->setFlat(true);

QString buttonStyle = QString("QPushButton { "
"text-align: left; "
"background-color: transparent; "
"border: none; "
"padding-left: %1px; "
"padding-right: %1px; "
"}"
"QPushButton:pressed { "
"color: #555; "
"}").arg(padding);
"text-align: left; "
"background-color: transparent; "
"border: none; "
"padding-left: %1px; "
"padding-right: %1px; "
"color: #333;"
"}"
"QPushButton:pressed { "
"color: #005; "
"}")
.arg(padding);
leftButton->setStyleSheet(buttonStyle);
rightButton->setStyleSheet(buttonStyle);

QFont buttonFont = leftButton->font();
buttonFont.setPointSize(buttonFont.pointSize() - 2);
QFont buttonFont("Droid Sans", 10, QFont::Normal);
leftButton->setFont(buttonFont);
rightButton->setFont(buttonFont);

QPalette buttonPalette = leftButton->palette();
buttonPalette.setColor(QPalette::ButtonText, Qt::black);
leftButton->setPalette(buttonPalette);
rightButton->setPalette(buttonPalette);

int scrollbarWidth = this->style()->pixelMetric(QStyle::PM_ScrollBarExtent);
int leftButtonWidth = static_cast<int>((listWidgetWidth - scrollbarWidth) * 0.7);
int rightButtonWidth = static_cast<int>((listWidgetWidth - scrollbarWidth) * 0.3);
Expand Down

0 comments on commit 6e0beae

Please sign in to comment.