@@ -56,6 +56,26 @@ IndicatorsClient::IndicatorsClient(int &argc, char **argv)
5656 m_view(0)
5757{
5858 m_application = new QApplication(argc, argv);
59+ QStringList args = m_application->arguments();
60+
61+ m_view = new QQuickView;
62+ m_view->engine()->setBaseUrl(QUrl::fromLocalFile(::shellAppDirectory()+"Panel/Indicators/client/"));
63+ prependImportPaths(m_view->engine(), ::overrideImportPaths());
64+ appendImportPaths(m_view->engine(), ::fallbackImportPaths());
65+
66+ m_view->setSource(QUrl("IndicatorsClient.qml"));
67+ m_view->setResizeMode(QQuickView::SizeRootObjectToView);
68+
69+ if (args.contains(QLatin1String("-geometry")) && args.size() > args.indexOf(QLatin1String("-geometry")) + 1) {
70+ QStringList geometryArg = args.at(args.indexOf(QLatin1String("-geometry")) + 1).split('x');
71+ if (geometryArg.size() == 2) {
72+ m_view->resize(geometryArg.at(0).toInt(), geometryArg.at(1).toInt());
73+ }
74+ }
75+ else {
76+ //Usable size on desktop
77+ m_view->setMinimumSize(QSize(480, 720));
78+ }
5979}
6080
6181IndicatorsClient::~IndicatorsClient()
@@ -69,21 +89,11 @@ IndicatorsClient::~IndicatorsClient()
6989
7090void IndicatorsClient::setupUI()
7191{
72− m_view = new QQuickView;
73− m_view->engine()->setBaseUrl(QUrl::fromLocalFile(::shellAppDirectory()+"Panel/Indicators/client/"));
74− prependImportPaths(m_view->engine(), ::overrideImportPaths());
75− appendImportPaths(m_view->engine(), ::fallbackImportPaths());
76−
77− m_view->setSource(QUrl("IndicatorsClient.qml"));
78− m_view->setResizeMode(QQuickView::SizeRootObjectToView);
7992
80− //Usable size on desktop
81− m_view->setMinimumSize(QSize(480, 720));
8293}
8394
8495int IndicatorsClient::run()
8596{
86− setupUI();
8797 m_view->show();
8898 return m_application->exec();
8999}