diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-10-02 06:47:03 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-10-02 07:54:22 +0200 |
commit | e005e2d94994e576509069f04fcee194ceadc30b (patch) | |
tree | 16157bc544a2172b307c620db2fca05e193f3b94 /gui/mapping-window.cpp | |
parent | d96da9e2205f0b81e1088a7ce78a7fe76c4db369 (diff) |
gui: fix tab widget background color
Diffstat (limited to 'gui/mapping-window.cpp')
-rw-r--r-- | gui/mapping-window.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/gui/mapping-window.cpp b/gui/mapping-window.cpp index 46224078..0d2c9fbb 100644 --- a/gui/mapping-window.cpp +++ b/gui/mapping-window.cpp @@ -14,6 +14,36 @@ MapWidget::MapWidget(Mappings& m) : m(m), widgets{} { ui.setupUi(this); + QWidget* pages[] = { + ui.tabWidgetPage1, + ui.tabWidgetPage2, + ui.tabWidgetPage3, + ui.tabWidgetPage4, + ui.tabWidgetPage5, + ui.tabWidgetPage6, + }; + + { + QColor bg = palette().background().color(); + + QString tmp; + tmp.reserve(32); + + tmp += QStringLiteral(".QWidget { background-color: #"); + + for (int i : { bg.red(), bg.green(), bg.blue() }) + { + if (i < 0xf0) + tmp += '0'; + tmp += QString::number(i, 16); + } + + tmp += "; }"; + + for (QWidget* w : pages) + w->setStyleSheet(tmp); + } + load(); connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK())); |