diff --git a/README.md b/README.md index f7d159b..3596431 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ Create file `theme.conf.user` in theme folder. See `slice/theme.conf` for refere * `font` - overall font. Defaults to `Roboto`. * `background` - path to background image. If not set, falls back to `color_bg`. Not set by default. +* `parallax_bg_shift` - shifting of parallax background on tab change in pixels. `0` disables parallax motion. Negative values will scroll background in opposite direction. Default is `20`. * `color_bg` - main background color. Defaults to `#222222`. * `color_button_bg_idle` - button background color (in idle state). Defaults to `#888888`. * `color_button_bg_hover` - button background color (in hover state). Defaults to `#aaaaaa`. diff --git a/slice/Main.qml b/slice/Main.qml index ca44018..bbddec6 100644 --- a/slice/Main.qml +++ b/slice/Main.qml @@ -15,7 +15,7 @@ Rectangle { name: "statePower" - PropertyChanges { target: background; x: geometry.x } + PropertyChanges { target: background; x: (config.parallax_bg_shift < 0 ? geometry.x - Math.abs(config.parallax_bg_shift*2) : geometry.x ) } PropertyChanges { target: pagePower; enabled: true ; focus: true ; x: 0 } PropertyChanges { target: pageSessions; enabled: false; focus: false; x: areaMain.width } @@ -30,7 +30,7 @@ Rectangle { name: "stateSessions" - PropertyChanges { target: background; x: geometry.x - 20 } + PropertyChanges { target: background; x: geometry.x - Math.abs(config.parallax_bg_shift) } PropertyChanges { target: pagePower; enabled: false; focus: false; x: -areaMain.width } PropertyChanges { target: pageSessions; enabled: true ; focus: true ; x: 0 } @@ -44,7 +44,7 @@ Rectangle { name: "stateUsers" - PropertyChanges { target: background; x: geometry.x - 40 } + PropertyChanges { target: background; x: (config.parallax_bg_shift > 0 ? geometry.x - Math.abs(config.parallax_bg_shift*2) : geometry.x ) } PropertyChanges { target: pagePower; enabled: false; focus: false; x: -areaMain.width * 2 } PropertyChanges { target: pageSessions; enabled: false; focus: false; x: -areaMain.width } @@ -61,9 +61,9 @@ Rectangle Background { id: background - x: geometry.x - 40 + x: (config.parallax_bg_shift > 0 ? geometry.x - Math.abs(config.parallax_bg_shift*2) : geometry.x ) y: geometry.y - width: geometry.width + 40 + width: geometry.width + Math.abs(config.parallax_bg_shift*2) height: geometry.height source: config.background fillMode: Image.PreserveAspectCrop diff --git a/slice/theme.conf b/slice/theme.conf index 742eb74..1066c4e 100644 --- a/slice/theme.conf +++ b/slice/theme.conf @@ -1,6 +1,7 @@ [General] font=Roboto background= +parallax_bg_shift=20 color_bg=#222222 color_button_bg_idle=#888888 color_button_bg_hover=#aaaaaa