Skip to content

Commit 7c9facb

Browse files
Resolve relative UI theme paths
PR #24514. Closes #24489.
1 parent 15a61cb commit 7c9facb

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/gui/uithememanager.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939

4040
#include "base/logger.h"
4141
#include "base/path.h"
42+
#include "base/profile.h"
4243
#include "base/preferences.h"
4344
#include "uithemecommon.h"
4445

@@ -56,6 +57,11 @@ 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+
return (themePath.isAbsolute() ? themePath : (Profile::instance()->rootPath() / themePath));
64+
}
5965
}
6066

6167
UIThemeManager *UIThemeManager::m_instance = nullptr;
@@ -100,7 +106,7 @@ UIThemeManager::UIThemeManager()
100106

101107
if (m_useCustomTheme)
102108
{
103-
const Path themePath = Preferences::instance()->customUIThemePath();
109+
const Path themePath = resolveThemePath(Preferences::instance()->customUIThemePath());
104110

105111
if (themePath.hasExtension(u".qbtheme"_s))
106112
{

0 commit comments

Comments
 (0)