Version 1.5

This commit is contained in:
Rokin 2018-04-10 12:57:55 +02:00
parent 37b765d322
commit 809faf1f3d
31 changed files with 1771 additions and 129 deletions

View File

@ -24,4 +24,7 @@
- SDDM : Textbox, PasswordBox and Button colors no longer appear with the default white theme. Colors schemes are now directly integrated into the SDDM theme. This requires a slight visual change.
- SDDM : New icons, they are now directly integrated into the SDDM theme.
#### Version 1.5 - 10 April 2018
- Plasma theme : Fix button.svg (hover)
- Plasma theme : New : add lockscreen (look-and-feel)
- Plasma theme : Change default icons Papirus-Adapta to Papirus-Adapta-Nokto (better render on dark theme)

View File

@ -23,6 +23,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
@ -35,16 +36,16 @@
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1344"
inkscape:window-height="897"
inkscape:window-width="1920"
inkscape:window-height="1170"
id="namedview158"
showgrid="false"
inkscape:zoom="3.2747253"
inkscape:cx="121.278"
inkscape:cy="31.557136"
inkscape:window-x="2152"
inkscape:window-y="64"
inkscape:window-maximized="0"
inkscape:zoom="6.5494506"
inkscape:cx="142.22505"
inkscape:cy="41.023296"
inkscape:window-x="1920"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" />
<defs
id="defs4273">
@ -1176,74 +1177,10 @@
y1="35"
x2="47.556"
y2="35" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient2643-3"
id="linearGradient11028"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.9,0,0,1,3.7,0)"
x1="50.333"
y1="35"
x2="47.556"
y2="35" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient2643-3"
id="radialGradient11030"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(-2,0,0,-1,112.79149,105.49538)"
cx="53.146"
cy="50.994999"
fx="53.146"
fy="50.994999"
r="3" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient2643-3"
id="radialGradient11032"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(-0.83333314,2.2550128e-7,-4.5100341e-7,-1.6666686,48.565916,141.1591)"
cx="54.679001"
cy="53.494999"
fx="54.679001"
fy="53.494999"
r="3" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient2643-3"
id="linearGradient11034"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.9,0,0,1,3.7,0)"
x1="49.778"
y1="35"
x2="47.556"
y2="35" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient2643-3"
id="radialGradient11036"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(-1.6666669,0,0,-0.8333327,95.076237,97.079509)"
cx="53.146"
cy="50.494999"
fx="53.146"
fy="50.494999"
r="3" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient2643-3"
id="radialGradient11038"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(-0.66666674,0,0,-1.5,39.352827,132.24297)"
cx="55.278999"
cy="53.494999"
fx="55.278999"
fy="53.494999"
r="3" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient2643-3"
id="radialGradient11040"
id="radialGradient884"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0,-1.1666673,1.8333333,0,-35.182,78.406961)"
cx="53.919998"
@ -1254,7 +1191,7 @@
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient2643-3"
id="radialGradient11042"
id="radialGradient886"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0,-2.3333321,0.66666647,0,-10.475258,137.93882)"
cx="50.544998"
@ -1262,6 +1199,70 @@
fx="50.544998"
fy="19.462999"
r="3" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient2643-3"
id="radialGradient888"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(-1.6666669,0,0,-0.8333327,95.076237,97.079509)"
cx="53.146"
cy="50.494999"
fx="53.146"
fy="50.494999"
r="3" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient2643-3"
id="radialGradient890"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(-0.66666674,0,0,-1.5,39.352827,132.24297)"
cx="55.278999"
cy="53.494999"
fx="55.278999"
fy="53.494999"
r="3" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient2643-3"
id="linearGradient892"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.9,0,0,1,3.7,0)"
x1="49.778"
y1="35"
x2="47.556"
y2="35" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient2643-3"
id="radialGradient894"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(-2,0,0,-1,112.79149,105.49538)"
cx="53.146"
cy="50.994999"
fx="53.146"
fy="50.994999"
r="3" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient2643-3"
id="radialGradient896"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(-0.83333314,2.2550128e-7,-4.5100341e-7,-1.6666686,48.565916,141.1591)"
cx="54.679001"
cy="53.494999"
fx="54.679001"
fy="53.494999"
r="3" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient2643-3"
id="linearGradient898"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.9,0,0,1,3.7,0)"
x1="50.333"
y1="35"
x2="47.556"
y2="35" />
</defs>
<g
id="layer1"
@ -1269,11 +1270,11 @@
<path
inkscape:connector-curvature="0"
id="normal-center"
d="m 10.988232,1017.0953 v 29.8972 h 29.897141 v -29.8972 z"
d="m 12.209709,1014.4997 v 29.8972 H 42.10685 v -29.8972 z"
style="color:#000000;fill:#2e2e2e;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.9342863" />
<g
id="normal-left"
transform="matrix(0.93428636,0,0,0.93428636,-38.528959,998.40957)"
transform="matrix(0.93428636,0,0,0.93428636,-37.307482,995.81393)"
style="stroke:none">
<path
inkscape:connector-curvature="0"
@ -1284,11 +1285,11 @@
inkscape:connector-curvature="0"
id="path1775"
d="m 46,20 v 32 h 2 V 20 Z"
style="color:#000000;line-height:normal;font-family:Sans;text-indent:0;text-align:start;text-transform:none;fill:url(#linearGradient11028);stroke-width:1.26300001" />
style="color:#000000;line-height:normal;font-family:Sans;text-indent:0;text-align:start;text-transform:none;fill:url(#linearGradient898);stroke-width:1.26300001" />
</g>
<g
id="normal-bottom"
transform="matrix(0.93428636,0,0,0.93428636,-38.528959,999.34387)"
transform="matrix(0.93428636,0,0,0.93428636,-37.307482,996.74823)"
style="stroke:none">
<path
inkscape:connector-curvature="0"
@ -1307,12 +1308,12 @@
height="100%"
x="0"
y="0"
transform="matrix(-1,0,0,1,51.873598,-4.7946986e-7)"
transform="matrix(-1,0,0,1,54.316552,-4.3477131e-7)"
xlink:href="#normal-left"
style="fill:#2e2e2e;fill-opacity:1" />
<g
id="normal-top"
transform="matrix(0.93428636,0,0,0.93428636,-38.528959,993.73817)"
transform="matrix(0.93428636,0,0,0.93428636,-37.307482,991.14253)"
style="stroke:none">
<path
inkscape:connector-curvature="0"
@ -1327,7 +1328,7 @@
</g>
<g
id="normal-bottomleft"
transform="matrix(0.93428636,0,0,0.93428636,4.4481944,998.40957)"
transform="matrix(0.93428636,0,0,0.93428636,5.6696709,995.81393)"
style="stroke:none">
<path
inkscape:connector-curvature="0"
@ -1341,12 +1342,12 @@
inkscape:connector-curvature="0"
id="path1799"
d="M 7,59 H 0 v -7 h 2 v 1 c 0,1.5 0.5,2 2,2 h 3 z"
style="fill:url(#radialGradient11030)" />
style="fill:url(#radialGradient894)" />
<path
inkscape:connector-curvature="0"
id="path3801"
d="M 7,59 H 0 v -7 h 2 v 1 c 0,1.5 0.5,2 2,2 h 3 z"
style="fill:url(#radialGradient11032)" />
style="fill:url(#radialGradient896)" />
</g>
</g>
<use
@ -1355,12 +1356,12 @@
height="100%"
x="0"
y="0"
transform="matrix(-1,0,0,1,51.873598,-4.7946986e-7)"
transform="matrix(-1,0,0,1,54.316552,-4.3477131e-7)"
xlink:href="#normal-bottomleft"
style="fill:#2e2e2e;fill-opacity:1" />
<g
id="normal-topleft"
transform="matrix(0.93428636,0,0,0.93428636,4.4481944,998.40957)"
transform="matrix(0.93428636,0,0,0.93428636,5.6696709,995.81393)"
style="stroke:none;stroke-width:0.46200001">
<path
inkscape:connector-curvature="0"
@ -1385,12 +1386,12 @@
<path
inkscape:connector-curvature="0"
id="pressed-center"
d="m 128.7083,1046.9925 v -29.8972 H 98.811134 v 29.8972 z"
d="m 129.92978,1044.3969 v -29.8972 h -29.89717 v 29.8972 z"
style="text-indent:0;fill:#323232;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.9342863"
inkscape:label="#pressed-center" />
<g
id="pressed-left"
transform="matrix(0.93428636,0,0,0.93428636,49.293944,998.40957)"
transform="matrix(0.93428636,0,0,0.93428636,50.515421,995.81393)"
style="stroke:none">
<path
inkscape:connector-curvature="0"
@ -1401,11 +1402,11 @@
inkscape:connector-curvature="0"
id="path1590"
d="m 46,20 v 32 h 2 V 20 Z"
style="color:#000000;line-height:normal;font-family:Sans;text-indent:0;text-align:start;text-transform:none;fill:url(#linearGradient11034);stroke-width:1.26300001" />
style="color:#000000;line-height:normal;font-family:Sans;text-indent:0;text-align:start;text-transform:none;fill:url(#linearGradient892);stroke-width:1.26300001" />
</g>
<g
id="pressed-bottom"
transform="matrix(0.93428636,0,0,0.93428636,49.293944,999.34387)"
transform="matrix(0.93428636,0,0,0.93428636,50.515421,996.74823)"
style="stroke:none">
<path
inkscape:connector-curvature="0"
@ -1420,7 +1421,7 @@
</g>
<g
id="pressed-top"
transform="matrix(0.93428636,0,0,0.93428636,49.293944,993.73817)"
transform="matrix(0.93428636,0,0,0.93428636,50.515421,991.14253)"
style="stroke:none">
<path
inkscape:connector-curvature="0"
@ -1436,11 +1437,11 @@
<path
inkscape:connector-curvature="0"
id="focused-center"
d="m 54.899674,1017.0953 v 29.8972 h 29.89717 v -29.8972 z"
d="m 56.121151,1014.4997 v 29.8972 h 29.89717 v -29.8972 z"
style="fill:#2e2e2e;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.9342863" />
<g
id="focused-left"
transform="matrix(0.93428636,0,0,0.93428636,5.3825144,998.40957)"
transform="matrix(0.93428636,0,0,0.93428636,6.6039909,995.81393)"
style="stroke:none">
<path
inkscape:connector-curvature="0"
@ -1455,7 +1456,7 @@
</g>
<g
id="focused-top"
transform="matrix(0.93428636,0,0,0.93428636,5.3825144,993.73817)"
transform="matrix(0.93428636,0,0,0.93428636,6.6039909,991.14253)"
style="stroke:none">
<path
inkscape:connector-curvature="0"
@ -1470,7 +1471,7 @@
</g>
<g
id="focused-bottom"
transform="matrix(0.93428636,0,0,0.93428636,5.3825144,999.34387)"
transform="matrix(0.93428636,0,0,0.93428636,6.6039909,996.74823)"
style="stroke:none">
<path
inkscape:connector-curvature="0"
@ -1485,7 +1486,7 @@
</g>
<g
id="focused-right"
transform="matrix(-0.93428636,0,0,0.93428636,134.31402,998.40957)"
transform="matrix(-0.93428636,0,0,0.93428636,135.5355,995.81393)"
style="stroke:none">
<path
inkscape:connector-curvature="0"
@ -1500,7 +1501,7 @@
</g>
<g
id="focused-topright"
transform="matrix(0.93428636,0,0,0.93428636,5.3825144,998.40957)"
transform="matrix(0.93428636,0,0,0.93428636,6.6039909,995.81393)"
style="stroke:none;stroke-width:0.46200001">
<path
inkscape:connector-curvature="0"
@ -1524,7 +1525,7 @@
</g>
<g
id="focused-bottomright"
transform="matrix(0.93428636,0,0,0.93428636,5.3825144,998.40957)"
transform="matrix(0.93428636,0,0,0.93428636,6.6039909,995.81393)"
style="stroke:none">
<path
inkscape:connector-curvature="0"
@ -1548,7 +1549,7 @@
</g>
<g
id="focused-bottomleft"
transform="matrix(0.93428636,0,0,0.93428636,5.3825144,998.40957)"
transform="matrix(0.93428636,0,0,0.93428636,6.6039909,995.81393)"
style="stroke:none">
<path
inkscape:connector-curvature="0"
@ -1572,7 +1573,7 @@
</g>
<g
id="focused-topleft"
transform="matrix(0.93428636,0,0,0.93428636,4.4481944,998.40957)"
transform="matrix(0.93428636,0,0,0.93428636,5.6696709,995.81393)"
style="stroke:none;stroke-width:0.46200001">
<path
inkscape:connector-curvature="0"
@ -1596,7 +1597,7 @@
</g>
<g
id="pressed-bottomleft"
transform="matrix(0.93428636,0,0,0.93428636,92.271144,998.40957)"
transform="matrix(0.93428636,0,0,0.93428636,93.492621,995.81393)"
style="stroke:none">
<path
inkscape:connector-curvature="0"
@ -1610,17 +1611,17 @@
inkscape:connector-curvature="0"
id="path2230"
d="M 7,59 H 0 v -7 h 2 v 1 c 0,1.5 0.5,2 2,2 h 3 z"
style="fill:url(#radialGradient11036)" />
style="fill:url(#radialGradient888)" />
<path
inkscape:connector-curvature="0"
id="path2232"
d="M 7,59 H 0 v -7 h 2 v 1 c 0,1.5 0.5,2 2,2 h 3 z"
style="fill:url(#radialGradient11038)" />
style="fill:url(#radialGradient890)" />
</g>
</g>
<g
id="pressed-topleft"
transform="matrix(0.93428636,0,0,0.93428636,92.271144,998.40957)"
transform="matrix(0.93428636,0,0,0.93428636,93.492621,995.81393)"
style="stroke:none;stroke-width:0.46200001">
<path
inkscape:connector-curvature="0"
@ -1634,12 +1635,12 @@
inkscape:connector-curvature="0"
id="path2238"
d="M 7,13 H 0 v 7 h 2 v -4 c 0,-1.5 0.5,-2 2,-2 h 3 z"
style="fill:url(#radialGradient11040)" />
style="fill:url(#radialGradient884)" />
<path
inkscape:connector-curvature="0"
id="path2240"
d="M 7,13 H 0 v 7 h 2 v -4 c 0,-1.5 0.5,-2 2,-2 h 3 z"
style="fill:url(#radialGradient11042)" />
style="fill:url(#radialGradient886)" />
</g>
</g>
<use
@ -1648,7 +1649,7 @@
height="100%"
x="0"
y="0"
transform="matrix(-1,0,0,1,227.51945,-4.7946986e-7)"
transform="matrix(-1,0,0,1,229.96241,-4.3477131e-7)"
xlink:href="#pressed-left" />
<use
id="pressed-bottomright"
@ -1656,7 +1657,7 @@
height="100%"
x="0"
y="0"
transform="matrix(-1,0,0,1,227.51945,-4.7946986e-7)"
transform="matrix(-1,0,0,1,229.96241,-4.3477131e-7)"
xlink:href="#pressed-bottomleft" />
<use
id="pressed-topright"
@ -1664,11 +1665,11 @@
height="100%"
x="0"
y="0"
transform="matrix(-1,0,0,1,227.51945,-4.7946986e-7)"
transform="matrix(-1,0,0,1,229.96241,-4.3477131e-7)"
xlink:href="#pressed-topleft" />
<g
id="normal-topright"
transform="matrix(-0.93428776,0,0,0.93428307,47.425384,998.40967)"
transform="matrix(-0.93428776,0,0,0.93428307,48.646861,995.81403)"
style="stroke:none;stroke-width:0.46200001"
inkscape:label="#normal-topright">
<path
@ -1694,12 +1695,12 @@
<path
inkscape:connector-curvature="0"
id="hover-center"
d="m 141.78837,1017.0953 v 29.8972 h 29.89714 v -29.8972 z"
style="color:#000000;fill:#2e2e2e;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.9342863" />
d="m 144.70449,1014.4997 v 29.8972 h 29.89714 v -29.8972 z"
style="color:#000000;fill:#2e2e2e;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.9342863;opacity:0" />
<g
id="hover-left"
transform="matrix(0.93428636,0,0,0.93428636,92.271184,998.40957)"
style="stroke:none">
transform="matrix(0.93428636,0,0,0.93428636,95.187291,995.81393)"
style="stroke:none;opacity:0">
<path
inkscape:connector-curvature="0"
id="path1773-8"
@ -1713,8 +1714,8 @@
</g>
<g
id="hover-bottom"
transform="matrix(0.93428636,0,0,0.93428636,92.271184,999.34387)"
style="stroke:none">
transform="matrix(0.93428636,0,0,0.93428636,95.187291,996.74823)"
style="stroke:none;opacity:0">
<path
inkscape:connector-curvature="0"
id="path1791-2"
@ -1737,8 +1738,8 @@
style="fill:#2e2e2e;fill-opacity:1" />
<g
id="hover-top"
transform="matrix(0.93428636,0,0,0.93428636,92.271184,993.73817)"
style="stroke:none">
transform="matrix(0.93428636,0,0,0.93428636,95.187291,991.14253)"
style="stroke:none;opacity:0">
<path
inkscape:connector-curvature="0"
id="path5125-7"
@ -1752,8 +1753,8 @@
</g>
<g
id="hover-bottomleft"
transform="matrix(0.93428636,0,0,0.93428636,135.24834,998.40957)"
style="stroke:none">
transform="matrix(0.93428636,0,0,0.93428636,138.16446,995.81393)"
style="stroke:none;opacity:0">
<path
inkscape:connector-curvature="0"
id="path1797-2"
@ -1785,8 +1786,8 @@
style="fill:#5d3263;fill-opacity:1" />
<g
id="hover-topleft"
transform="matrix(0.93428636,0,0,0.93428636,135.24834,998.40957)"
style="stroke:none;stroke-width:0.46200001"
transform="matrix(0.93428636,0,0,0.93428636,138.16446,995.81393)"
style="stroke:none;stroke-width:0.46200001;opacity:0"
inkscape:label="#hover-topleft">
<path
inkscape:connector-curvature="0"
@ -1810,8 +1811,8 @@
</g>
<g
id="hover-topright"
transform="matrix(-0.93428776,0,0,0.93428307,178.22553,998.40967)"
style="stroke:none;stroke-width:0.46200001"
transform="matrix(-0.93428776,0,0,0.93428307,181.14165,995.81403)"
style="stroke:none;stroke-width:0.46200001;opacity:0"
inkscape:label="#hover-topright">
<path
inkscape:connector-curvature="0"
@ -1835,8 +1836,8 @@
</g>
<g
id="hover-right"
transform="matrix(-0.93436324,0,0,-0.93436324,221.20545,1065.6822)"
style="stroke:none">
transform="matrix(-0.93436324,0,0,-0.93436324,224.12157,1063.0866)"
style="stroke:none;opacity:0">
<path
inkscape:connector-curvature="0"
id="path1773-8-0"
@ -1850,8 +1851,8 @@
</g>
<g
id="hover-bottomright"
transform="matrix(-0.93428636,0,0,0.93428636,178.22458,998.41207)"
style="stroke:none"
transform="matrix(-0.93428636,0,0,0.93428636,181.1407,995.81643)"
style="stroke:none;opacity:0"
inkscape:label="#hover-bottomright">
<path
inkscape:connector-curvature="0"

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 62 KiB

View File

@ -0,0 +1,79 @@
/*
* 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 * 3
implicitWidth: Math.max(iconSize + units.largeSpacing * 2, label.contentWidth)
implicitHeight: iconSize + units.smallSpacing + label.implicitHeight
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
}
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,44 @@
/*
* 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.0
import QtQuick.Layouts 1.1
import org.kde.plasma.core 2.0
import org.kde.plasma.components 2.0
ColumnLayout {
Label {
text: Qt.formatTime(timeSource.data["Local"]["DateTime"])
font.pointSize: 32 //Mockup says this, I'm not sure what to do?
Layout.alignment: Qt.AlignHCenter
renderType: Text.QtRendering
}
Label {
text: Qt.formatDate(timeSource.data["Local"]["DateTime"], Qt.DefaultLocaleLongDate)
font.pointSize: 18
Layout.alignment: Qt.AlignHCenter
}
DataSource {
id: timeSource
engine: "time"
connectedSources: ["Local"]
interval: 1000
}
}

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,158 @@
/*
* 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.4
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
Item {
id: wrapper
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
signal clicked()
property real faceSize: Math.min(width, height - usernameDelegate.height - units.largeSpacing)
opacity: isCurrent ? 1.0 : 0.5
Behavior on opacity {
OpacityAnimator {
duration: units.longDuration
}
}
Item {
id: imageSource
width: faceSize
height: faceSize
//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.top: parent.top
anchors.horizontalCenter: parent.horizontalCenter
width: imageSource.width
height: imageSource.height
supportsAtlasTextures: true
property var source: ShaderEffectSource {
sourceItem: imageSource
hideSource: true
live: false
}
property var colorBorder: PlasmaCore.ColorScope.textColor
//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
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
elide: Text.ElideRight
horizontalAlignment: Text.AlignHCenter
//make an indication that this has active focus, this only happens when reached with keyboard navigation
font.underline: wrapper.activeFocus
}
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,28 @@
/********************************************************************
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

@ -5,7 +5,7 @@ widgetStyle=kvantum
ColorScheme=Darkine
[kdeglobals][Icons]
Theme=Papirus-Adapta
Theme=Papirus-Adapta-Nokto
[plasmarc][Theme]
name=Darkine

View File

@ -0,0 +1,71 @@
/********************************************************************
This file is part of the KDE project.
Copyright (C) 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 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.0
import org.kde.plasma.core 2.0 as PlasmaCore
import "../osd"
PlasmaCore.FrameSvgItem {
id: osd
// OSD Timeout in msecs - how long it will stay on the screen
property int timeout: 1800
// This is either a text or a number, if showingProgress is set to true,
// the number will be used as a value for the progress bar
property var osdValue
// Icon name to display
property string icon
// Set to true if the value is meant for progress bar,
// false for displaying the value as normal text
property bool showingProgress: false
objectName: "onScreenDisplay"
visible: false
width: osdItem.width + margins.left + margins.right
height: osdItem.height + margins.top + margins.bottom
imagePath: "widgets/background"
function show() {
osd.visible = true;
hideTimer.restart();
}
// avoid leaking ColorScope of lock screen theme into the OSD "popup"
PlasmaCore.ColorScope {
width: osdItem.width
height: osdItem.height
anchors.centerIn: parent
colorGroup: PlasmaCore.Theme.NormalColorGroup
OsdItem {
id: osdItem
rootItem: osd
}
}
Timer {
id: hideTimer
interval: osd.timeout
onTriggered: {
osd.visible = false;
osd.icon = "";
osd.osdValue = 0;
}
}
}

View File

@ -0,0 +1,65 @@
/********************************************************************
This file is part of the KDE project.
Copyright (C) 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 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.Controls 1.1
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.private.sessions 2.0
import "../components"
Item {
id: root
property bool viewVisible: false
property bool debug: false
property string notification
property int interfaceVersion: org_kde_plasma_screenlocker_greeter_interfaceVersion ? org_kde_plasma_screenlocker_greeter_interfaceVersion : 0
signal clearPassword()
LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft
LayoutMirroring.childrenInherit: true
Loader {
id: mainLoader
anchors.fill: parent
opacity: 0
onItemChanged: opacity = 1
focus: true
Behavior on opacity {
OpacityAnimator {
duration: units.longDuration
easing.type: Easing.InCubic
}
}
}
Connections {
id:loaderConnection
target: org_kde_plasma_screenlocker_greeter_view
onFrameSwapped: {
mainLoader.source = "LockScreenUi.qml";
loaderConnection.target = null;
}
}
Component.onCompleted: {
if (root.interfaceVersion < 2) {
mainLoader.source = "LockScreenUi.qml";
}
}
}

View File

@ -0,0 +1,399 @@
/********************************************************************
This file is part of the KDE project.
Copyright (C) 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 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.Controls 1.1
import QtQuick.Layouts 1.1
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.private.sessions 2.0
import "../components"
PlasmaCore.ColorScope {
colorGroup: PlasmaCore.Theme.ComplementaryColorGroup
Connections {
target: authenticator
onFailed: {
root.notification = i18nd("plasma_lookandfeel_org.kde.lookandfeel","Unlocking failed");
}
onGraceLockedChanged: {
if (!authenticator.graceLocked) {
root.notification = "";
root.clearPassword();
}
}
onMessage: {
root.notification = msg;
}
onError: {
root.notification = err;
}
}
SessionsModel {
id: sessionsModel
showNewSessionEntry: true
}
Rectangle {
id: sceneColorBackground
color: "#1d1d1d"
anchors.fill: parent
}
PlasmaCore.DataSource {
id: keystateSource
engine: "keystate"
connectedSources: "Caps Lock"
}
Loader {
id: changeSessionComponent
active: false
source: "ChangeSession.qml"
visible: false
}
Item {
id: lockScreenRoot
x: parent.x
y: parent.y
width: parent.width
height: parent.height
Component.onCompleted: PropertyAnimation { id: launchAnimation; target: lockScreenRoot; property: "opacity"; from: 0; to: 1; duration: 1000 }
states: [
State {
name: "onOtherSession"
// for slide out animation
PropertyChanges { target: lockScreenRoot; y: lockScreenRoot.height }
// we also change the opacity just to be sure it's not visible even on unexpected screen dimension changes with possible race conditions
PropertyChanges { target: lockScreenRoot; opacity: 0 }
}
]
transitions:
Transition {
// we only animate switchting to another session, because kscreenlocker doesn't get notified when
// coming from another session back and so we wouldn't know when to trigger the animation exactly
from: ""
to: "onOtherSession"
PropertyAnimation { id: stateChangeAnimation; properties: "y"; duration: 300; easing.type: Easing.InQuad}
PropertyAnimation { properties: "opacity"; duration: 300}
onRunningChanged: {
// after the animation has finished switch session: since we only animate the transition TO state "onOtherSession"
// and not the other way around, we don't have to check the state we transitioned into
if (/* lockScreenRoot.state == "onOtherSession" && */ !running) {
mainStack.currentItem.switchSession()
}
}
}
Clock {
id: clock
anchors.horizontalCenter: parent.horizontalCenter
y: (mainBlock.userList.y + mainStack.y)/2 - height/2
visible: y > 0
Layout.alignment: Qt.AlignBaseline
}
ListModel {
id: users
Component.onCompleted: {
users.append({name: kscreenlocker_userName,
realName: kscreenlocker_userName,
icon: kscreenlocker_userImage,
})
}
}
StackView {
id: mainStack
anchors {
left: parent.left
right: parent.right
}
height: lockScreenRoot.height
focus: true //StackView is an implicit focus scope, so we need to give this focus so the item inside will have it
initialItem: MainBlock {
id: mainBlock
showUserList: userList.y + mainStack.y > 0
Stack.onStatusChanged: {
// prepare for presenting again to the user
if (Stack.status == Stack.Activating) {
mainPasswordBox.remove(0, mainPasswordBox.length)
mainPasswordBox.focus = true
}
}
userListModel: users
notificationMessage: {
var text = ""
if (keystateSource.data["Caps Lock"]["Locked"]) {
text += i18nd("plasma_lookandfeel_org.kde.lookandfeel","Caps Lock is on")
if (root.notification) {
text += " • "
}
}
text += root.notification
return text
}
onLoginRequest: {
root.notification = ""
authenticator.tryUnlock(password)
}
actionItems: [
ActionButton {
text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Switch User")
iconSource: "system-switch-user"
onClicked: mainStack.push(switchSessionPage)
// the current session isn't listed in the model, hence a check for greater than zero, not one
visible: (sessionsModel.count > 0 || sessionsModel.canStartNewSession) && sessionsModel.canSwitchUser
}
]
Loader {
Layout.fillWidth: true
Layout.preferredHeight: item ? item.implicitHeight : 0
active: config.showMediaControls
source: "MediaControls.qml"
}
}
}
Loader {
id: inputPanel
state: "hidden"
readonly property bool keyboardActive: item ? item.active : false
anchors {
left: parent.left
right: parent.right
}
function showHide() {
state = state == "hidden" ? "visible" : "hidden";
}
Component.onCompleted: inputPanel.source = "../components/VirtualKeyboard.qml"
onKeyboardActiveChanged: {
if (keyboardActive) {
state = "visible";
} else {
state = "hidden";
}
}
states: [
State {
name: "visible"
PropertyChanges {
target: mainStack
y: Math.min(0, lockScreenRoot.height - inputPanel.height - mainBlock.visibleBoundary)
}
PropertyChanges {
target: inputPanel
y: lockScreenRoot.height - inputPanel.height
opacity: 1
}
},
State {
name: "hidden"
PropertyChanges {
target: mainStack
y: 0
}
PropertyChanges {
target: inputPanel
y: lockScreenRoot.height - lockScreenRoot.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: switchSessionPage
SessionManagementScreen {
property var switchSession: finalSwitchSession
Stack.onStatusChanged: {
if (Stack.status == Stack.Activating) {
focus = true
}
}
userListModel: sessionsModel
// initiating animation of lockscreen for session switch
function initSwitchSession() {
lockScreenRoot.state = 'onOtherSession'
}
// initiating session switch and preparing lockscreen for possible return of user
function finalSwitchSession() {
mainStack.pop({immediate:true})
sessionsModel.switchUser(userListCurrentModelData.vtNumber)
lockScreenRoot.state = ''
}
Keys.onLeftPressed: userList.decrementCurrentIndex()
Keys.onRightPressed: userList.incrementCurrentIndex()
Keys.onEnterPressed: initSwitchSession()
Keys.onReturnPressed: initSwitchSession()
Keys.onEscapePressed: mainStack.pop()
PlasmaComponents.Button {
Layout.fillWidth: true
// the magic "-1" vtNumber indicates the "New Session" entry
text: userListCurrentModelData.vtNumber === -1 ? i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Start New Session") : i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Switch Session")
onClicked: initSwitchSession()
}
actionItems: [
ActionButton {
iconSource: "go-previous"
text: i18nd("plasma_lookandfeel_org.kde.lookandfeel","Back")
onClicked: mainStack.pop()
}
]
}
}
Loader {
active: root.viewVisible
source: "LockOsd.qml"
anchors {
horizontalCenter: parent.horizontalCenter
bottom: parent.bottom
}
}
RowLayout {
id: footer
anchors {
bottom: parent.bottom
left: parent.left
right: parent.right
margins: units.smallSpacing
}
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: inputPanel.status == Loader.Ready
}
KeyboardLayoutButton {
}
Item {
Layout.fillWidth: true
}
Battery {}
}
}
Component.onCompleted: {
// version support checks
if (root.interfaceVersion < 1) {
// ksmserver of 5.4, with greeter of 5.5
root.viewVisible = true;
}
}
}

View File

@ -0,0 +1,141 @@
/*
* 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 QtQuick.Controls.Styles 1.4 //ROKIN : for style textbox,button,label
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import "../components"
SessionManagementScreen {
property Item mainPasswordBox: passwordBox
//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
/*
* 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
*/
signal loginRequest(string password)
function startLogin() {
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 focussed
//See https://bugreports.qt.io/browse/QTBUG-55460
loginButton.forceActiveFocus();
loginRequest(password);
}
PlasmaComponents.TextField {
id: passwordBox
Layout.fillWidth: true
//ROKIN
style: TextFieldStyle {
textColor: "#5e5f5e"
selectedTextColor: "#2e2f2f" // The highlighted text color
selectionColor: "#8f86ba" // The text highlight color
placeholderTextColor:"#5e5f5e" // When the text field is empty
background: Rectangle {
color: "#1a1a1a"
radius: 2
border.color: "#1a1a1a"
border.width: 1
}
}
placeholderText: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Password")
focus: true
echoMode: TextInput.Password
inputMethodHints: Qt.ImhHiddenText | Qt.ImhSensitiveData | Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText
enabled: !authenticator.graceLocked
revealPasswordButtonShown: true
onAccepted: startLogin()
//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: root
onClearPassword: {
passwordBox.forceActiveFocus()
passwordBox.selectAll()
}
}
}
PlasmaComponents.Button {
id: loginButton
Layout.fillWidth: true
//ROKIN
style: ButtonStyle {
background: Rectangle {
border.width: control.activeFocus ? 2 : 1
border.color: "#1a1a1a"
radius: 2
gradient: Gradient {
GradientStop { position: 0 ; color: control.pressed ? "#282828" : "#292929" }
GradientStop { position: 1 ; color: control.pressed ? "#212121" : "#212121" }
}
//implicitWidth: 100
implicitHeight: 25
}
label: Component{
id:labelLogin
Row{
anchors.left: parent.left
anchors.leftMargin: (parent.width - (textlogin.width + image.width))/2
anchors.top: parent.top
anchors.topMargin: 2
spacing: 0
Image{ id:image ;source: control.iconSource}
Label{
id:textlogin
height: 25
width:100
horizontalAlignment:Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
color: "#5e5f5e"
text: control.text
}
}
}
}
text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Unlock")
onClicked: startLogin()
}
}

View File

@ -0,0 +1,159 @@
/********************************************************************
This file is part of the KDE project.
Copyright (C) 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 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.Layouts 1.1
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
Item {
visible: mpris2Source.hasPlayer
implicitHeight: controlsRow.height + controlsRow.y
RowLayout {
id: controlsRow
anchors.bottom: parent.bottom
y: units.smallSpacing // some distance to the password field
width: parent.width
height: units.gridUnit * 3
spacing: 0
enabled: mpris2Source.canControl
PlasmaCore.DataSource {
id: mpris2Source
readonly property string source: "@multiplex"
readonly property var playerData: data[source]
readonly property bool hasPlayer: sources.length > 1 && !!playerData
readonly property string identity: hasPlayer ? playerData.Identity : ""
readonly property bool playing: hasPlayer && playerData.PlaybackStatus === "Playing"
readonly property bool canControl: hasPlayer && playerData.CanControl
readonly property bool canGoBack: hasPlayer && playerData.CanGoPrevious
readonly property bool canGoNext: hasPlayer && playerData.CanGoNext
readonly property var currentMetadata: hasPlayer ? playerData.Metadata : ({})
readonly property string track: {
var xesamTitle = currentMetadata["xesam:title"]
if (xesamTitle) {
return xesamTitle
}
// if no track title is given, print out the file name
var xesamUrl = currentMetadata["xesam:url"] ? currentMetadata["xesam:url"].toString() : ""
if (!xesamUrl) {
return ""
}
var lastSlashPos = xesamUrl.lastIndexOf('/')
if (lastSlashPos < 0) {
return ""
}
var lastUrlPart = xesamUrl.substring(lastSlashPos + 1)
return decodeURIComponent(lastUrlPart)
}
readonly property string artist: currentMetadata["xesam:artist"] || ""
readonly property string albumArt: currentMetadata["mpris:artUrl"] || ""
engine: "mpris2"
connectedSources: [source]
function startOperation(op) {
var service = serviceForSource(source)
var operation = service.operationDescription(op)
return service.startOperationCall(operation)
}
function goPrevious() {
startOperation("Previous");
}
function goNext() {
startOperation("Next");
}
function playPause(source) {
startOperation("PlayPause");
}
}
Image {
id: albumArt
Layout.preferredWidth: height
Layout.fillHeight: true
asynchronous: true
source: mpris2Source.albumArt
sourceSize: Qt.size(width, height)
visible: status === Image.Loading || status === Image.Ready
}
Item { // spacer
width: units.smallSpacing
height: 1
}
ColumnLayout {
Layout.fillWidth: true
spacing: 0
PlasmaExtras.Heading {
Layout.fillWidth: true
level: 4
wrapMode: Text.NoWrap
elide: Text.ElideRight
text: mpris2Source.track || i18n("No media playing")
textFormat: Text.PlainText
}
PlasmaExtras.Heading {
Layout.fillWidth: true
level: 5
wrapMode: Text.NoWrap
elide: Text.ElideRight
// if no artist is given, show player name instead
text: mpris2Source.artist || mpris2Source.identity || ""
textFormat: Text.PlainText
}
}
PlasmaComponents.ToolButton {
enabled: mpris2Source.canGoBack
iconName: LayoutMirroring.enabled ? "media-skip-forward" : "media-skip-backward"
onClicked: mpris2Source.goPrevious()
visible: mpris2Source.canGoBack || mpris2Source.canGoNext
Accessible.name: i18n("Previous track")
}
PlasmaComponents.ToolButton {
Layout.fillHeight: true
Layout.preferredWidth: height // make this button bigger
iconName: mpris2Source.playing ? "media-playback-pause" : "media-playback-start"
onClicked: mpris2Source.playPause()
Accessible.name: i18n("Play or Pause media")
}
PlasmaComponents.ToolButton {
enabled: mpris2Source.canGoNext
iconName: LayoutMirroring.enabled ? "media-skip-backward" : "media-skip-forward"
onClicked: mpris2Source.goNext()
visible: mpris2Source.canGoBack || mpris2Source.canGoNext
Accessible.name: i18n("Next track")
}
}
}

View File

@ -0,0 +1,23 @@
import QtQuick 2.4
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.1
import org.kde.plasma.core 2.0 as Plasmacore
RowLayout {
property alias cfg_showMediaControls: showMediaControls.checked
spacing: units.largeSpacing / 2
Label {
Layout.minimumWidth: formAlignment - units.largeSpacing //to match wallpaper config...
horizontalAlignment: Text.AlignRight
text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Show media controls:")
}
CheckBox {
id: showMediaControls
}
Item {
Layout.fillWidth: true
}
}

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
<kcfgfile name=""/>
<group name="General">
<entry name="showMediaControls" type="Bool">
<label>If true, shows any currently playing media along with controls to pause it.</label>
<default>true</default>
</entry>
</group>
</kcfg>

View File

@ -0,0 +1,58 @@
/*
* Copyright 2014 Martin Klapetek <mklapetek@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.0
import QtQuick.Window 2.2
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 PlasmaExtra
PlasmaCore.Dialog {
id: root
location: PlasmaCore.Types.Floating
type: PlasmaCore.Dialog.OnScreenDisplay
outputOnly: true
// OSD Timeout in msecs - how long it will stay on the screen
property int timeout: 1800
// This is either a text or a number, if showingProgress is set to true,
// the number will be used as a value for the progress bar
property var osdValue
// Icon name to display
property string icon
// Set to true if the value is meant for progress bar,
// false for displaying the value as normal text
property bool showingProgress: false
property bool animateOpacity: false
Behavior on opacity {
SequentialAnimation {
// prevent press and hold from flickering
PauseAnimation { duration: 100 }
NumberAnimation {
duration: root.timeout
easing.type: Easing.InQuad
}
}
enabled: root.animateOpacity
}
mainItem: OsdItem {
rootItem: root
}
}

View File

@ -0,0 +1,86 @@
/*
* Copyright 2014 Martin Klapetek <mklapetek@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.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 PlasmaExtra
import QtQuick.Window 2.2
Item {
property QtObject rootItem
height: Math.min(units.gridUnit * 15, Screen.desktopAvailableHeight / 5)
width: height
// /--------------------\
// | spacing |
// | /----------------\ |
// | | | |
// | | icon | |
// | | | |
// | | | |
// | \----------------/ |
// | spacing |
// | [progressbar/text] |
// | spacing |
// \--------------------/
PlasmaCore.IconItem {
id: icon
height: parent.height - Math.max(progressBar.height, label.height)
- ((units.smallSpacing/2) * 3) //it's an svg
width: parent.width
source: rootItem.icon
}
PlasmaComponents.ProgressBar {
id: progressBar
anchors {
bottom: parent.bottom
left: parent.left
right: parent.right
margins: Math.floor(units.smallSpacing / 2)
}
visible: rootItem.showingProgress
minimumValue: 0
maximumValue: 100
value: Number(rootItem.osdValue)
}
PlasmaExtra.Heading {
id: label
anchors {
bottom: parent.bottom
left: parent.left
right: parent.right
margins: Math.floor(units.smallSpacing / 2)
}
visible: !rootItem.showingProgress
text: rootItem.showingProgress ? "" : (rootItem.osdValue ? rootItem.osdValue : "")
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.WordWrap
maximumLineCount: 2
elide: Text.ElideLeft
minimumPointSize: theme.defaultFont.pointSize
fontSizeMode: Text.HorizontalFit
}
}