Support IDA's $RELPATH in themes
This commit is contained in:
parent
5f758c8e9c
commit
4cb959cf41
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue