# HG changeset patch # User Matti Hamalainen # Date 1491473592 -10800 # Node ID d565867f2b0b6259a0874f52aa526832d574854e # Parent 2cc7c89ab649ca0151798ec4c29ed89ce90e4c6d UI visual improvements. diff -r 2cc7c89ab649 -r d565867f2b0b main.cpp --- a/main.cpp Thu Apr 06 13:04:08 2017 +0300 +++ b/main.cpp Thu Apr 06 13:13:12 2017 +0300 @@ -114,18 +114,25 @@ void setCommonStyleSheet(QWidget *widget) { + // Clamp scale value if (setScale < 0.5f) setScale = 0.5f; if (setScale > 3.0f) setScale = 3.0f; + // Set the stylesheet widget->setStyleSheet( QStringLiteral( "* { font-size: %1pt; }" "QPushButton { font-size: %2pt; padding: 0.25em; }" - "#button_AddDebt { font-size: %3pt; background-color: #900; color: black; }" - "#button_PayDebt { font-size: %3pt; background-color: #090; color: black; }" - "#button_PayFullDebt { background-color: #060; color: black; }" + "#button_AddDebt[enabled='true'] { font-size: %3pt; background-color: #900; color: white; }" + "#button_PayDebt[enabled='true'] { font-size: %3pt; background-color: #090; color: white; }" + "#button_PayFullDebt[enabled='true'] { background-color: #060; color: white; }" + + "#button_AddDebt[enabled='false'] { font-size: %3pt; background-color: #622; color: black; }" + "#button_PayDebt[enabled='false'] { font-size: %3pt; background-color: #262; color: black; }" + "#button_PayFullDebt[enabled='false'] { background-color: #131; color: black; }" + "#label_PersonName { font-size: %5pt; font-weight: bold; }" "#label_BalanceValue { font-size: %4pt; font-weight: bold; }" "#label_EUR { font-size: %4pt; font-weight: bold; }" @@ -361,6 +368,7 @@ ui->tableview_Latest->verticalHeader()->setVisible(false); ui->tableview_Latest->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); + setCommonStyleSheet(this); return; // Ugly } } @@ -372,6 +380,7 @@ ui->label_BalanceValue->setStyleSheet(NULL); ui->label_PersonName->setText("???"); ui->tableview_Latest->setModel(NULL); + setCommonStyleSheet(this); }