changeset 40:d565867f2b0b

UI visual improvements.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 06 Apr 2017 13:13:12 +0300
parents 2cc7c89ab649
children c953ee761af0
files main.cpp
diffstat 1 files changed, 12 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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);
 }