on xenial help sign in
Added ability to change indicator profile in shell
bcfe0ceNick Dedekind
qml/Panel/Indicators.qml+1−1
@@ -32,7 +32,7 @@ Showable {
32 property alias overFlowWidth: indicatorRow.overFlowWidth
32 property alias overFlowWidth: indicatorRow.overFlowWidth
33 property alias showAll: indicatorRow.showAll
33 property alias showAll: indicatorRow.showAll
34 // TODO: This should be sourced by device type (eg "desktop", "tablet", "phone"...)
34 // TODO: This should be sourced by device type (eg "desktop", "tablet", "phone"...)
35− property string profile: "phone"
35+ property string profile: indicatorProfile
36
36
37 readonly property real hintValue: panelHeight + menuContent.headerHeight
37 readonly property real hintValue: panelHeight + menuContent.headerHeight
38 readonly property int lockThreshold: openedHeight / 2
38 readonly property int lockThreshold: openedHeight / 2
src/main.cpp+6
@@ -59,6 +59,11 @@ int startShell(int argc, const char** argv, void* server)
59 application = new QGuiApplication(argc, (char**)argv);
59 application = new QGuiApplication(argc, (char**)argv);
60 }
60 }
61
61
62+ QString indicatorProfile = qgetenv("UNITY_INDICATOR_PROFILE");
63+ if (indicatorProfile.isEmpty()) {
64+ indicatorProfile = "phone";
65+ }
66+
62 resolveIconTheme();
67 resolveIconTheme();
63
68
64 QStringList args = application->arguments();
69 QStringList args = application->arguments();
@@ -88,6 +93,7 @@ int startShell(int argc, const char** argv, void* server)
88 view->setTitle("Qml Phone Shell");
93 view->setTitle("Qml Phone Shell");
89 view->engine()->setBaseUrl(QUrl::fromLocalFile(::qmlDirectory()));
94 view->engine()->setBaseUrl(QUrl::fromLocalFile(::qmlDirectory()));
90 view->rootContext()->setContextProperty("applicationArguments", &qmlArgs);
95 view->rootContext()->setContextProperty("applicationArguments", &qmlArgs);
96+ view->rootContext()->setContextProperty("indicatorProfile", indicatorProfile);
91 if (args.contains(QLatin1String("-frameless"))) {
97 if (args.contains(QLatin1String("-frameless"))) {
92 view->setFlags(Qt::FramelessWindowHint);
98 view->setFlags(Qt::FramelessWindowHint);
93 }
99 }