From 9540ce5e1c5bd4935013ad2193ae51e379aeae6f Mon Sep 17 00:00:00 2001 From: RadRussianRus Date: Thu, 31 May 2018 03:10:54 +0300 Subject: [PATCH] Added option to set background image (fixes #1) --- slice/Main.qml | 21 +++++++++++++++++++++ slice/theme.conf | 1 + 2 files changed, 22 insertions(+) diff --git a/slice/Main.qml b/slice/Main.qml index 60da738..7ff64e4 100644 --- a/slice/Main.qml +++ b/slice/Main.qml @@ -6,6 +6,7 @@ Rectangle { id: root color: config.color_bg + property variant geometry: screenModel.geometry(screenModel.primary) state: "stateUsers" states: @@ -14,6 +15,8 @@ Rectangle { name: "statePower" + PropertyChanges { target: background; x: geometry.x } + PropertyChanges { target: pagePower; enabled: true ; focus: true ; x: 0 } PropertyChanges { target: pageSessions; enabled: false; focus: false; x: areaMain.width } PropertyChanges { target: pageUsers; enabled: false; focus: false; x: areaMain.width * 2 } @@ -27,6 +30,8 @@ Rectangle { name: "stateSessions" + PropertyChanges { target: background; x: geometry.x - 20 } + PropertyChanges { target: pagePower; enabled: false; focus: false; x: -areaMain.width } PropertyChanges { target: pageSessions; enabled: true ; focus: true ; x: 0 } PropertyChanges { target: pageUsers; enabled: false; focus: false; x: areaMain.width } @@ -39,6 +44,8 @@ Rectangle { name: "stateUsers" + PropertyChanges { target: background; x: geometry.x - 40 } + PropertyChanges { target: pagePower; enabled: false; focus: false; x: -areaMain.width * 2 } PropertyChanges { target: pageSessions; enabled: false; focus: false; x: -areaMain.width } PropertyChanges { target: pageUsers; enabled: true ; focus: true ; x: 0 } @@ -51,6 +58,20 @@ Rectangle TextConstants { id: localeText } + Background + { + id: background + x: geometry.x - 40 + y: geometry.y + width: geometry.width + 40 + height: geometry.height + source: config.background + fillMode: Image.PreserveAspectCrop + visible: status != Image.Error + + Behavior on x { NumberAnimation { duration: 150 } } + } + Item { id: areaTop diff --git a/slice/theme.conf b/slice/theme.conf index 866dac5..69a8a70 100644 --- a/slice/theme.conf +++ b/slice/theme.conf @@ -1,5 +1,6 @@ [General] font=Roboto +background= color_bg=#222222 color_button_bg_idle=#888888 color_button_bg_hover=#aaaaaa