# HG changeset patch # User sheepluva # Date 1319238021 -7200 # Node ID 19ef039a847497e861d6e89f38745aa267ef7904 # Parent a80833ddaef0ae45fb53264ea20e1d88ef44ac21 frontend will use the data file misc/qt_style.css instead of hardcoded stylesheet - if the file exists diff -r a80833ddaef0 -r 19ef039a8474 QTfrontend/main.cpp --- a/QTfrontend/main.cpp Sat Oct 22 00:00:48 2011 +0200 +++ b/QTfrontend/main.cpp Sat Oct 22 01:00:21 2011 +0200 @@ -481,8 +481,24 @@ // this creates the autoreleasepool that prevents leaking CocoaInitializer initializer; #endif + // load external stylesheet if there is any + QFile * file = + new QFile(HWDataManager::instance().findFileForRead("misc/qt_style.css")); - app.form = new HWForm(NULL,styleSheetFromHell); + if (file->exists() && file->open(QIODevice::ReadOnly | QIODevice::Text)) + { + QString style = ""; + QTextStream in(file); + while (!in.atEnd()) + { + QString line = in.readLine(); + if(!line.isEmpty()) + style.append(line); + } + app.form = new HWForm(NULL, style); + } + else + app.form = new HWForm(NULL, styleSheetFromHell); app.form->show(); return app.exec();