aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-theme-engine/src/lthemeengine/paletteeditdialog.cpp
diff options
context:
space:
mode:
authorq5sys <jt@obs-sec.com>2017-07-31 10:46:20 -0400
committerq5sys <jt@obs-sec.com>2017-07-31 10:46:20 -0400
commitea6f15b08ce9d4218c3fdda33a11c4b1869f6a50 (patch)
treeef9c881a35cd678a26d95f2fca5698a1e6870c4c /src-qt5/core/lumina-theme-engine/src/lthemeengine/paletteeditdialog.cpp
parentMerge branch 'master' of https://github.com/trueos/lumina (diff)
downloadlumina-ea6f15b08ce9d4218c3fdda33a11c4b1869f6a50.tar.gz
lumina-ea6f15b08ce9d4218c3fdda33a11c4b1869f6a50.tar.bz2
lumina-ea6f15b08ce9d4218c3fdda33a11c4b1869f6a50.zip
bring bracket sanity to a wasteland of if statements
Diffstat (limited to 'src-qt5/core/lumina-theme-engine/src/lthemeengine/paletteeditdialog.cpp')
-rw-r--r--src-qt5/core/lumina-theme-engine/src/lthemeengine/paletteeditdialog.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/src-qt5/core/lumina-theme-engine/src/lthemeengine/paletteeditdialog.cpp b/src-qt5/core/lumina-theme-engine/src/lthemeengine/paletteeditdialog.cpp
index 8a8e86d0..9cce5a6e 100644
--- a/src-qt5/core/lumina-theme-engine/src/lthemeengine/paletteeditdialog.cpp
+++ b/src-qt5/core/lumina-theme-engine/src/lthemeengine/paletteeditdialog.cpp
@@ -37,15 +37,12 @@ QPalette PaletteEditDialog::selectedPalette() const{
void PaletteEditDialog::setPalette(const QPalette &palette){
for(int i = 0; i < QPalette::NColorRoles; i++){
- if(!m_ui->tableWidget->item(i,0))
- m_ui->tableWidget->setItem(i, 0, new QTableWidgetItem());
- if(!m_ui->tableWidget->item(i,1))
- m_ui->tableWidget->setItem(i, 1, new QTableWidgetItem());
- if(!m_ui->tableWidget->item(i,2))
- m_ui->tableWidget->setItem(i, 2, new QTableWidgetItem());
- m_ui->tableWidget->item(i,0)->setBackgroundColor(palette.color(QPalette::Active, QPalette::ColorRole(i)));
- m_ui->tableWidget->item(i,1)->setBackgroundColor(palette.color(QPalette::Inactive, QPalette::ColorRole(i)));
- m_ui->tableWidget->item(i,2)->setBackgroundColor(palette.color(QPalette::Disabled, QPalette::ColorRole(i)));
+ if(!m_ui->tableWidget->item(i,0)){ m_ui->tableWidget->setItem(i, 0, new QTableWidgetItem()); }
+ if(!m_ui->tableWidget->item(i,1)){ m_ui->tableWidget->setItem(i, 1, new QTableWidgetItem()); }
+ if(!m_ui->tableWidget->item(i,2)){ m_ui->tableWidget->setItem(i, 2, new QTableWidgetItem()); }
+ m_ui->tableWidget->item(i,0)->setBackgroundColor(palette.color(QPalette::Active, QPalette::ColorRole(i)));
+ m_ui->tableWidget->item(i,1)->setBackgroundColor(palette.color(QPalette::Inactive, QPalette::ColorRole(i)));
+ m_ui->tableWidget->item(i,2)->setBackgroundColor(palette.color(QPalette::Disabled, QPalette::ColorRole(i)));
}
QStringList labels;
labels << tr("Window text") << tr("Button background") << tr("Bright") << tr("Less bright") << tr("Dark") << tr("Less dark") << tr("Normal text") << tr("Bright text") << tr("Button text") << tr("Normal background") << tr("Window") << tr("Shadow") << tr("Highlight") << tr("Highlighted text") << tr("Link") << tr("Visited link") << tr("Alternate background") << tr("Default") << tr("Tooltip background") << tr("Tooltip text");
bgstack15