Merge pull request #3161 from shocoman/development-6
Quote image paths in the Dark theme stylesheet
This commit is contained in:
commit
d162dd1adc
|
@ -655,10 +655,11 @@ void MainWindow::loadSelectedTheme(bool reloadOnlyStyleCss)
|
|||
{
|
||||
auto style = QTextStream(&cssFile).readAll();
|
||||
cssFile.close();
|
||||
style = style.replace("url(./", QString("url(%1/../themes/%2/").arg(applicationDirPath, selectedTheme));
|
||||
style = style.replace("url(\"./", QString("url(\"%1/../themes/%2/").arg(applicationDirPath, selectedTheme));
|
||||
style = style.replace("url('./", QString("url('%1/../themes/%2/").arg(applicationDirPath, selectedTheme));
|
||||
style = style.replace("$RELPATH", QString("%1/../themes/%2").arg(applicationDirPath, selectedTheme));
|
||||
|
||||
style = style.replace("url(./", QString("url(approot:/themes/%1/").arg(selectedTheme));
|
||||
style = style.replace("url(\"./", QString("url(\"approot:/themes/%1/").arg(selectedTheme));
|
||||
style = style.replace("url('./", QString("url('approot:/themes/%1/").arg(selectedTheme));
|
||||
style = style.replace("$RELPATH", QString("approot:/themes/%1").arg(selectedTheme));
|
||||
qApp->setStyleSheet(style);
|
||||
}
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include <QTextStream>
|
||||
#include <QLibraryInfo>
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
#include "MiscUtil.h"
|
||||
|
||||
MyApplication::MyApplication(int & argc, char** argv)
|
||||
|
@ -181,6 +182,9 @@ int main(int argc, char* argv[])
|
|||
appPalette.setColor(QPalette::Link, ConfigColor("LinkColor"));
|
||||
application.setPalette(appPalette);
|
||||
|
||||
// Register a path prefix for the program main directory
|
||||
QDir::addSearchPath("approot", QApplication::applicationDirPath() + "/..");
|
||||
|
||||
// Load the selected theme
|
||||
MainWindow::loadSelectedTheme(true);
|
||||
|
||||
|
|
Loading…
Reference in New Issue