From ea3656e3a6991721b90a170d868bb3f540ba6291 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 4 May 2017 17:06:30 +0200 Subject: 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... --- applications/kube/main.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'applications') 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: QPixmap requestPixmap(const QString &id, QSize *size, const QSize &requestedSize) Q_DECL_OVERRIDE { + //The platform theme plugin can overwrite our setting again once it gets loaded, + //so we check on every icon load request... + if (QIcon::themeName() != "kube") { + QIcon::setThemeName("kube"); + } const auto icon = QIcon::fromTheme(id); auto expectedSize = requestedSize; if (!icon.availableSizes().contains(requestedSize) && !icon.availableSizes().isEmpty()) { -- cgit v1.2.3