Skip to content

Commit

Permalink
Added sddm graphics folder for the sddm theme (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pranav Kulshrestha authored and tabesin committed Dec 28, 2018
1 parent b5ef740 commit fee6f51
Show file tree
Hide file tree
Showing 11 changed files with 767 additions and 0 deletions.
245 changes: 245 additions & 0 deletions meilix-artwork/usr/share/sddm/themes/meilix/Main.qml
@@ -0,0 +1,245 @@
/***************************************************************************
* Copyright (c) 2013 Abdurrahman AVCI <abdurrahmanavci@gmail.com
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
* OR OTHER DEALINGS IN THE SOFTWARE.
*
***************************************************************************/

import QtQuick 2.0
import SddmComponents 2.0

Rectangle {
id: container
width: 1024
height: 768

property int sessionIndex: session.index

TextConstants { id: textConstants }

Connections {
target: sddm
onLoginSucceeded: {
}

onLoginFailed: {
txtMessage.text = textConstants.loginFailed
listView.currentItem.password.text = ""
}
}

Repeater {
model: screenModel
Background {
x: geometry.x; y: geometry.y; width: geometry.width; height:geometry.height
source: config.background
fillMode: Image.PreserveAspectCrop
onStatusChanged: {
if (status == Image.Error && source != config.defaultBackground) {
source = config.defaultBackground
}
}
}
}

Rectangle {
property variant geometry: screenModel.geometry(screenModel.primary)
x: geometry.x; y: geometry.y; width: geometry.width; height: geometry.height
color: "transparent"

Component {
id: userDelegate

PictureBox {
anchors.verticalCenter: parent.verticalCenter
name: (model.realName === "") ? model.name : model.realName
icon: model.icon

focus: (listView.currentIndex === index) ? true : false
state: (listView.currentIndex === index) ? "active" : ""

onLogin: sddm.login(model.name, password, sessionIndex);

MouseArea {
anchors.fill: parent
hoverEnabled: true
onEntered: listView.currentIndex = index
onClicked: listView.focus = true
}
}
}

Row {
anchors.fill: parent

Text {
id: txtMessage
anchors.top: usersContainer.bottom;
anchors.margins: 20
anchors.horizontalCenter: parent.horizontalCenter
color: "white"
text: textConstants.promptSelectUser
font.pixelSize: 16
font.family: "Ubuntu"
}

Item {
id: usersContainer
width: parent.width; height: 300
anchors.verticalCenter: parent.verticalCenter

ImageButton {
id: prevUser
anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
anchors.margins: 10
source: "angle-left.png"
onClicked: listView.decrementCurrentIndex()

KeyNavigation.backtab: btnShutdown; KeyNavigation.tab: listView
}



ListView {
id: listView
height: parent.height
anchors.left: prevUser.right; anchors.right: nextUser.left
anchors.verticalCenter: parent.verticalCenter
anchors.margins: 10

clip: true
focus: true

spacing: 5

model: userModel
delegate: userDelegate
orientation: ListView.Horizontal
currentIndex: userModel.lastIndex

KeyNavigation.backtab: prevUser; KeyNavigation.tab: nextUser
}

ImageButton {
id: nextUser
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
anchors.margins: 10
source: "angle-right.png"
onClicked: listView.incrementCurrentIndex()
KeyNavigation.backtab: listView; KeyNavigation.tab: session
}
}

}
}

Rectangle {
id: actionBar
anchors.top: parent.top;
anchors.horizontalCenter: parent.horizontalCenter
width: parent.width; height: 64
color: "#44ffffff"

Row {
anchors.left: parent.left
anchors.margins: 5
height: parent.height
spacing: 5

Text {
height: parent.height
anchors.verticalCenter: parent.verticalCenter
text: textConstants.session
font.pixelSize: 14
color: "white"
verticalAlignment: Text.AlignVCenter
}

ComboBox {
id: session
width: 245
anchors.verticalCenter: parent.verticalCenter
arrowIcon: "angle-down.png"
model: sessionModel
index: sessionModel.lastIndex
font.pixelSize: 14
color: "#44ffffff"
KeyNavigation.backtab: nextUser; KeyNavigation.tab: layoutBox
}

Text {
height: parent.height
anchors.verticalCenter: parent.verticalCenter
text: textConstants.layout
font.pixelSize: 14
color: "white"
verticalAlignment: Text.AlignVCenter
}

LayoutBox {
id: layoutBox
width: 90
anchors.verticalCenter: parent.verticalCenter
font.pixelSize: 14
arrowIcon: "angle-down.png"
KeyNavigation.backtab: session; KeyNavigation.tab: btnShutdown
}
}

Row {
height: parent.height
anchors.right: parent.right
anchors.margins: 5
spacing: 5

Clock {
id: clock
color: "white"
timeFont.family: "Ubuntu"
timeFont.bold: true
timeFont.pixelSize: 28
dateFont.pixelSize: 12
}

ImageButton {
id: btnReboot
height: parent.height
source: "reboot.png"
visible: sddm.canReboot
onClicked: sddm.reboot()
KeyNavigation.backtab: layoutBox; KeyNavigation.tab: btnShutdown
}

ImageButton {
id: btnShutdown
height: parent.height
source: "shutdown.png"
visible: sddm.canPowerOff
onClicked: sddm.powerOff()
KeyNavigation.backtab: btnReboot; KeyNavigation.tab: prevUser
}

}


}
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions meilix-artwork/usr/share/sddm/themes/meilix/metadata.desktop
@@ -0,0 +1,15 @@
[SddmGreeterTheme]
Name=meilix
Description=Meilix Theme
Author=Meilix Artwork Team
Copyright=(c) 2018, Meilix Artwork Theme
License=CC-BY-SA
Type=sddm-theme
Version=0.1
Website=https://github.com/sddm/sddm
Screenshot=background.jpg
MainScript=Main.qml
ConfigFile=theme.conf
TranslationsDirectory=translations
Theme-Id=meilix
Theme-API=2.0
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions meilix-artwork/usr/share/sddm/themes/meilix/theme.conf
@@ -0,0 +1,2 @@
[General]
background=wall.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit fee6f51

Please sign in to comment.