aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominik Holland <dominik.holland@pelagicore.com>2018-06-13 14:08:20 +0200
committerBramastyo Harimukti Santoso <bramastyo.harimukti.santoso@pelagicore.com>2018-06-13 12:57:48 +0000
commit8404a150790e2bf73fd1c95b8ccc4cc80d104789 (patch)
tree808ce93cdf2143c31cbd263e04ca6210c5d4df81
parent07a84e046beb36a7e73fdaf2d6b36de0df095748 (diff)
[cluster] Fix styling issues in single-process mode
Changing the theme and accent color was not possible in single-process mode because the ApplicationManagerWindow doesn't have a contentItem where we can change the NeptuneTheme attached property. Change-Id: I992d0857e1d5c7ee8ac4ab28215a03ca69c2df34 Reviewed-by: Daniel d'Andrada <daniel.dandrada@luxoft.com> Reviewed-by: Bramastyo Harimukti Santoso <bramastyo.harimukti.santoso@pelagicore.com>
-rw-r--r--apps/com.theqtcompany.cluster/Main.qml14
1 files changed, 12 insertions, 2 deletions
diff --git a/apps/com.theqtcompany.cluster/Main.qml b/apps/com.theqtcompany.cluster/Main.qml
index 5ef95b47..1e445991 100644
--- a/apps/com.theqtcompany.cluster/Main.qml
+++ b/apps/com.theqtcompany.cluster/Main.qml
@@ -52,11 +52,21 @@ ApplicationManagerWindow {
UISettings {
onThemeChanged: updateTheme()
onAccentColorChanged: {
- root.contentItem.NeptuneStyle.accentColor = accentColor;
+ // In single-process mode we don't have a contentItem, so we need to use root instead
+ // TODO This should be fixed in the appman abstraction at some point
+ if (root.contentItem)
+ root.contentItem.NeptuneStyle.accentColor = accentColor;
+ else
+ root.NeptuneStyle.accentColor = accentColor;
}
Component.onCompleted: updateTheme()
function updateTheme() {
- root.contentItem.NeptuneStyle.theme = theme === 0 ? NeptuneStyle.Light : NeptuneStyle.Dark;
+ // In single-process mode we don't have a contentItem, so we need to use root instead
+ // TODO This should be fixed in the appman abstraction at some point
+ if (root.contentItem)
+ root.contentItem.NeptuneStyle.theme = theme === 0 ? NeptuneStyle.Light : NeptuneStyle.Dark;
+ else
+ root.NeptuneStyle.theme = theme === 0 ? NeptuneStyle.Light : NeptuneStyle.Dark;
}
}