summaryrefslogtreecommitdiffhomepage
path: root/gui/mapping-dialog.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2019-06-25 20:02:55 +0200
committerStanislaw Halik <sthalik@misaki.pl>2019-06-25 20:02:55 +0200
commitf4b4164052672441440c4f1e5122bc6303843cdc (patch)
tree513c86157929bcca46f38427097d3ff5d9f1af30 /gui/mapping-dialog.cpp
parentdd99fa49655e20809baed17bc2da977b19c3b12c (diff)
gui/mapping: fix background color display
Diffstat (limited to 'gui/mapping-dialog.cpp')
-rw-r--r--gui/mapping-dialog.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/gui/mapping-dialog.cpp b/gui/mapping-dialog.cpp
index 6dc6d15f..af35c999 100644
--- a/gui/mapping-dialog.cpp
+++ b/gui/mapping-dialog.cpp
@@ -28,21 +28,13 @@ mapping_dialog::mapping_dialog(Mappings& m) : m(m), widgets{}
};
{
- QColor bg = palette().background().color();
+ QColor bg = palette().window().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 += "; }";
+ tmp += QStringLiteral(".QWidget { background-color: rgb(%1, %2, %3); } ")
+ .arg(bg.red()).arg(bg.green()).arg(bg.blue());
for (QWidget* w : pages)
w->setStyleSheet(tmp);