Merge pull request #31 from hat3ph/patch-1

Add Day/Night background image
This commit is contained in:
eximus
2021-07-28 14:27:10 +01:00
committed by GitHub
4 changed files with 18 additions and 14 deletions

View File

@@ -43,8 +43,9 @@ Rectangle {
// Set Background Image
Image {
id: image1
anchors.fill: parent
source: config.background
//source: config.background
fillMode: Image.PreserveAspectCrop
}
@@ -505,11 +506,13 @@ Rectangle {
// load and randomize playlist
var time = parseInt(new Date().toLocaleTimeString(Qt.locale(),'h'))
if ( time >= 5 && time <= 17 ) {
playlist1.load(Qt.resolvedUrl(config.background_day), 'm3u')
playlist2.load(Qt.resolvedUrl(config.background_day), 'm3u')
playlist1.load(Qt.resolvedUrl(config.background_vid_day), 'm3u')
playlist2.load(Qt.resolvedUrl(config.background_vid_day), 'm3u')
image1.source = config.background_img_day
} else {
playlist1.load(Qt.resolvedUrl(config.background_night), 'm3u')
playlist2.load(Qt.resolvedUrl(config.background_night), 'm3u')
playlist1.load(Qt.resolvedUrl(config.background_vid_night), 'm3u')
playlist2.load(Qt.resolvedUrl(config.background_vid_night), 'm3u')
image1.source = config.background_img_night
}
for (var k = 0; k < Math.ceil(Math.random() * 10) ; k++) {

View File

@@ -50,8 +50,8 @@ done < playlist_file
### Changing settings in `theme.conf.user`
You can change a few settings in this file
- `background` - default background image
- `background_day` and `background_night` - video playlists
- `background_img_day` and `background_img_night` - default background day/night image
- `background_vid_day` and `background_vid_night` - video playlists
- `displayFont` - font
- `showLoginButton` - if set to false will hide the login button
- `showClearPasswordButton` - if set to false will hide the clear password button that appears when text is inputed
@@ -63,8 +63,8 @@ Example config (not the same as the screenshots):
```
[General]
background_day=playlist_day.m3u
background_night=playlist_night.m3u
background_vid_day=playlist_day.m3u
background_vid_night=playlist_night.m3u
displayFont="Misc Fixed"
showLoginButton=false
passwordLeftMargin=15

View File

@@ -1,7 +1,8 @@
[General]
background=background.jpg
background_day=playlists/day.m3u
background_night=playlists/night.m3u
background_img_day=background.jpg
background_img_night=background.jpg
background_vid_day=playlists/day.m3u
background_vid_night=playlists/night.m3u
displayFont="Droid Sans Mono for Powerline"
showLoginButton=true
passwordLeftMargin=15

View File

@@ -1,6 +1,6 @@
[General]
background_day=playlists/day.m3u
background_night=playlists/night.m3u
background_vid_day=playlists/day.m3u
background_vid_night=playlists/night.m3u
displayFont="Misc Fixed"
passwordLeftMargin=15
relativePositionX=0.5