Skip to content

Commit a464881

Browse files
Resolve relative UI theme paths from app directory
1 parent 8cded3c commit a464881

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

src/gui/uithememanager.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include "uithememanager.h"
3232

3333
#include <QApplication>
34+
#include <QCoreApplication>
3435
#include <QPalette>
3536
#include <QPixmapCache>
3637
#include <QResource>
@@ -56,6 +57,14 @@ namespace
5657
const QColor &color = palette.color(QPalette::Active, QPalette::Base);
5758
return (color.lightness() < 127);
5859
}
60+
61+
Path resolveThemePath(const Path &themePath)
62+
{
63+
if (themePath.isAbsolute())
64+
return themePath;
65+
66+
return (Path(QCoreApplication::applicationDirPath()) / themePath);
67+
}
5968
}
6069

6170
UIThemeManager *UIThemeManager::m_instance = nullptr;
@@ -100,7 +109,7 @@ UIThemeManager::UIThemeManager()
100109

101110
if (m_useCustomTheme)
102111
{
103-
const Path themePath = Preferences::instance()->customUIThemePath();
112+
const Path themePath = resolveThemePath(Preferences::instance()->customUIThemePath());
104113

105114
if (themePath.hasExtension(u".qbtheme"_s))
106115
{

0 commit comments

Comments
 (0)