Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

check for css in application path (win32) or Resources bundle folder …

…(osx) if not specified as command line arg
  • Loading branch information...
commit 31b735f6aae11e2a7e0eed36a2ca53161a0b1b63 1 parent b5f307f
@jonocole jonocole authored
Showing with 15 additions and 0 deletions.
  1. +15 −0 lib/unicorn/UnicornApplication.cpp
View
15 lib/unicorn/UnicornApplication.cpp
@@ -39,6 +39,8 @@
#include <QDebug>
#include <QLocale>
#include <QTranslator>
+#include <QFile>
+#include <QFileInfo>
unicorn::Application::Application( int& argc, char** argv ) throw( StubbornUserException )
@@ -56,6 +58,19 @@ unicorn::Application::Application( int& argc, char** argv ) throw( StubbornUserE
AEInstallEventHandler( kCoreEventClass, kAEReopenApplication, h, 0, false );
#endif
+ #ifdef Q_WS_MAC
+ #define CSS_PATH "/../Resources/"
+ #else
+ #define CSS_PATH "/"
+ #endif
+ if( styleSheet().isEmpty()) {
+ QString cssFileName = QFileInfo(applicationFilePath()).baseName() + ".css";
+ QFile stylesheetFile( applicationDirPath() + CSS_PATH + cssFileName );
+ stylesheetFile.open( QIODevice::ReadOnly );
+ QString stylesheet( stylesheetFile.readAll() );
+ setStyleSheet( stylesheet );
+ }
+
translate();
GlobalSettings s;
Please sign in to comment.
Something went wrong with that request. Please try again.