Skip to content

Commit 8edf92d

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

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/gui/uithememanager.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@ namespace
5656
const QColor &color = palette.color(QPalette::Active, QPalette::Base);
5757
return (color.lightness() < 127);
5858
}
59+
60+
Path resolveThemePath(const Path &themePath)
61+
{
62+
if (themePath.isAbsolute())
63+
return themePath;
64+
65+
return (Path(QCoreApplication::applicationDirPath()) / themePath);
66+
}
5967
}
6068

6169
UIThemeManager *UIThemeManager::m_instance = nullptr;
@@ -100,7 +108,7 @@ UIThemeManager::UIThemeManager()
100108

101109
if (m_useCustomTheme)
102110
{
103-
const Path themePath = Preferences::instance()->customUIThemePath();
111+
const Path themePath = resolveThemePath(Preferences::instance()->customUIThemePath());
104112

105113
if (themePath.hasExtension(u".qbtheme"_s))
106114
{

0 commit comments

Comments
 (0)