diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-05-04 17:06:30 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-05-04 17:06:30 +0200 |
commit | ea3656e3a6991721b90a170d868bb3f540ba6291 (patch) | |
tree | 3c8bb206ac102b149c60491f204614ce127700d9 | |
parent | 346aa382e720962a7974c484afdbfa9d6aba51ff (diff) | |
download | kube-ea3656e3a6991721b90a170d868bb3f540ba6291.tar.gz kube-ea3656e3a6991721b90a170d868bb3f540ba6291.zip |
Ensure we have the correct icon theme.
Happens with the qt5ct platform plugin at least.
Since the theme gets loaded from the eventloop we have no clear place to
make sure our setting is honored...
-rw-r--r-- | applications/kube/main.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/applications/kube/main.cpp b/applications/kube/main.cpp index c893e029..03a128c4 100644 --- a/applications/kube/main.cpp +++ b/applications/kube/main.cpp | |||
@@ -20,6 +20,11 @@ public: | |||
20 | 20 | ||
21 | QPixmap requestPixmap(const QString &id, QSize *size, const QSize &requestedSize) Q_DECL_OVERRIDE | 21 | QPixmap requestPixmap(const QString &id, QSize *size, const QSize &requestedSize) Q_DECL_OVERRIDE |
22 | { | 22 | { |
23 | //The platform theme plugin can overwrite our setting again once it gets loaded, | ||
24 | //so we check on every icon load request... | ||
25 | if (QIcon::themeName() != "kube") { | ||
26 | QIcon::setThemeName("kube"); | ||
27 | } | ||
23 | const auto icon = QIcon::fromTheme(id); | 28 | const auto icon = QIcon::fromTheme(id); |
24 | auto expectedSize = requestedSize; | 29 | auto expectedSize = requestedSize; |
25 | if (!icon.availableSizes().contains(requestedSize) && !icon.availableSizes().isEmpty()) { | 30 | if (!icon.availableSizes().contains(requestedSize) && !icon.availableSizes().isEmpty()) { |