Merge branch 'yehuohan-videos'

This commit is contained in:
eximus
2017-08-06 12:48:43 +01:00
5 changed files with 64 additions and 19 deletions

3
.gitignore vendored
View File

@@ -1 +1,4 @@
Main.qmlc
/playlist_videos/*
!/playlist_videos/*.md

View File

@@ -150,16 +150,6 @@ Rectangle {
KeyNavigation.backtab: password_input_box; KeyNavigation.tab: password_input_box
}
Text {
id: error_message
height: parent.height
font.family: textFont.name
font.pixelSize: 12
color: "white"
anchors.left: username_input_box.left
anchors.leftMargin: 0
}
}
Rectangle {
@@ -199,6 +189,14 @@ Rectangle {
tooltipBG: "#25000000"
tooltipFG: "#dc322f"
image: "warning_red.png"
onTextChanged: {
if (password_input_box.text == "") {
clear_passwd_button.visible = false
}
if (password_input_box.text != "" && config.showClearPasswordButton != "false") {
clear_passwd_button.visible = true
}
}
Keys.onPressed: {
if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) {
@@ -210,17 +208,40 @@ Rectangle {
KeyNavigation.backtab: username_input_box; KeyNavigation.tab: login_button
}
Button {
id: clear_passwd_button
height: parent.height
width: parent.height
color: "transparent"
text: "x"
font: textFont.name
border.color: "transparent"
border.width: 0
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.leftMargin: 0
anchors.rightMargin: parent.height
disabledColor: "#dc322f"
activeColor: "#393939"
pressedColor: "#2aa198"
onClicked: {
password_input_box.text=''
password_input_box.focus = true
}
}
Button {
id: login_button
height: parent.height
color: "#393939"
text: ">"
anchors.verticalCenter: parent.verticalCenter
border.color: "#00000000"
anchors.right: parent.right
anchors.rightMargin: 0
anchors.verticalCenter: parent.verticalCenter
anchors.left: password_input_box.right
anchors.leftMargin: 0
anchors.right: parent.right
disabledColor: "#dc322f"
activeColor: "#268bd2"
pressedColor: "#2aa198"
@@ -231,10 +252,20 @@ Rectangle {
KeyNavigation.backtab: password_input_box; KeyNavigation.tab: reboot_button
}
Text {
id: error_message
height: parent.height
font.family: textFont.name
font.pixelSize: 12
color: "white"
anchors.top: password_input_box.bottom
anchors.left: password_input_box.left
anchors.leftMargin: 0
}
}
}
}
// Top Bar
@@ -260,7 +291,7 @@ Rectangle {
anchors.verticalCenter: parent.verticalCenter
color: "transparent"
arrowColor: "transparent"
textColor: "white"
textColor: "#505050"
borderColor: "transparent"
hoverColor: "#5692c4"
@@ -305,7 +336,8 @@ Rectangle {
text: modelItem ? modelItem.modelData.shortName : "zz"
font.family: textFont.name
font.pixelSize: 14
color: "white"
//color: "white"
color: "#505050"
}
}
KeyNavigation.backtab: session; KeyNavigation.tab: username_input_box
@@ -361,7 +393,9 @@ Rectangle {
if (config.showLoginButton == "false") {
login_button.visible = false
password_input_box.anchors.rightMargin = 0
clear_passwd_button.anchors.rightMargin = 0
}
clear_passwd_button.visible = false
}
}

View File

@@ -28,6 +28,10 @@ The theme can be tested by running `sddm-greeter --theme <path-to-this-repositor
This theme streams the HD videos so a good internet connection is necessary.
If there is no active connection or the video can't be played the background will fallback to the image background.jpg
If you wish to play local videos files just use the following command to generate the playlist-file (playlist_day.m3u or playlist_night.m3u) from a directory containing the videos:
`find <path-to-your-directory> -maxdepth 1 -type f > <playlist-file>`
### Changing settings in `theme.conf.user`
You can change a few settings in this file
@@ -35,6 +39,7 @@ You can change a few settings in this file
- `background_day` and `background_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
- `passwordLeftMargin` and `usernameLeftMargin` - set margin between input boxes and labels, some fonts are messy and allows fixing of overlap
- `relativePositionX` and `relativePositionY` - position the login text box and clock

View File

@@ -1,3 +1,5 @@
#!/bin/bash
curl 'http://a1.phobos.apple.com/us/r1000/000/Features/atv/AutumnResources/videos/entries.json' 2>/dev/null | python2 -c '
import sys, json;
day=open("playlist_day.m3u", "w")

View File

@@ -2,8 +2,9 @@
background=background.jpg
background_day=playlist_day.m3u
background_night=playlist_night.m3u
displayFont="Droid Sans Mono for Powerline"
displayFont="DejaVu Sans"
showLoginButton=true
passwordLeftMargin=15
usernameLeftMargin=15
relativePositionX=0.3
relativePositionY=0.7