1
0
Fork 0

Support IDA's $RELPATH in themes

This commit is contained in:
Duncan Ogilvie 2022-09-02 14:51:21 +02:00
parent 5f758c8e9c
commit 4cb959cf41
1 changed files with 6 additions and 0 deletions

View File

@ -587,6 +587,8 @@ void MainWindow::loadSelectedTheme(bool reloadOnlyStyleCss)
}
QString themePath = QString("%1/../themes/%2/style.css").arg(QCoreApplication::applicationDirPath()).arg(selectedTheme);
if(!QFile(themePath).exists())
themePath = QString("%1/../themes/%2/theme.css").arg(QCoreApplication::applicationDirPath()).arg(selectedTheme);
if(QFile(themePath).exists())
stylePath = themePath;
@ -600,6 +602,7 @@ void MainWindow::loadSelectedTheme(bool reloadOnlyStyleCss)
};
tryIni("style.ini");
tryIni("colors.ini");
tryIni("theme.ini");
}
else
{
@ -613,6 +616,9 @@ void MainWindow::loadSelectedTheme(bool reloadOnlyStyleCss)
auto style = QTextStream(&cssFile).readAll();
cssFile.close();
style = style.replace("url(./", QString("url(../themes/%2/").arg(selectedTheme));
style = style.replace("url(\"./", QString("url(\"../themes/%2/").arg(selectedTheme));
style = style.replace("url('./", QString("url('../themes/%2/").arg(selectedTheme));
style = style.replace("$RELPATH", QString("../themes/%2/").arg(selectedTheme));
qApp->setStyleSheet(style);
}