chore: initial commit

This commit is contained in:
Alexandre Cavalheiro S. Tiago Da Silva 2021-04-05 10:48:05 -03:00
commit 67c7ccd66b
No known key found for this signature in database
GPG key ID: 03C18A5682B3E189
11102 changed files with 455009 additions and 0 deletions

View file

@ -0,0 +1,26 @@
import QtQuick 2.2
import org.kde.plasma.core 2.0 as PlasmaCore
import QtQuick.Controls.Styles 1.4 as QQCS
import QtQuick.Controls 1.3 as QQC
QQCS.MenuStyle {
frame: Rectangle {
color: "#21232D"
border.color: "#232831"
border.width: 1
}
itemDelegate.label: QQC.Label {
height: contentHeight * 2
verticalAlignment: Text.AlignVCenter
color: config.highlight_color
font.pointSize: config.fontSize
font.family: config.font
text: styleData.text
}
itemDelegate.background: Rectangle {
visible: styleData.selected
color: config.selected_color
}
}

View file

@ -0,0 +1,38 @@
import QtQuick 2.2
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import QtQuick.Controls 1.3 as QQC
PlasmaComponents.ToolButton {
id: keyboardButton
property int currentIndex: -1
text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Keyboard Layout: %1", instantiator.objectAt(currentIndex).shortName)
implicitWidth: minimumWidth
font.pointSize: config.fontSize
visible: menu.items.length > 1
Component.onCompleted: currentIndex = Qt.binding(function() {return keyboard.currentLayout});
menu: QQC.Menu {
id: keyboardMenu
style: DropdownMenuStyle {}
Instantiator {
id: instantiator
model: keyboard.layouts
onObjectAdded: keyboardMenu.insertItem(index, object)
onObjectRemoved: keyboardMenu.removeItem( object )
delegate: QQC.MenuItem {
text: modelData.longName
property string shortName: modelData.shortName
onTriggered: {
keyboard.currentLayout = model.index
}
}
}
}
}

View file

@ -0,0 +1,134 @@
import "components"
import QtQuick 2.2
import QtQuick.Layouts 1.2
import QtQuick.Controls 2.4
import QtQuick.Controls.Styles 1.4
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
SessionManagementScreen {
id: root
property Item mainPasswordBox: passwordBox
property bool showUsernamePrompt: !showUserList
property string lastUserName
property bool loginScreenUiVisible: false
//the y position that should be ensured visible when the on screen keyboard is visible
property int visibleBoundary: mapFromItem(loginButton, 0, 0).y
onHeightChanged: visibleBoundary = mapFromItem(loginButton, 0, 0).y + loginButton.height + units.smallSpacing
signal loginRequest(string username, string password)
onShowUsernamePromptChanged: {
if (!showUsernamePrompt) {
lastUserName = ""
}
}
/*
* Login has been requested with the following username and password
* If username field is visible, it will be taken from that, otherwise from the "name" property of the currentIndex
*/
function startLogin() {
var username = showUsernamePrompt ? userNameInput.text : userList.selectedUser
var password = passwordBox.text
//this is partly because it looks nicer
//but more importantly it works round a Qt bug that can trigger if the app is closed with a TextField focused
//DAVE REPORT THE FRICKING THING AND PUT A LINK
loginButton.forceActiveFocus();
loginRequest(username, password);
}
Input {
id: userNameInput
Layout.fillWidth: true
text: lastUserName
visible: showUsernamePrompt
focus: showUsernamePrompt && !lastUserName //if there's a username prompt it gets focus first, otherwise password does
placeholderText: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Username")
onAccepted:
if (root.loginScreenUiVisible) {
passwordBox.forceActiveFocus()
}
}
Input {
id: passwordBox
placeholderText: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Password")
focus: !showUsernamePrompt || lastUserName
echoMode: TextInput.Password
Layout.fillWidth: true
onAccepted: {
if (root.loginScreenUiVisible) {
startLogin();
}
}
Keys.onEscapePressed: {
mainStack.currentItem.forceActiveFocus();
}
//if empty and left or right is pressed change selection in user switch
//this cannot be in keys.onLeftPressed as then it doesn't reach the password box
Keys.onPressed: {
if (event.key == Qt.Key_Left && !text) {
userList.decrementCurrentIndex();
event.accepted = true
}
if (event.key == Qt.Key_Right && !text) {
userList.incrementCurrentIndex();
event.accepted = true
}
}
Connections {
target: sddm
onLoginFailed: {
passwordBox.selectAll()
passwordBox.forceActiveFocus()
}
}
}
Button {
id: loginButton
text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Log In")
enabled: passwordBox.text != ""
Layout.topMargin: 10
Layout.bottomMargin: 10
Layout.fillWidth: true
font.pointSize: config.fontSize
font.family: config.font
contentItem: Text {
text: loginButton.text
font: loginButton.font
opacity: enabled ? 1.0 : 0.3
color: config.highlight_color
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight
}
background: Rectangle {
id: buttonBackground
width: parent.width
height: 30
radius: width / 2
color: "#9B79CC"
opacity: enabled ? 1.0 : 0.3
}
onClicked: startLogin();
}
}

View file

@ -0,0 +1,473 @@
/*
* Copyright 2016 David Edmundson <davidedmundson@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2 or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import QtQuick 2.8
import QtQuick.Layouts 1.1
import QtQuick.Controls 1.1
import QtGraphicalEffects 1.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.extras 2.0 as PlasmaExtras
import "components"
PlasmaCore.ColorScope {
id: root
readonly property bool softwareRendering: GraphicsInfo.api === GraphicsInfo.Software
colorGroup: PlasmaCore.Theme.ComplementaryColorGroup
width: 1600
height: 900
property string notificationMessage
LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft
LayoutMirroring.childrenInherit: true
PlasmaCore.DataSource {
id: keystateSource
engine: "keystate"
connectedSources: "Caps Lock"
}
Image {
id: wallpaper
height: parent.height
width: parent.width
source: config.background || config.Background
asynchronous: true
cache: true
clip: true
}
MouseArea {
id: loginScreenRoot
anchors.fill: parent
property bool uiVisible: true
property bool blockUI: mainStack.depth > 1 || userListComponent.mainPasswordBox.text.length > 0 || inputPanel.keyboardActive || config.type != "image"
hoverEnabled: true
drag.filterChildren: true
onPressed: uiVisible = true;
onPositionChanged: uiVisible = true;
onUiVisibleChanged: {
if (blockUI) {
fadeoutTimer.running = false;
} else if (uiVisible) {
fadeoutTimer.restart();
}
}
onBlockUIChanged: {
if (blockUI) {
fadeoutTimer.running = false;
uiVisible = true;
} else {
fadeoutTimer.restart();
}
}
Keys.onPressed: {
uiVisible = true;
event.accepted = false;
}
//takes one full minute for the ui to disappear
Timer {
id: fadeoutTimer
running: true
interval: 60000
onTriggered: {
if (!loginScreenRoot.blockUI) {
loginScreenRoot.uiVisible = false;
}
}
}
StackView {
id: mainStack
anchors.centerIn: parent
height: root.height / 2
width: parent.width / 3
focus: true //StackView is an implicit focus scope, so we need to give this focus so the item inside will have it
Timer {
//SDDM has a bug in 0.13 where even though we set the focus on the right item within the window, the window doesn't have focus
//it is fixed in 6d5b36b28907b16280ff78995fef764bb0c573db which will be 0.14
//we need to call "window->activate()" *After* it's been shown. We can't control that in QML so we use a shoddy timer
//it's been this way for all Plasma 5.x without a huge problem
running: true
repeat: false
interval: 200
onTriggered: mainStack.forceActiveFocus()
}
initialItem: Login {
id: userListComponent
userListModel: userModel
loginScreenUiVisible: loginScreenRoot.uiVisible
userListCurrentIndex: userModel.lastIndex >= 0 ? userModel.lastIndex : 0
lastUserName: userModel.lastUser
showUserList: {
if ( !userListModel.hasOwnProperty("count")
|| !userListModel.hasOwnProperty("disableAvatarsThreshold"))
return (userList.y + mainStack.y) > 0
if ( userListModel.count == 0 ) return false
return userListModel.count <= userListModel.disableAvatarsThreshold && (userList.y + mainStack.y) > 0
}
notificationMessage: {
var text = ""
if (keystateSource.data["Caps Lock"]["Locked"]) {
text += i18nd("plasma_lookandfeel_org.kde.lookandfeel","Caps Lock is on")
if (root.notificationMessage) {
text += " • "
}
}
text += root.notificationMessage
return text
}
actionItems: [
ActionButton {
iconSource: Qt.resolvedUrl("assets/suspend.svg")
text: i18ndc("plasma_lookandfeel_org.kde.lookandfeel","Suspend to RAM","Sleep")
onClicked: sddm.suspend()
enabled: sddm.canSuspend
visible: !inputPanel.keyboardActive
},
ActionButton {
iconSource: Qt.resolvedUrl("assets/restart.svg")
text: i18nd("plasma_lookandfeel_org.kde.lookandfeel","Restart")
onClicked: sddm.reboot()
enabled: sddm.canReboot
visible: !inputPanel.keyboardActive
},
ActionButton {
iconSource: Qt.resolvedUrl("assets/shutdown.svg")
text: i18nd("plasma_lookandfeel_org.kde.lookandfeel","Shut Down")
onClicked: sddm.powerOff()
enabled: sddm.canPowerOff
visible: !inputPanel.keyboardActive
},
ActionButton {
iconSource: Qt.resolvedUrl("assets/change_user.svg")
text: i18nd("plasma_lookandfeel_org.kde.lookandfeel","Different User")
onClicked: mainStack.push(userPromptComponent)
enabled: true
visible: !userListComponent.showUsernamePrompt && !inputPanel.keyboardActive
}]
onLoginRequest: {
root.notificationMessage = ""
sddm.login(username, password, sessionButton.currentIndex)
}
}
Behavior on opacity {
OpacityAnimator {
duration: units.longDuration
}
}
}
Loader {
id: inputPanel
state: "hidden"
property bool keyboardActive: item ? item.active : false
onKeyboardActiveChanged: {
if (keyboardActive) {
state = "visible"
} else {
state = "hidden";
}
}
source: "components/VirtualKeyboard.qml"
anchors {
left: parent.left
right: parent.right
}
function showHide() {
state = state == "hidden" ? "visible" : "hidden";
}
states: [
State {
name: "visible"
PropertyChanges {
target: mainStack
y: Math.min(0, root.height - inputPanel.height - userListComponent.visibleBoundary)
}
PropertyChanges {
target: inputPanel
y: root.height - inputPanel.height
opacity: 1
}
},
State {
name: "hidden"
PropertyChanges {
target: mainStack
y: 0
}
PropertyChanges {
target: inputPanel
y: root.height - root.height/4
opacity: 0
}
}
]
transitions: [
Transition {
from: "hidden"
to: "visible"
SequentialAnimation {
ScriptAction {
script: {
inputPanel.item.activated = true;
Qt.inputMethod.show();
}
}
ParallelAnimation {
NumberAnimation {
target: mainStack
property: "y"
duration: units.longDuration
easing.type: Easing.InOutQuad
}
NumberAnimation {
target: inputPanel
property: "y"
duration: units.longDuration
easing.type: Easing.OutQuad
}
OpacityAnimator {
target: inputPanel
duration: units.longDuration
easing.type: Easing.OutQuad
}
}
}
},
Transition {
from: "visible"
to: "hidden"
SequentialAnimation {
ParallelAnimation {
NumberAnimation {
target: mainStack
property: "y"
duration: units.longDuration
easing.type: Easing.InOutQuad
}
NumberAnimation {
target: inputPanel
property: "y"
duration: units.longDuration
easing.type: Easing.InQuad
}
OpacityAnimator {
target: inputPanel
duration: units.longDuration
easing.type: Easing.InQuad
}
}
ScriptAction {
script: {
Qt.inputMethod.hide();
}
}
}
}
]
}
Component {
id: userPromptComponent
Login {
showUsernamePrompt: true
notificationMessage: root.notificationMessage
loginScreenUiVisible: loginScreenRoot.uiVisible
// using a model rather than a QObject list to avoid QTBUG-75900
userListModel: ListModel {
ListElement {
name: ""
iconSource: ""
}
Component.onCompleted: {
// as we can't bind inside ListElement
setProperty(0, "name", i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Type in Username and Password"));
}
}
onLoginRequest: {
root.notificationMessage = ""
sddm.login(username, password, sessionButton.currentIndex)
}
actionItems: [
ActionButton {
iconSource: "system-suspend"
text: i18ndc("plasma_lookandfeel_org.kde.lookandfeel","Suspend to RAM","Sleep")
onClicked: sddm.suspend()
enabled: sddm.canSuspend
visible: !inputPanel.keyboardActive
},
ActionButton {
iconSource: "system-reboot"
text: i18nd("plasma_lookandfeel_org.kde.lookandfeel","Restart")
onClicked: sddm.reboot()
enabled: sddm.canReboot
visible: !inputPanel.keyboardActive
},
ActionButton {
iconSource: "system-shutdown"
text: i18nd("plasma_lookandfeel_org.kde.lookandfeel","Shut Down")
onClicked: sddm.powerOff()
enabled: sddm.canPowerOff
visible: !inputPanel.keyboardActive
},
ActionButton {
iconSource: "go-previous"
text: i18nd("plasma_lookandfeel_org.kde.lookandfeel","List Users")
onClicked: mainStack.pop()
visible: !inputPanel.keyboardActive
}
]
}
}
Rectangle {
id: formBg
width: mainStack.width
height: mainStack.height
x: root.width / 2 - width / 2
y: root.height / 2 - height / 3
radius: 7
color: "#21232D"
opacity: 0.5
z:-1
}
Rectangle {
id: footerBg
width: parent.width
height: footer.height + 10
anchors.left: parent.left
anchors.top: parent.top
radius: 7
color: "#21232D"
opacity: 0.4
z:-1
}
//Footer
RowLayout {
id: footer
anchors {
top: parent.top
left: parent.left
margins: units.smallSpacing
}
Behavior on opacity {
OpacityAnimator {
duration: units.longDuration
}
}
PlasmaComponents.ToolButton {
text: i18ndc("plasma_lookandfeel_org.kde.lookandfeel", "Button to show/hide virtual keyboard", "Virtual Keyboard")
iconName: inputPanel.keyboardActive ? "input-keyboard-virtual-on" : "input-keyboard-virtual-off"
onClicked: inputPanel.showHide()
visible: true
}
KeyboardButton {
}
SessionButton {
id: sessionButton
}
}
RowLayout {
id: footerRight
spacing: 10
anchors {
top: parent.top
right: parent.right
margins: 10
}
Behavior on opacity {
OpacityAnimator {
duration: units.longDuration
}
}
Battery {}
Clock {
id: clock
visible: true
}
}
}
Connections {
target: sddm
onLoginFailed: {
notificationMessage = i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Login Failed")
}
onLoginSucceeded: {
//note SDDM will kill the greeter at some random point after this
//there is no certainty any transition will finish, it depends on the time it
//takes to complete the init
mainStack.opacity = 0
footer.opacity = 0
footerRight.opacity = 0
}
}
onNotificationMessageChanged: {
if (notificationMessage) {
notificationResetTimer.start();
}
}
Timer {
id: notificationResetTimer
interval: 3000
onTriggered: notificationMessage = ""
}
}

View file

@ -0,0 +1,59 @@
/*
* Copyright 2016 David Edmundson <davidedmundson@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2 or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import QtQuick 2.2
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import QtQuick.Controls 1.3 as QQC
PlasmaComponents.ToolButton {
id: root
property int currentIndex: -1
implicitWidth: minimumWidth
visible: menu.items.length > 1
text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Desktop Session: %1", instantiator.objectAt(currentIndex).text || "")
font.pointSize: config.fontSize
Component.onCompleted: {
currentIndex = sessionModel.lastIndex
}
menu: QQC.Menu {
id: menu
style: DropdownMenuStyle {}
Instantiator {
id: instantiator
model: sessionModel
onObjectAdded: menu.insertItem(index, object)
onObjectRemoved: menu.removeItem( object )
delegate: QQC.MenuItem {
text: model.name
onTriggered: {
root.currentIndex = model.index
}
}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

View file

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
inkscape:version="1.0beta2 (unknown)"
sodipodi:docname="change_user.svg"
id="svg8"
version="1.1"
height="43pt"
width="43pt"
viewBox="0 0 43 43"
style="isolation:isolate">
<metadata
id="metadata14">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs12">
<linearGradient
inkscape:collect="always"
id="linearGradient863">
<stop
style="stop-color:#cfb0fa;stop-opacity:1"
offset="0"
id="stop859" />
<stop
style="stop-color:#cfb0fa;stop-opacity:1"
offset="1"
id="stop861" />
</linearGradient>
<linearGradient
gradientUnits="userSpaceOnUse"
y2="11.457"
x2="20.718"
y1="11.457"
x1="1.47"
id="linearGradient855"
xlink:href="#linearGradient863"
inkscape:collect="always" />
<linearGradient
gradientUnits="userSpaceOnUse"
y2="26.125"
x2="41.53"
y1="26.125"
x1="16.863"
id="linearGradient857"
xlink:href="#linearGradient863"
inkscape:collect="always" />
</defs>
<sodipodi:namedview
inkscape:current-layer="g6"
inkscape:window-maximized="1"
inkscape:window-y="27"
inkscape:window-x="0"
inkscape:cy="28.666667"
inkscape:cx="28.666667"
inkscape:zoom="9.2622294"
showgrid="false"
id="namedview10"
inkscape:window-height="711"
inkscape:window-width="1366"
inkscape:pageshadow="2"
inkscape:pageopacity="0"
guidetolerance="10"
gridtolerance="10"
objecttolerance="10"
borderopacity="1"
inkscape:document-rotation="0"
bordercolor="#666666"
pagecolor="#ffffff" />
<g
id="g6">
<path
style="fill:url(#linearGradient857);fill-opacity:1"
id="path2"
fill="#cfb0fa"
fill-rule="evenodd"
d=" M 16.863 38.458 L 39.988 38.458 C 39.988 38.458 39.988 33.833 39.988 33.833 C 39.988 30.429 37.226 27.667 33.822 27.667 L 24.572 27.667 C 21.168 27.667 18.405 30.429 18.405 33.833 L 18.405 38.458 C 18.405 38.458 16.863 38.458 16.863 38.458 L 16.863 33.833 C 16.863 29.578 20.317 26.125 24.572 26.125 L 33.822 26.125 C 38.077 26.125 41.53 29.578 41.53 33.833 L 41.53 40 L 16.863 40 L 16.863 38.458 Z M 29.197 12.25 C 32.601 12.25 35.363 15.013 35.363 18.417 C 35.363 21.821 32.601 24.583 29.197 24.583 C 25.793 24.583 23.03 21.821 23.03 18.417 C 23.03 15.013 25.793 12.25 29.197 12.25 Z M 29.197 13.792 C 31.75 13.792 33.822 15.864 33.822 18.417 C 33.822 20.97 31.75 23.042 29.197 23.042 C 26.644 23.042 24.572 20.97 24.572 18.417 C 24.572 15.864 26.644 13.792 29.197 13.792 Z " />
<path
style="fill:url(#linearGradient855);fill-opacity:1.0"
id="path4"
fill="#cfb0fa"
fill-rule="evenodd"
d=" M 17.767 10.685 L 12.262 5.18 L 12.262 3 L 20.718 11.456 L 12.262 19.914 L 12.262 17.732 L 17.767 12.227 L 1.47 12.227 L 1.47 10.685 L 17.767 10.685 Z " />
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.5 KiB

View file

@ -0,0 +1,117 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
inkscape:version="1.0beta2 (unknown)"
sodipodi:docname="restart.svg"
id="svg16"
version="1.1"
height="34pt"
width="34pt"
viewBox="0 0 34 34"
style="isolation:isolate">
<metadata
id="metadata22">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs20">
<linearGradient
gradientUnits="userSpaceOnUse"
y2="16.999878"
x2="33.5"
y1="16.999878"
x1="0.5"
id="linearGradient859"
xlink:href="#_lgradient_2"
inkscape:collect="always" />
</defs>
<sodipodi:namedview
inkscape:document-rotation="0"
inkscape:current-layer="svg16"
inkscape:window-maximized="1"
inkscape:window-y="27"
inkscape:window-x="0"
inkscape:cy="37.426594"
inkscape:cx="-29.484961"
inkscape:zoom="3.1982586"
showgrid="false"
id="namedview18"
inkscape:window-height="711"
inkscape:window-width="1366"
inkscape:pageshadow="2"
inkscape:pageopacity="0"
guidetolerance="10"
gridtolerance="10"
objecttolerance="10"
borderopacity="1"
bordercolor="#666666"
pagecolor="#ffffff" />
<linearGradient
y2="0.5"
x2="1"
y1="0.5"
x1="0"
id="_lgradient_2">
<stop
id="stop2"
style="stop-color:#ffb86c;stop-opacity:1"
stop-opacity="1"
offset="0%" />
<stop
id="stop4"
style="stop-color:#ffb86c;stop-opacity:1"
stop-opacity="1"
offset="100%" />
</linearGradient>
<path
style="stroke:#ffb86c;stroke-opacity:1"
id="path7"
stroke-miterlimit="3"
stroke-linecap="square"
stroke-linejoin="miter"
stroke="url(#_lgradient_2)"
stroke-width="2"
vector-effect="non-scaling-stroke"
fill="none"
d=" M 9.109 17 C 9.109 12.766 12.645 9.328 17 9.328 C 21.355 9.328 24.891 12.766 24.891 17 C 24.891 21.234 21.355 24.672 17 24.672 C 12.645 24.672 9.109 21.234 9.109 17 Z " />
<linearGradient
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(33,0,0,33,0.5,0.5)"
y2="0.5"
x2="1"
y1="0.5"
x1="0"
id="_lgradient_3">
<stop
id="stop9"
style="stop-color:#ffb86c;stop-opacity:1"
stop-opacity="1"
offset="0%" />
<stop
id="stop11"
style="stop-color:#ffb86c;stop-opacity:1"
stop-opacity="1"
offset="100%" />
</linearGradient>
<path
style="fill:url(#linearGradient859);fill-opacity:1.0;opacity:1"
id="path14"
fill="url(#_lgradient_3)"
fill-rule="evenodd"
d=" M 9.879 4.549 L 9.879 4.549 C 12.066 3.408 14.513 2.812 17 2.812 C 19.647 2.812 22.251 3.488 24.547 4.779 L 24.547 4.779 C 24.887 4.971 25.325 4.857 25.523 4.524 L 25.523 4.524 C 25.721 4.191 25.605 3.764 25.264 3.572 L 25.264 3.572 C 22.753 2.156 19.898 1.417 17 1.417 C 14.162 1.417 11.374 2.13 8.901 3.483 L 9.255 1.449 L 9.255 1.449 C 9.332 1.006 9.024 0.586 8.569 0.511 L 8.569 0.511 C 8.113 0.437 7.681 0.736 7.604 1.178 L 7.604 1.178 L 7.106 4.073 C 6.952 4.969 7.555 5.816 8.453 5.963 L 11.476 6.46 L 11.476 6.46 C 11.932 6.535 12.364 6.236 12.441 5.793 L 12.441 5.793 C 12.518 5.35 12.21 4.93 11.755 4.855 L 11.755 4.855 L 9.879 4.549 Z M 3.987 24.838 L 3.987 24.838 C 4.184 25.169 4.069 25.595 3.728 25.79 L 3.728 25.79 C 3.388 25.984 2.947 25.873 2.745 25.542 L 2.745 25.542 C 1.275 23.087 0.5 20.297 0.5 17.458 C 0.5 14.906 1.124 12.395 2.322 10.121 L 2.322 10.121 C 2.504 9.779 2.938 9.644 3.291 9.821 L 3.291 9.821 C 3.643 9.998 3.781 10.42 3.599 10.763 L 3.599 10.763 C 2.502 12.834 1.935 15.129 1.935 17.458 C 1.935 20.053 2.638 22.599 3.987 24.838 L 3.987 24.838 L 3.987 24.838 L 3.987 24.838 L 3.987 24.838 L 3.987 24.838 L 3.987 24.838 Z M 24.59 30.11 L 24.59 30.11 C 24.931 29.918 25.369 30.03 25.569 30.361 L 25.569 30.361 C 25.769 30.692 25.655 31.121 25.315 31.317 L 25.315 31.317 C 22.789 32.747 19.92 33.5 17 33.5 C 14.181 33.5 11.397 32.796 8.937 31.456 L 8.937 31.456 C 8.592 31.268 8.47 30.843 8.664 30.508 L 8.664 30.508 C 8.858 30.173 9.295 30.051 9.64 30.236 L 9.64 30.236 C 11.885 31.463 14.425 32.105 17 32.105 C 19.669 32.105 22.287 31.422 24.59 30.11 L 24.59 30.11 L 24.59 30.11 L 24.59 30.11 L 24.59 30.11 L 24.59 30.11 Z M 30.58 11.119 L 30.58 11.119 C 30.41 10.772 30.561 10.356 30.917 10.191 L 30.917 10.191 C 31.274 10.025 31.704 10.172 31.879 10.519 L 31.879 10.519 C 32.948 12.681 33.5 15.052 33.5 17.458 C 33.5 20.192 32.783 22.878 31.412 25.27 L 31.412 25.27 C 31.218 25.605 30.781 25.725 30.437 25.538 L 30.437 25.538 C 30.092 25.352 29.967 24.925 30.157 24.586 L 30.157 24.586 C 31.412 22.41 32.065 19.955 32.065 17.458 C 32.065 15.261 31.563 13.099 30.58 11.119 L 30.58 11.119 L 30.58 11.119 L 30.58 11.119 L 30.58 11.119 Z M 28.12 7.345 C 28.12 6.96 28.441 6.648 28.837 6.648 C 29.233 6.648 29.554 6.96 29.554 7.345 C 29.554 7.73 29.233 8.043 28.837 8.043 C 28.441 8.043 28.12 7.73 28.12 7.345 L 28.12 7.345 L 28.12 7.345 L 28.12 7.345 Z M 27.402 28.269 C 27.402 27.884 27.724 27.572 28.12 27.572 C 28.516 27.572 28.837 27.884 28.837 28.269 C 28.837 28.654 28.516 28.967 28.12 28.967 C 27.724 28.967 27.402 28.654 27.402 28.269 L 27.402 28.269 L 27.402 28.269 Z M 4.446 28.269 C 4.446 27.884 4.767 27.572 5.163 27.572 C 5.559 27.572 5.88 27.884 5.88 28.269 C 5.88 28.654 5.559 28.967 5.163 28.967 C 4.767 28.967 4.446 28.654 4.446 28.269 L 4.446 28.269 Z " />
</svg>

After

Width:  |  Height:  |  Size: 5.9 KiB

View file

@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
style="isolation:isolate"
viewBox="0 0 34 34"
width="34pt"
height="34pt"
version="1.1"
id="svg9"
sodipodi:docname="shutdown.svg"
inkscape:version="1.0beta2 (unknown)">
<metadata
id="metadata15">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs13">
<linearGradient
gradientUnits="userSpaceOnUse"
y2="17"
x2="33.5"
y1="17"
x1="0.5"
id="linearGradient847"
xlink:href="#_lgradient_1"
inkscape:collect="always" />
</defs>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1366"
inkscape:window-height="711"
id="namedview11"
showgrid="false"
inkscape:zoom="3.3218928"
inkscape:cx="-12.257183"
inkscape:cy="22.666667"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
inkscape:current-layer="svg9"
inkscape:document-rotation="0" />
<linearGradient
id="_lgradient_1"
x1="0"
y1="0.5"
x2="1"
y2="0.5"
gradientTransform="matrix(33,0,0,33,0.5,0.5)"
gradientUnits="userSpaceOnUse">
<stop
offset="0%"
stop-opacity="1"
style="stop-color:#ff5555;stop-opacity:1"
id="stop2" />
<stop
offset="100%"
stop-opacity="1"
style="stop-color:#ff5555;stop-opacity:1"
id="stop4" />
</linearGradient>
<path
d=" M 29.526 8.628 L 29.526 8.628 C 29.304 8.299 29.391 7.853 29.719 7.631 L 29.719 7.631 C 30.048 7.409 30.495 7.496 30.717 7.825 L 30.717 7.825 C 32.532 10.543 33.5 13.736 33.5 17 C 33.5 21.376 31.764 25.573 28.665 28.665 C 25.573 31.764 21.376 33.5 17 33.5 C 12.624 33.5 8.427 31.764 5.335 28.665 C 2.236 25.573 0.5 21.376 0.5 17 L 0.5 17 C 0.5 12.624 2.236 8.427 5.335 5.335 C 8.427 2.243 12.624 0.5 17 0.5 C 19.453 0.5 21.885 1.045 24.102 2.107 L 24.102 2.107 C 24.459 2.277 24.61 2.705 24.439 3.061 L 24.439 3.061 C 24.269 3.417 23.842 3.569 23.485 3.398 L 23.485 3.398 C 21.462 2.437 19.245 1.935 17 1.935 C 13.004 1.935 9.173 3.52 6.347 6.347 C 3.52 9.173 1.935 13.004 1.935 17 L 1.935 17 C 1.935 20.996 3.52 24.827 6.347 27.653 C 9.173 30.48 13.004 32.065 17 32.065 C 20.996 32.065 24.827 30.48 27.653 27.653 C 30.48 24.827 32.065 20.996 32.065 17 C 32.065 14.016 31.183 11.103 29.526 8.628 L 29.526 8.628 Z M 17.148 6.533 L 17.148 6.533 C 17.562 6.533 17.898 6.869 17.898 7.283 L 17.898 17.698 C 17.898 18.112 17.562 18.448 17.148 18.448 L 17.148 18.448 C 16.734 18.448 16.398 18.112 16.398 17.698 L 16.398 7.283 C 16.398 6.869 16.734 6.533 17.148 6.533 L 17.148 6.533 Z M 20.375 11.461 L 20.375 11.461 C 20.007 11.275 19.859 10.825 20.045 10.456 L 20.045 10.456 C 20.231 10.088 20.682 9.94 21.05 10.126 L 21.05 10.126 C 22.535 10.876 23.787 12.024 24.657 13.441 C 25.535 14.859 26 16.486 26 18.151 C 26 18.564 25.97 18.969 25.918 19.374 C 25.625 21.526 24.56 23.506 22.925 24.939 C 21.282 26.371 19.183 27.159 17.007 27.166 C 16.602 27.166 16.19 27.136 15.793 27.084 C 13.632 26.791 11.652 25.726 10.22 24.091 C 8.787 22.449 8 20.349 8 18.174 C 8 17.761 8.022 17.356 8.082 16.951 C 8.503 13.824 10.543 11.146 13.438 9.894 L 13.438 9.894 C 13.818 9.732 14.26 9.909 14.424 10.287 L 14.424 10.287 C 14.587 10.666 14.414 11.108 14.038 11.274 L 14.038 11.274 C 11.623 12.316 9.92 14.551 9.568 17.154 C 9.522 17.491 9.5 17.829 9.5 18.174 C 9.5 19.981 10.16 21.736 11.353 23.101 C 12.545 24.466 14.195 25.351 15.987 25.591 C 16.325 25.636 16.67 25.666 17.007 25.666 C 18.823 25.659 20.57 25.006 21.935 23.806 C 23.3 22.614 24.185 20.964 24.433 19.171 C 24.477 18.834 24.5 18.496 24.5 18.151 C 24.5 15.331 22.895 12.736 20.375 11.461 Z "
fill-rule="evenodd"
fill="url(#_lgradient_1)"
id="path7"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
style="fill:url(#linearGradient847);fill-opacity:1.0" />
</svg>

After

Width:  |  Height:  |  Size: 4.6 KiB

View file

@ -0,0 +1,89 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
style="isolation:isolate"
viewBox="0 0 34 34"
width="34pt"
height="34pt"
version="1.1"
id="svg9"
sodipodi:docname="suspend.svg"
inkscape:version="1.0beta2 (unknown)">
<metadata
id="metadata15">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs13">
<linearGradient
gradientUnits="userSpaceOnUse"
y2="17"
x2="33.5"
y1="17"
x1="0.5"
id="linearGradient839"
xlink:href="#_lgradient_0"
inkscape:collect="always" />
</defs>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1366"
inkscape:window-height="711"
id="namedview11"
showgrid="false"
inkscape:zoom="5.8150157"
inkscape:cx="4.960523"
inkscape:cy="22.666667"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
inkscape:current-layer="svg9"
inkscape:document-rotation="0" />
<linearGradient
id="_lgradient_0"
x1="0"
y1="0.5"
x2="1"
y2="0.5"
gradientTransform="matrix(33,0,0,33,0.5,0.5)"
gradientUnits="userSpaceOnUse">
<stop
offset="0%"
stop-opacity="1"
style="stop-color:#50fa7b;stop-opacity:1"
id="stop2" />
<stop
offset="97.82608695652173%"
stop-opacity="1"
style="stop-color:#50fa7b;stop-opacity:1"
id="stop4" />
</linearGradient>
<path
d=" M 29.526 8.628 L 29.526 8.628 C 29.304 8.299 29.391 7.853 29.719 7.631 L 29.719 7.631 C 30.048 7.409 30.495 7.496 30.717 7.825 L 30.717 7.825 C 32.532 10.543 33.5 13.736 33.5 17 C 33.5 21.376 31.764 25.573 28.665 28.665 C 25.573 31.764 21.376 33.5 17 33.5 C 12.624 33.5 8.427 31.764 5.335 28.665 C 2.236 25.573 0.5 21.376 0.5 17 L 0.5 17 C 0.5 12.624 2.236 8.427 5.335 5.335 C 8.427 2.243 12.624 0.5 17 0.5 C 19.453 0.5 21.885 1.045 24.102 2.107 L 24.102 2.107 C 24.459 2.277 24.61 2.705 24.439 3.061 L 24.439 3.061 C 24.269 3.417 23.842 3.569 23.485 3.398 L 23.485 3.398 C 21.462 2.437 19.245 1.935 17 1.935 C 13.004 1.935 9.173 3.52 6.347 6.347 C 3.52 9.173 1.935 13.004 1.935 17 L 1.935 17 C 1.935 20.996 3.52 24.827 6.347 27.653 C 9.173 30.48 13.004 32.065 17 32.065 C 20.996 32.065 24.827 30.48 27.653 27.653 C 30.48 24.827 32.065 20.996 32.065 17 C 32.065 14.016 31.183 11.103 29.526 8.628 L 29.526 8.628 L 29.526 8.628 L 29.526 8.628 Z M 19.212 24.95 L 19.212 24.95 C 19.61 24.838 20.022 25.072 20.131 25.471 L 20.131 25.471 C 20.241 25.871 20.007 26.286 19.61 26.397 L 19.61 26.397 C 18.763 26.63 17.885 26.75 17 26.75 C 14.413 26.75 11.93 25.723 10.107 23.892 C 8.278 22.07 7.25 19.588 7.25 17 C 7.25 15.065 7.827 13.167 8.907 11.555 L 8.907 11.555 C 9.139 11.211 9.606 11.121 9.95 11.353 L 9.95 11.353 C 10.294 11.584 10.384 12.051 10.153 12.395 L 10.153 12.395 C 9.238 13.76 8.75 15.357 8.75 17 C 8.75 19.19 9.62 21.29 11.165 22.835 C 12.71 24.38 14.81 25.25 17 25.25 C 17.75 25.25 18.493 25.152 19.212 24.95 L 19.212 24.95 L 19.212 24.95 L 19.212 24.95 Z M 15.553 8.878 L 15.553 8.878 C 15.143 8.948 14.753 8.674 14.682 8.266 L 14.682 8.266 C 14.612 7.859 14.884 7.47 15.29 7.4 L 15.29 7.4 C 15.853 7.302 16.43 7.25 17 7.25 C 19.587 7.25 22.07 8.278 23.893 10.107 C 25.723 11.93 26.75 14.412 26.75 17 C 26.75 18.965 26.158 20.885 25.04 22.512 L 25.04 22.512 C 24.808 22.852 24.343 22.938 24.001 22.704 L 24.001 22.704 C 23.66 22.47 23.574 22.001 23.81 21.657 L 23.81 21.657 C 24.748 20.292 25.25 18.665 25.25 17 C 25.25 14.81 24.38 12.71 22.835 11.165 C 21.29 9.62 19.19 8.75 17 8.75 C 16.513 8.75 16.033 8.795 15.553 8.878 L 15.553 8.878 L 15.553 8.878 Z M 15.421 13.25 L 15.421 13.25 C 15.835 13.25 16.171 13.586 16.171 14 L 16.171 20 C 16.171 20.414 15.835 20.75 15.421 20.75 L 15.421 20.75 C 15.007 20.75 14.671 20.414 14.671 20 L 14.671 14 C 14.671 13.586 15.007 13.25 15.421 13.25 L 15.421 13.25 Z M 18.66 13.25 L 18.66 13.25 C 19.074 13.25 19.41 13.586 19.41 14 L 19.41 20 C 19.41 20.414 19.074 20.75 18.66 20.75 L 18.66 20.75 C 18.246 20.75 17.91 20.414 17.91 20 L 17.91 14 C 17.91 13.586 18.246 13.25 18.66 13.25 Z "
fill-rule="evenodd"
fill="url(#_lgradient_0)"
id="path7"
style="fill:url(#linearGradient839);fill-opacity:1.0" />
</svg>

After

Width:  |  Height:  |  Size: 4.9 KiB

View file

@ -0,0 +1,91 @@
/*
* Copyright 2016 David Edmundson <davidedmundson@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2 or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import QtQuick 2.2
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
Item {
id: root
property alias text: label.text
property alias iconSource: icon.source
property alias containsMouse: mouseArea.containsMouse
property alias font: label.font
signal clicked
activeFocusOnTab: true
property int iconSize: units.gridUnit * 2.5
implicitWidth: Math.max(iconSize + units.largeSpacing * 2, label.contentWidth)
implicitHeight: iconSize + units.smallSpacing + label.implicitHeight
opacity: activeFocus || containsMouse ? 1.5 : 0.97
Behavior on opacity {
PropertyAnimation { // OpacityAnimator makes it turn black at random intervals
duration: units.longDuration * 2
easing.type: Easing.InOutQuad
}
}
PlasmaCore.IconItem {
id: icon
anchors {
top: parent.top
horizontalCenter: parent.horizontalCenter
}
width: iconSize
height: iconSize
colorGroup: PlasmaCore.ColorScope.colorGroup
active: mouseArea.containsMouse || root.activeFocus
}
PlasmaComponents.Label {
id: label
anchors {
top: icon.bottom
topMargin: units.smallSpacing
left: parent.left
right: parent.right
}
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignTop
wrapMode: Text.WordWrap
font.underline: root.activeFocus
font.pointSize: config.fontSize
font.family: config.font
color:activeFocus || containsMouse ? config.highlight_color : config.color
}
MouseArea {
id: mouseArea
hoverEnabled: true
onClicked: root.clicked()
anchors.fill: parent
}
Keys.onEnterPressed: clicked()
Keys.onReturnPressed: clicked()
Keys.onSpacePressed: clicked()
Accessible.onPressAction: clicked()
Accessible.role: Accessible.Button
Accessible.name: label.text
}

View file

@ -0,0 +1,52 @@
/*
* Copyright 2016 Kai Uwe Broulik <kde@privat.broulik.de>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2 or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import QtQuick 2.2
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.workspace.components 2.0 as PW
Row {
spacing: units.smallSpacing
visible: pmSource.data["Battery"]["Has Cumulative"]
PlasmaCore.DataSource {
id: pmSource
engine: "powermanagement"
connectedSources: ["Battery", "AC Adapter"]
}
PW.BatteryIcon {
id: battery
hasBattery: pmSource.data["Battery"]["Has Battery"] || false
percent: pmSource.data["Battery"]["Percent"] || 0
pluggedIn: pmSource.data["AC Adapter"] ? pmSource.data["AC Adapter"]["Plugged in"] : false
height: batteryLabel.height
width: height
}
PlasmaComponents.Label {
id: batteryLabel
height: undefined
text: i18nd("plasma_lookandfeel_org.kde.lookandfeel","%1%", battery.percent)
Accessible.name: i18nd("plasma_lookandfeel_org.kde.lookandfeel","Battery at %1%", battery.percent)
}
}

View file

@ -0,0 +1,55 @@
/*
* Copyright 2016 David Edmundson <davidedmundson@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2 or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import QtQuick 2.8
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.5
import org.kde.plasma.core 2.0
RowLayout {
readonly property bool softwareRendering: GraphicsInfo.api === GraphicsInfo.Software
Label {
text: Qt.formatDate(timeSource.data["Local"]["DateTime"], Qt.DefaultLocaleLongDate)
color: config.color
style: softwareRendering ? Text.Outline : Text.Normal
styleColor: softwareRendering ? ColorScope.backgroundColor : "transparent" //no outline, doesn't matter
font.pointSize: 11
Layout.alignment: Qt.AlignHCenter
font.family: config.font
}
Label {
text: Qt.formatTime(timeSource.data["Local"]["DateTime"])
color: config.color
style: softwareRendering ? Text.Outline : Text.Normal
styleColor: softwareRendering ? ColorScope.backgroundColor : "transparent" //no outline, doesn't matter
font.pointSize: 11
Layout.alignment: Qt.AlignHCenter
font.family: config.font
}
DataSource {
id: timeSource
engine: "time"
connectedSources: ["Local"]
interval: 1000
}
}

View file

@ -0,0 +1,19 @@
import QtQuick 2.2
import QtQuick.Layouts 1.2
import QtQuick.Controls 2.4
import QtQuick.Controls.Styles 1.4
TextField {
placeholderTextColor: config.color
palette.text: config.color
font.pointSize: config.fontSize
font.family: config.font
background: Rectangle {
color: "#3B3D48"
radius: parent.width / 2
height: 30
width: parent.width
opacity: 0.7
anchors.centerIn: parent
}
}

View file

@ -0,0 +1,48 @@
/***************************************************************************
* Copyright (C) 2014 by Daniel Vrátil <dvratil@redhat.com> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
***************************************************************************/
import QtQuick 2.1
import QtQuick.Controls 1.1 as QQC
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.workspace.keyboardlayout 1.0
PlasmaComponents.ToolButton {
id: kbLayoutButton
iconName: "input-keyboard"
implicitWidth: minimumWidth
text: layout.currentLayoutDisplayName
Accessible.name: i18ndc("plasma_lookandfeel_org.kde.lookandfeel", "Button to change keyboard layout", "Switch layout")
visible: layout.layouts.length > 1
onClicked: layout.nextLayout()
KeyboardLayout {
id: layout
function nextLayout() {
var layouts = layout.layouts;
var index = (layouts.indexOf(layout.currentLayout)+1) % layouts.length;
layout.currentLayout = layouts[index];
}
}
}

View file

@ -0,0 +1,119 @@
/*
* Copyright 2016 David Edmundson <davidedmundson@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2 or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import QtQuick 2.2
import QtQuick.Layouts 1.1
import QtQuick.Controls 1.1
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
Item {
id: root
/*
* Any message to be displayed to the user, visible above the text fields
*/
property alias notificationMessage: notificationsLabel.text
/*
* A list of Items (typically ActionButtons) to be shown in a Row beneath the prompts
*/
property alias actionItems: actionItemsLayout.children
/*
* A model with a list of users to show in the view
* The following roles should exist:
* - name
* - iconSource
*
* The following are also handled:
* - vtNumber
* - displayNumber
* - session
* - isTty
*/
property alias userListModel: userListView.model
/*
* Self explanatory
*/
property alias userListCurrentIndex: userListView.currentIndex
property var userListCurrentModelData: userListView.currentItem === null ? [] : userListView.currentItem.m
property bool showUserList: true
property alias userList: userListView
default property alias _children: innerLayout.children
UserList {
id: userListView
visible: showUserList && y > 0
anchors {
bottom: parent.verticalCenter
left: parent.left
right: parent.right
}
}
//goal is to show the prompts, in ~16 grid units high, then the action buttons
//but collapse the space between the prompts and actions if there's no room
//ui is constrained to 16 grid units wide, or the screen
ColumnLayout {
id: prompts
anchors.top: parent.verticalCenter
anchors.topMargin: units.gridUnit * 0.5
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
PlasmaComponents.Label {
id: notificationsLabel
Layout.maximumWidth: units.gridUnit * 16
Layout.alignment: Qt.AlignHCenter
Layout.fillWidth: true
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.WordWrap
font.italic: true
}
ColumnLayout {
Layout.minimumHeight: implicitHeight
Layout.maximumHeight: units.gridUnit * 10
Layout.maximumWidth: units.gridUnit * 16
Layout.alignment: Qt.AlignHCenter
ColumnLayout {
id: innerLayout
Layout.alignment: Qt.AlignHCenter
Layout.fillWidth: true
}
Item {
Layout.fillHeight: true
}
}
Row { //deliberately not rowlayout as I'm not trying to resize child items
id: actionItemsLayout
spacing: units.smallSpacing
Layout.alignment: Qt.AlignHCenter
}
Item {
Layout.fillHeight: true
}
}
}

View file

@ -0,0 +1,190 @@
/*
* Copyright 2014 David Edmundson <davidedmundson@kde.org>
* Copyright 2014 Aleix Pol Gonzalez <aleixpol@blue-systems.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2 or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import QtQuick 2.8
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
Item {
id: wrapper
// If we're using software rendering, draw outlines instead of shadows
// See https://bugs.kde.org/show_bug.cgi?id=398317
readonly property bool softwareRendering: GraphicsInfo.api === GraphicsInfo.Software
property bool isCurrent: true
readonly property var m: model
property string name
property string userName
property string avatarPath
property string iconSource
property bool constrainText: true
property alias nameFontSize: usernameDelegate.font.pointSize
property int fontSize: config.fontSize - 1
signal clicked()
property real faceSize: Math.min(width, height - usernameDelegate.height - units.smallSpacing)
opacity: isCurrent ? 1.0 : 0.5
Behavior on opacity {
OpacityAnimator {
duration: units.longDuration
}
}
// Draw a translucent background circle under the user picture
Rectangle {
anchors.centerIn: imageSource
width: imageSource.width + 2 // Subtract to prevent fringing
height: width
radius: width / 2
color: "#232831"
}
Item {
id: imageSource
anchors {
bottom: usernameDelegate.top
bottomMargin: units.largeSpacing
horizontalCenter: parent.horizontalCenter
}
Behavior on width {
PropertyAnimation {
from: faceSize
duration: units.longDuration * 2;
}
}
width: isCurrent ? faceSize : faceSize - units.largeSpacing
height: width
//Image takes priority, taking a full path to a file, if that doesn't exist we show an icon
Image {
id: face
source: wrapper.avatarPath
sourceSize: Qt.size(faceSize, faceSize)
fillMode: Image.PreserveAspectCrop
anchors.fill: parent
}
PlasmaCore.IconItem {
id: faceIcon
source: iconSource
visible: (face.status == Image.Error || face.status == Image.Null)
anchors.fill: parent
anchors.margins: units.gridUnit * 0.5 // because mockup says so...
colorGroup: PlasmaCore.ColorScope.colorGroup
}
}
ShaderEffect {
anchors {
bottom: usernameDelegate.top
bottomMargin: units.largeSpacing
horizontalCenter: parent.horizontalCenter
}
width: imageSource.width
height: imageSource.height
supportsAtlasTextures: true
property var source: ShaderEffectSource {
sourceItem: imageSource
// software rendering is just a fallback so we can accept not having a rounded avatar here
hideSource: wrapper.GraphicsInfo.api !== GraphicsInfo.Software
live: true // otherwise the user in focus will show a blurred avatar
}
property var colorBorder: "#00000000"
//draw a circle with an antialised border
//innerRadius = size of the inner circle with contents
//outerRadius = size of the border
//blend = area to blend between two colours
//all sizes are normalised so 0.5 == half the width of the texture
//if copying into another project don't forget to connect themeChanged to update()
//but in SDDM that's a bit pointless
fragmentShader: "
varying highp vec2 qt_TexCoord0;
uniform highp float qt_Opacity;
uniform lowp sampler2D source;
uniform lowp vec4 colorBorder;
highp float blend = 0.01;
highp float innerRadius = 0.47;
highp float outerRadius = 0.49;
lowp vec4 colorEmpty = vec4(0.0, 0.0, 0.0, 0.0);
void main() {
lowp vec4 colorSource = texture2D(source, qt_TexCoord0.st);
highp vec2 m = qt_TexCoord0 - vec2(0.5, 0.5);
highp float dist = sqrt(m.x * m.x + m.y * m.y);
if (dist < innerRadius)
gl_FragColor = colorSource;
else if (dist < innerRadius + blend)
gl_FragColor = mix(colorSource, colorBorder, ((dist - innerRadius) / blend));
else if (dist < outerRadius)
gl_FragColor = colorBorder;
else if (dist < outerRadius + blend)
gl_FragColor = mix(colorBorder, colorEmpty, ((dist - outerRadius) / blend));
else
gl_FragColor = colorEmpty ;
gl_FragColor = gl_FragColor * qt_Opacity;
}
"
}
PlasmaComponents.Label {
id: usernameDelegate
font.pointSize: Math.max(fontSize + 2,theme.defaultFont.pointSize + 2)
anchors {
bottom: parent.bottom
horizontalCenter: parent.horizontalCenter
}
height: implicitHeight // work around stupid bug in Plasma Components that sets the height
width: constrainText ? parent.width : implicitWidth
text: wrapper.name
style: softwareRendering ? Text.Outline : Text.Normal
styleColor: softwareRendering ? PlasmaCore.ColorScope.backgroundColor : "transparent" //no outline, doesn't matter
elide: Text.ElideRight
horizontalAlignment: Text.AlignHCenter
color: config.color
//make an indication that this has active focus, this only happens when reached with keyboard navigation
font.underline: wrapper.activeFocus
font.family: config.font
}
MouseArea {
anchors.fill: parent
hoverEnabled: true
onClicked: wrapper.clicked();
}
Accessible.name: name
Accessible.role: Accessible.Button
function accessiblePressAction() { wrapper.clicked() }
}

View file

@ -0,0 +1,93 @@
/*
* Copyright 2014 David Edmundson <davidedmundson@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2 or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import QtQuick 2.2
ListView {
id: view
readonly property string selectedUser: currentItem ? currentItem.userName : ""
readonly property int userItemWidth: units.gridUnit * 8
readonly property int userItemHeight: units.gridUnit * 8
implicitHeight: userItemHeight
activeFocusOnTab : true
/*
* Signals that a user was explicitly selected
*/
signal userSelected;
orientation: ListView.Horizontal
highlightRangeMode: ListView.StrictlyEnforceRange
//centre align selected item (which implicitly centre aligns the rest
preferredHighlightBegin: width/2 - userItemWidth/2
preferredHighlightEnd: preferredHighlightBegin
delegate: UserDelegate {
avatarPath: model.icon || ""
iconSource: model.iconName || "user-identity"
name: {
var displayName = model.realName || model.name
if (model.vtNumber === undefined || model.vtNumber < 0) {
return displayName
}
if (!model.session) {
return i18ndc("plasma_lookandfeel_org.kde.lookandfeel", "Nobody logged in on that session", "Unused")
}
var location = ""
if (model.isTty) {
location = i18ndc("plasma_lookandfeel_org.kde.lookandfeel", "User logged in on console number", "TTY %1", model.vtNumber)
} else if (model.displayNumber) {
location = i18ndc("plasma_lookandfeel_org.kde.lookandfeel", "User logged in on console (X display number)", "on TTY %1 (Display %2)", model.vtNumber, model.displayNumber)
}
if (location) {
return i18ndc("plasma_lookandfeel_org.kde.lookandfeel", "Username (location)", "%1 (%2)", displayName, location)
}
return displayName
}
userName: model.name
width: userItemWidth
height: userItemHeight
//if we only have one delegate, we don't need to clip the text as it won't be overlapping with anything
constrainText: ListView.view.count > 1
isCurrent: ListView.isCurrentItem
onClicked: {
ListView.view.currentIndex = index;
ListView.view.userSelected();
}
}
Keys.onEscapePressed: view.userSelected()
Keys.onEnterPressed: view.userSelected()
Keys.onReturnPressed: view.userSelected()
}

View file

@ -0,0 +1,29 @@
/********************************************************************
This file is part of the KDE project.
Copyright (C) 2017 Martin Gräßlin <mgraesslin@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************/
import QtQuick 2.5
import QtQuick.VirtualKeyboard 2.1
InputPanel {
id: inputPanel
property bool activated: false
active: activated && Qt.inputMethod.visible
visible: active
width: parent.width
}

View file

@ -0,0 +1,14 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22">
<defs id="defs3051">
<style type="text/css" id="current-color-scheme">
.ColorScheme-Text {
color:#f2f2f2;
}
</style>
</defs>
<path
style="fill:currentColor;fill-opacity:1;stroke:none"
d="M 11 3 A 3.9999902 4.0000296 0 0 0 7 7 A 3.9999902 4.0000296 0 0 0 11 11 A 3.9999902 4.0000296 0 0 0 15 7 A 3.9999902 4.0000296 0 0 0 11 3 z M 11 4 A 3 3.0000296 0 0 1 14 7 A 3 3.0000296 0 0 1 11 10 A 3 3.0000296 0 0 1 8 7 A 3 3.0000296 0 0 1 11 4 z M 11 12 A 7.9999504 8.0000296 0 0 0 3.0722656 19 L 4.0800781 19 A 6.9999604 7.0000296 0 0 1 11 13 A 6.9999604 7.0000296 0 0 1 17.921875 19 L 18.929688 19 A 7.9999504 8.0000296 0 0 0 11 12 z "
class="ColorScheme-Text"
/>
</svg>

After

Width:  |  Height:  |  Size: 782 B

View file

@ -0,0 +1,16 @@
[SddmGreeterTheme]
Name=Dracula
Description=Dracula sddm theme
Author=Eliver Lara
Copyright=(c) 2019, Eliver Lara
License=GPL 3+
Type=sddm-theme
Version=0.1
Website=https://github.com/EliverLara/Ant-Dracula/tree/master/kde/sddm
Screenshot=preview.png
MainScript=Main.qml
ConfigFile=theme.conf
TranslationsDirectory=translations
Email=eliverlara@gmail.com
Theme-Id=Dracula
Theme-API=2.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 KiB

View file

@ -0,0 +1,9 @@
[General]
type=image
color=#C3C7D1
highlight_color=#ffffff
selected_color=#9B79CC
selected_fg_color=#2e3440
fontSize=10
Background="assets/bg.png"
font="Cantarell"