mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-08-02 09:48:50 +00:00
Merge branch 'mart/homeScreenSingleScroll'
This commit is contained in:
commit
1d29f0874e
12 changed files with 720 additions and 124 deletions
|
|
@ -48,3 +48,4 @@ add_subdirectory(bin)
|
||||||
add_subdirectory(qmlcomponents)
|
add_subdirectory(qmlcomponents)
|
||||||
add_subdirectory(services)
|
add_subdirectory(services)
|
||||||
add_subdirectory(settingsmodules)
|
add_subdirectory(settingsmodules)
|
||||||
|
add_subdirectory(containments)
|
||||||
|
|
|
||||||
|
|
@ -154,8 +154,8 @@ Rectangle {
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
height: compositorRoot.state == "homeScreen" ? 0 : bottomBarHeight
|
height: bottomBarHeight
|
||||||
color: Qt.rgba(0, 0, 0, 0.9 + 0.1*windowsZoom.scale)
|
color: Qt.rgba(0, 0, 0, 0.9)
|
||||||
|
|
||||||
Behavior on height {
|
Behavior on height {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
|
|
@ -167,11 +167,32 @@ Rectangle {
|
||||||
RowLayout {
|
RowLayout {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
|
PlasmaCore.IconItem {
|
||||||
|
colorGroup: PlasmaCore.Theme.ComplementaryColorGroup
|
||||||
|
width: units.iconSizes.smallMedium
|
||||||
|
height: width
|
||||||
|
source: "distribute-horizontal-x"
|
||||||
|
enabled: compositorRoot.state != "switcher" && windowsLayout.children.length > 0
|
||||||
|
opacity: enabled ? 1 : 0.2
|
||||||
|
|
||||||
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
Layout.preferredWidth: units.iconSizes.medium
|
||||||
|
Layout.preferredHeight: units.iconSizes.medium
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
onClicked: {
|
||||||
|
compositorRoot.state = "switcher";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
PlasmaCore.IconItem {
|
PlasmaCore.IconItem {
|
||||||
colorGroup: PlasmaCore.Theme.ComplementaryColorGroup
|
colorGroup: PlasmaCore.Theme.ComplementaryColorGroup
|
||||||
width: units.iconSizes.smallMedium
|
width: units.iconSizes.smallMedium
|
||||||
height: width
|
height: width
|
||||||
source: "go-home"
|
source: "go-home"
|
||||||
|
enabled: compositorRoot.state != "homeScreen";
|
||||||
|
opacity: enabled ? 1 : 0.2
|
||||||
|
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
Layout.preferredWidth: units.iconSizes.medium
|
Layout.preferredWidth: units.iconSizes.medium
|
||||||
|
|
@ -190,7 +211,7 @@ Rectangle {
|
||||||
height: width
|
height: width
|
||||||
source: "window-close"
|
source: "window-close"
|
||||||
enabled: compositorRoot.currentWindow
|
enabled: compositorRoot.currentWindow
|
||||||
opacity: enabled ? 1 : 0.6
|
opacity: enabled ? 1 : 0.2
|
||||||
|
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
Layout.preferredWidth: units.iconSizes.medium
|
Layout.preferredWidth: units.iconSizes.medium
|
||||||
|
|
|
||||||
2
containments/CMakeLists.txt
Normal file
2
containments/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
|
||||||
|
plasma_install_package(homescreen org.kde.phone.homescreen)
|
||||||
260
containments/homescreen/contents/images/homescreenicons.svg
Normal file
260
containments/homescreen/contents/images/homescreenicons.svg
Normal file
|
|
@ -0,0 +1,260 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
|
<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:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
width="972.16351"
|
||||||
|
height="203.95906"
|
||||||
|
id="svg4025"
|
||||||
|
version="1.1"
|
||||||
|
inkscape:version="0.48.4 r9939"
|
||||||
|
sodipodi:docname="New document 4">
|
||||||
|
<defs
|
||||||
|
id="defs4027" />
|
||||||
|
<sodipodi:namedview
|
||||||
|
id="base"
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1.0"
|
||||||
|
inkscape:pageopacity="0.0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:zoom="1.4"
|
||||||
|
inkscape:cx="423.57766"
|
||||||
|
inkscape:cy="19.47953"
|
||||||
|
inkscape:document-units="px"
|
||||||
|
inkscape:current-layer="layer1"
|
||||||
|
showgrid="false"
|
||||||
|
inkscape:window-width="3200"
|
||||||
|
inkscape:window-height="1768"
|
||||||
|
inkscape:window-x="0"
|
||||||
|
inkscape:window-y="-3"
|
||||||
|
inkscape:window-maximized="1"
|
||||||
|
fit-margin-top="0"
|
||||||
|
fit-margin-left="0"
|
||||||
|
fit-margin-right="0"
|
||||||
|
fit-margin-bottom="0" />
|
||||||
|
<metadata
|
||||||
|
id="metadata4030">
|
||||||
|
<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></dc:title>
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<g
|
||||||
|
inkscape:label="Layer 1"
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
id="layer1"
|
||||||
|
transform="translate(-259.63254,-347.88266)">
|
||||||
|
<g
|
||||||
|
transform="translate(207.79603,359.47951)"
|
||||||
|
id="email"
|
||||||
|
inkscape:label="#g3960">
|
||||||
|
<path
|
||||||
|
transform="matrix(2.6315789,0,0,2.6315789,1578.5263,1202.8885)"
|
||||||
|
d="m -308,-422 c 0,20.98682 -17.01318,38 -38,38 -20.98682,0 -38,-17.01318 -38,-38 0,-20.98682 17.01318,-38 38,-38 20.98682,0 38,17.01318 38,38 z"
|
||||||
|
sodipodi:ry="38"
|
||||||
|
sodipodi:rx="38"
|
||||||
|
sodipodi:cy="-422"
|
||||||
|
sodipodi:cx="-346"
|
||||||
|
id="path5038-4"
|
||||||
|
style="opacity:0.8;fill:#000000;fill-opacity:1;stroke:none"
|
||||||
|
sodipodi:type="arc" />
|
||||||
|
<g
|
||||||
|
id="g3953">
|
||||||
|
<g
|
||||||
|
id="layer1-8"
|
||||||
|
transform="matrix(3.0415044,0,0,3.0415044,593.47877,17.283066)"
|
||||||
|
style="fill:#f2d842;fill-opacity:1">
|
||||||
|
<path
|
||||||
|
d="M 0,0 0,30 13.334,15.0012 z"
|
||||||
|
transform="translate(5,9)"
|
||||||
|
id="path4127"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
style="fill:#f2d842;fill-opacity:1;fill-rule:evenodd" />
|
||||||
|
<path
|
||||||
|
d="M 0,0 17.6439,17 19,18.3 20.3561,17 38,0 z"
|
||||||
|
transform="translate(5,9)"
|
||||||
|
id="path4125"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
style="fill:#f2d842;fill-opacity:1;fill-rule:evenodd" />
|
||||||
|
<path
|
||||||
|
d="M 13.334,0 0,15.0012 13.334,30 z"
|
||||||
|
transform="translate(29.666,9)"
|
||||||
|
id="path4123"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
style="fill:#f2d842;fill-opacity:1;fill-rule:evenodd" />
|
||||||
|
<path
|
||||||
|
d="M 15.2227,0 0,12.6309 l 37.5547,0 L 22.332,0 18.7773,3.36719 z"
|
||||||
|
transform="translate(5.22266,26.3691)"
|
||||||
|
id="rect3260"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
style="fill:#f2d842;fill-opacity:1;fill-rule:evenodd" />
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
transform="translate(919.2246,317.33665)"
|
||||||
|
id="phone"
|
||||||
|
inkscape:label="#g3944">
|
||||||
|
<path
|
||||||
|
transform="matrix(2.6315789,0,0,2.6315789,350.93424,1241.0723)"
|
||||||
|
d="m -308,-422 c 0,20.98682 -17.01318,38 -38,38 -20.98682,0 -38,-17.01318 -38,-38 0,-20.98682 17.01318,-38 38,-38 20.98682,0 38,17.01318 38,38 z"
|
||||||
|
sodipodi:ry="38"
|
||||||
|
sodipodi:rx="38"
|
||||||
|
sodipodi:cy="-422"
|
||||||
|
sodipodi:cx="-346"
|
||||||
|
id="path5038"
|
||||||
|
style="opacity:0.8;fill:#000000;fill-opacity:1;stroke:none"
|
||||||
|
sodipodi:type="arc" />
|
||||||
|
<path
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path4128-0-9"
|
||||||
|
d="m -583.50447,76.46575 c -1.86372,-0.0072 -27.21217,10.305195 -28.75978,11.703933 -1.84203,1.665344 0.23482,13.309167 4.59876,25.744457 9.88137,28.17454 35.33169,53.80871 63.99465,64.45741 8.30341,3.08482 24.41316,6.96228 26.66305,6.41896 0.66145,-0.16041 3.89288,-6.89324 7.18318,-14.96835 l 0,0 c 3.29029,-8.07514 5.98019,-14.84698 5.98019,-15.05083 0,-0.20303 -7.38909,-4.03543 -16.42151,-8.51508 l -16.42115,-8.14392 -7.88437,7.73158 -7.87713,7.72473 -4.95604,-3.40189 c -5.58462,-3.83035 -18.54569,-16.86252 -22.01662,-22.1433 l -2.28202,-3.4775 7.7879,-7.78658 7.78791,-7.7797 -8.22791,-16.25353 c -4.52616,-8.939403 -8.64517,-16.257572 -9.15599,-16.26039 z"
|
||||||
|
style="fill:#f2d842;fill-opacity:1"
|
||||||
|
sodipodi:nodetypes="cccscccscccccccccccc" />
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
transform="translate(207.79603,359.47951)"
|
||||||
|
id="web"
|
||||||
|
inkscape:label="#g3969">
|
||||||
|
<path
|
||||||
|
transform="matrix(2.6315789,0,0,2.6315789,1834.5263,1202.8885)"
|
||||||
|
d="m -308,-422 c 0,20.98682 -17.01318,38 -38,38 -20.98682,0 -38,-17.01318 -38,-38 0,-20.98682 17.01318,-38 38,-38 20.98682,0 38,17.01318 38,38 z"
|
||||||
|
sodipodi:ry="38"
|
||||||
|
sodipodi:rx="38"
|
||||||
|
sodipodi:cy="-422"
|
||||||
|
sodipodi:cx="-346"
|
||||||
|
id="path5038-8"
|
||||||
|
style="opacity:0.8;fill:#000000;fill-opacity:1;stroke:none"
|
||||||
|
sodipodi:type="arc" />
|
||||||
|
<g
|
||||||
|
transform="matrix(8.6577389,0,0,8.6577389,6742.4809,7725.3521)"
|
||||||
|
id="g5084">
|
||||||
|
<rect
|
||||||
|
style="fill:none;stroke:none"
|
||||||
|
id="rect3260-3"
|
||||||
|
width="15"
|
||||||
|
height="15"
|
||||||
|
x="-679.5"
|
||||||
|
y="-889.13782" />
|
||||||
|
<rect
|
||||||
|
ry="2"
|
||||||
|
y="-878.13782"
|
||||||
|
x="-674"
|
||||||
|
height="4"
|
||||||
|
width="4"
|
||||||
|
id="rect3292"
|
||||||
|
style="fill:none;stroke:none" />
|
||||||
|
<path
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
style="fill:#f2d842;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||||
|
d="m -672,-889.1378 c -4.155,0 -7.5,3.345 -7.5,7.5 0,4.155 3.345,7.5 7.5,7.5 4.155,0 7.5,-3.345 7.5,-7.5 0,-4.155 -3.345,-7.5 -7.5,-7.5 z m 0,2 c 3.047,0 5.5,2.453 5.5,5.5 0,3.047 -2.453,5.5 -5.5,5.5 -3.047,0 -5.5,-2.453 -5.5,-5.5 0,-3.047 2.453,-5.5 5.5,-5.5 z"
|
||||||
|
id="rect3272" />
|
||||||
|
<rect
|
||||||
|
style="fill:#f2d842;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||||
|
id="rect3279"
|
||||||
|
width="12"
|
||||||
|
height="1"
|
||||||
|
x="-678"
|
||||||
|
y="-882.13782"
|
||||||
|
ry="0" />
|
||||||
|
<rect
|
||||||
|
ry="0"
|
||||||
|
y="-672.5"
|
||||||
|
x="875.63782"
|
||||||
|
height="1"
|
||||||
|
width="12"
|
||||||
|
id="rect3281"
|
||||||
|
style="fill:#f2d842;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||||
|
transform="matrix(0,-1,1,0,0,0)" />
|
||||||
|
<rect
|
||||||
|
ry="1"
|
||||||
|
y="-876.13782"
|
||||||
|
x="-673"
|
||||||
|
height="2"
|
||||||
|
width="2"
|
||||||
|
id="rect3274"
|
||||||
|
style="fill:none;stroke:none" />
|
||||||
|
<rect
|
||||||
|
style="fill:none;stroke:none"
|
||||||
|
id="rect3283"
|
||||||
|
width="0.99999976"
|
||||||
|
height="0.99999976"
|
||||||
|
x="-672.5"
|
||||||
|
y="-875.13806"
|
||||||
|
ry="0.49999988" />
|
||||||
|
<rect
|
||||||
|
ry="2"
|
||||||
|
y="-883.63782"
|
||||||
|
x="-679.5"
|
||||||
|
height="4"
|
||||||
|
width="4"
|
||||||
|
id="rect3296"
|
||||||
|
style="fill:none;stroke:none" />
|
||||||
|
<rect
|
||||||
|
style="fill:none;stroke:none"
|
||||||
|
id="rect3300"
|
||||||
|
width="4"
|
||||||
|
height="4"
|
||||||
|
x="-668.5"
|
||||||
|
y="-883.63782"
|
||||||
|
ry="2" />
|
||||||
|
<path
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
style="fill:#f2d842;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||||
|
d="m -675.39648,-885.964 c 1.02033,0.5192 2.1688,0.8262 3.39648,0.8262 1.22768,0 2.37615,-0.307 3.39648,-0.8262 -0.31154,-0.2446 -0.65081,-0.4535 -1.01171,-0.6269 -0.73773,0.2908 -1.54073,0.4531 -2.38477,0.4531 -0.84404,0 -1.64704,-0.1623 -2.38477,-0.4531 -0.3609,0.1734 -0.70017,0.3823 -1.01171,0.6269 z"
|
||||||
|
id="path3330" />
|
||||||
|
<rect
|
||||||
|
style="fill:none;stroke:none"
|
||||||
|
id="rect3290"
|
||||||
|
width="4"
|
||||||
|
height="4"
|
||||||
|
x="-674"
|
||||||
|
y="-889.13782"
|
||||||
|
ry="2" />
|
||||||
|
<path
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
style="fill:#f2d842;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||||
|
d="m -675.3965,-877.3116 c 1.0203,-0.5192 2.1688,-0.8262 3.3965,-0.8262 1.2277,0 2.3762,0.307 3.3965,0.8262 -0.3116,0.2446 -0.6508,0.4535 -1.0117,0.6269 -0.7378,-0.2908 -1.5408,-0.4531 -2.3848,-0.4531 -0.844,0 -1.647,0.1623 -2.3848,0.4531 -0.3609,-0.1734 -0.7001,-0.3823 -1.0117,-0.6269 z"
|
||||||
|
id="path3336" />
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
transform="translate(207.79603,359.47951)"
|
||||||
|
id="messaging"
|
||||||
|
inkscape:label="#g3948">
|
||||||
|
<path
|
||||||
|
transform="matrix(2.6315789,0,0,2.6315789,1322.5263,1202.8885)"
|
||||||
|
d="m -308,-422 c 0,20.98682 -17.01318,38 -38,38 -20.98682,0 -38,-17.01318 -38,-38 0,-20.98682 17.01318,-38 38,-38 20.98682,0 38,17.01318 38,38 z"
|
||||||
|
sodipodi:ry="38"
|
||||||
|
sodipodi:rx="38"
|
||||||
|
sodipodi:cy="-422"
|
||||||
|
sodipodi:cx="-346"
|
||||||
|
id="path5038-9"
|
||||||
|
style="opacity:0.8;fill:#000000;fill-opacity:1;stroke:none"
|
||||||
|
sodipodi:type="arc" />
|
||||||
|
<g
|
||||||
|
style="fill:#f2d842;fill-opacity:1;stroke:none"
|
||||||
|
inkscape:label="Capa 1"
|
||||||
|
id="layer1-70"
|
||||||
|
transform="matrix(6.5577152,0,0,6.5577152,340.06797,-6731.8963)">
|
||||||
|
<path
|
||||||
|
style="fill:#f2d842;fill-opacity:1;stroke:none"
|
||||||
|
d="m 11,1033.3622 c -4.4181661,0 -8.0000011,2.6867 -8.0000001,6.0003 0,3.2629 3.475447,5.9116 7.8001261,5.9921 l 0,4.0076 C 19.016547,1044.6185 19,1041.6283 19,1039.3625 c 0,-3.3136 -3.581835,-6.0003 -8,-6.0003 z m -3.7407741,3.0651 3.0823081,0 0,3.0833 -0.01015,0 c 0.0065,0.073 0.01015,0.1459 0.01015,0.2202 0,1.2634 -0.9671911,2.2993 -2.2016481,2.4106 l 0,-0.8918 c 0.745998,-0.1077 1.320989,-0.743 1.320989,-1.5188 0,-0.075 -0.0088,-0.148 -0.01928,-0.2202 l -2.182372,0 0,-3.0833 z m 4.3992391,0 3.082308,0 0,3.0833 -0.01014,0 c 0.0065,0.073 0.01014,0.1459 0.01014,0.2202 0,1.2634 -0.967191,2.2993 -2.201648,2.4106 l 0,-0.8918 c 0.745998,-0.1077 1.320989,-0.743 1.320989,-1.5188 0,-0.075 -0.0088,-0.148 -0.01928,-0.2202 l -2.182372,0 0,-3.0833 z"
|
||||||
|
id="path4084-3"
|
||||||
|
inkscape:connector-curvature="0" />
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 10 KiB |
42
containments/homescreen/contents/ui/HomeLauncher.qml
Normal file
42
containments/homescreen/contents/ui/HomeLauncher.qml
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
import QtQuick 2.0
|
||||||
|
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||||
|
import org.kde.kio 1.0 as Kio
|
||||||
|
import org.kde.plasma.components 2.0 as PlasmaComponents
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
id: root
|
||||||
|
width: applicationsView.cellWidth
|
||||||
|
height: width
|
||||||
|
onClicked: {
|
||||||
|
console.log("Clicked: " + model.ApplicationStorageIdRole)
|
||||||
|
appListModel.runApplication(model.ApplicationStorageIdRole)
|
||||||
|
}
|
||||||
|
|
||||||
|
PlasmaCore.IconItem {
|
||||||
|
id: icon
|
||||||
|
anchors.centerIn: parent
|
||||||
|
width: parent.height / 2
|
||||||
|
height: width
|
||||||
|
source: model.ApplicationIconRole
|
||||||
|
}
|
||||||
|
|
||||||
|
PlasmaComponents.Label {
|
||||||
|
id: label
|
||||||
|
visible: text.length > 0
|
||||||
|
|
||||||
|
anchors {
|
||||||
|
top: icon.bottom
|
||||||
|
left: icon.left
|
||||||
|
right: icon.right
|
||||||
|
}
|
||||||
|
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
horizontalAlignment: Qt.AlignHCenter
|
||||||
|
verticalAlignment: Qt.AlignVCenter
|
||||||
|
maximumLineCount: 2
|
||||||
|
|
||||||
|
text: model.ApplicationNameRole
|
||||||
|
font.pixelSize: theme.smallestFont.pixelSize
|
||||||
|
color: PlasmaCore.ColorScope.textColor
|
||||||
|
}
|
||||||
|
}
|
||||||
33
containments/homescreen/contents/ui/HomeLauncherSvg.qml
Normal file
33
containments/homescreen/contents/ui/HomeLauncherSvg.qml
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
import QtQuick 2.0
|
||||||
|
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: root
|
||||||
|
width: parent.width / parent.columns
|
||||||
|
height: parent.buttonHeight
|
||||||
|
property var callback
|
||||||
|
property string text
|
||||||
|
property string sub
|
||||||
|
property alias svg: icon.svg
|
||||||
|
property alias elementId: icon.elementId
|
||||||
|
|
||||||
|
PlasmaCore.SvgItem{
|
||||||
|
id: icon
|
||||||
|
width: units.iconSizes.medium
|
||||||
|
height: width
|
||||||
|
anchors.centerIn: parent
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
propagateComposedEvents: true
|
||||||
|
|
||||||
|
onClicked: {
|
||||||
|
if (callback) {
|
||||||
|
callback();
|
||||||
|
} else {
|
||||||
|
addNumber(parent.text);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
21
containments/homescreen/contents/ui/SatelliteStripe.qml
Normal file
21
containments/homescreen/contents/ui/SatelliteStripe.qml
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
import QtQuick 2.0
|
||||||
|
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||||
|
|
||||||
|
Item {
|
||||||
|
PlasmaCore.FrameSvgItem {
|
||||||
|
z: -1
|
||||||
|
imagePath: "widgets/background"
|
||||||
|
enabledBorders: PlasmaCore.FrameSvgItem.TopBorder | PlasmaCore.FrameSvgItem.BottomBorder
|
||||||
|
anchors {
|
||||||
|
fill: parent
|
||||||
|
topMargin: -margins.top
|
||||||
|
bottomMargin: -margins.bottom
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
opacity: 0.6
|
||||||
|
height: Math.max(100, units.gridUnit * 2.5)
|
||||||
|
width: parent.width
|
||||||
|
y: parent.height / 2 - height / 2
|
||||||
|
x: 0
|
||||||
|
}
|
||||||
166
containments/homescreen/contents/ui/main.qml
Normal file
166
containments/homescreen/contents/ui/main.qml
Normal file
|
|
@ -0,0 +1,166 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2015 Marco Martin <mart@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, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import QtQuick 2.1
|
||||||
|
import QtQuick.Layouts 1.1
|
||||||
|
|
||||||
|
import org.kde.plasma.plasmoid 2.0
|
||||||
|
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||||
|
import org.kde.plasma.components 2.0 as PlasmaComponents
|
||||||
|
|
||||||
|
import org.kde.satellite.components 0.1 as SatelliteComponents
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: root
|
||||||
|
width: 480
|
||||||
|
height: 640
|
||||||
|
|
||||||
|
property Item toolBox
|
||||||
|
property alias appletsSpace: applicationsView.headerItem
|
||||||
|
property int buttonHeight: width/4
|
||||||
|
|
||||||
|
Containment.onAppletAdded: {
|
||||||
|
var container = appletContainerComponent.createObject(appletsSpace.layout)
|
||||||
|
container.visible = true
|
||||||
|
print("Applet added: " + applet)
|
||||||
|
applet.parent = container
|
||||||
|
container.applet = applet
|
||||||
|
applet.anchors.fill = applet.parent
|
||||||
|
applet.visible = true
|
||||||
|
container.width = 500
|
||||||
|
container.height = 500
|
||||||
|
}
|
||||||
|
|
||||||
|
Component {
|
||||||
|
id: appletContainerComponent
|
||||||
|
Item {
|
||||||
|
property Item applet
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.fillHeight: applet && applet.Layout.fillHeight
|
||||||
|
Layout.onFillHeightChanged: {
|
||||||
|
if (plasmoid.formFactor == PlasmaCore.Types.Vertical) {
|
||||||
|
checkLastSpacer();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Layout.minimumWidth: root.width
|
||||||
|
Layout.minimumHeight: appletsSpace.layout.children.count > 1 ? Math.max(applet.Layout.minimumHeight, root.height / 2) : root.height
|
||||||
|
|
||||||
|
Layout.preferredWidth: root.width
|
||||||
|
Layout.preferredHeight: Layout.minimumHeight
|
||||||
|
|
||||||
|
Layout.maximumWidth: root.width
|
||||||
|
Layout.maximumHeight: Layout.minimumHeight
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
color: Qt.rgba(0, 0, 0, 0.9 * (Math.min(applicationsView.contentY + root.height, root.height) / root.height))
|
||||||
|
anchors.fill: parent
|
||||||
|
}
|
||||||
|
|
||||||
|
PlasmaCore.ColorScope {
|
||||||
|
anchors.fill: parent
|
||||||
|
colorGroup: PlasmaCore.Theme.ComplementaryColorGroup
|
||||||
|
GridView {
|
||||||
|
id: applicationsView
|
||||||
|
anchors {
|
||||||
|
top: parent.top
|
||||||
|
bottom: parent.bottom
|
||||||
|
left: parent.left
|
||||||
|
right: parent.right
|
||||||
|
}
|
||||||
|
|
||||||
|
cellWidth: root.buttonHeight
|
||||||
|
cellHeight: cellWidth
|
||||||
|
model: SatelliteComponents.ApplicationListModel {
|
||||||
|
id: appListModel
|
||||||
|
}
|
||||||
|
snapMode: GridView.SnapToRow
|
||||||
|
//clip: true
|
||||||
|
delegate: HomeLauncher {}
|
||||||
|
header: MouseArea {
|
||||||
|
z: 999
|
||||||
|
property Item layout: mainLayout
|
||||||
|
width: root.width
|
||||||
|
height: Math.max(root.height, (root.height/2) * mainLayout.children.length)
|
||||||
|
|
||||||
|
onPressAndHold: {
|
||||||
|
plasmoid.action("configure").trigger();
|
||||||
|
}
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
id: mainLayout
|
||||||
|
anchors.fill: parent
|
||||||
|
}
|
||||||
|
SatelliteStripe {
|
||||||
|
id: stripe
|
||||||
|
z: 99
|
||||||
|
y: Math.max(applicationsView.contentY + parent.height, parent.height - height)
|
||||||
|
|
||||||
|
PlasmaCore.Svg {
|
||||||
|
id: stripeIcons
|
||||||
|
imagePath: Qt.resolvedUrl("../images/homescreenicons.svg")
|
||||||
|
}
|
||||||
|
|
||||||
|
Row {
|
||||||
|
anchors.fill: parent
|
||||||
|
property int columns: 4
|
||||||
|
property alias buttonHeight: stripe.height
|
||||||
|
|
||||||
|
HomeLauncherSvg {
|
||||||
|
id: phoneIcon
|
||||||
|
svg: stripeIcons
|
||||||
|
elementId: "phone"
|
||||||
|
callback: function() {
|
||||||
|
console.log("Start phone")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
HomeLauncherSvg {
|
||||||
|
id: messagingIcon
|
||||||
|
svg: stripeIcons
|
||||||
|
elementId: "messaging"
|
||||||
|
callback: function() { console.log("Start messaging") }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
HomeLauncherSvg {
|
||||||
|
id: emailIcon
|
||||||
|
svg: stripeIcons
|
||||||
|
elementId: "email"
|
||||||
|
callback: function() { console.log("Start email") }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
HomeLauncherSvg {
|
||||||
|
id: webIcon
|
||||||
|
svg: stripeIcons
|
||||||
|
elementId: "web"
|
||||||
|
callback: function() { console.log("Start web") }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
print("root Containment loaded")
|
||||||
|
}
|
||||||
|
}
|
||||||
17
containments/homescreen/metadata.desktop
Normal file
17
containments/homescreen/metadata.desktop
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
[Desktop Entry]
|
||||||
|
Encoding=UTF-8
|
||||||
|
Keywords=
|
||||||
|
Name=Phone Homescreen
|
||||||
|
Type=Service
|
||||||
|
|
||||||
|
X-KDE-ServiceTypes=Plasma/Applet,Plasma/Containment
|
||||||
|
X-Plasma-API=declarativeappletscript
|
||||||
|
X-KDE-ParentApp=
|
||||||
|
X-KDE-PluginInfo-Author=Marco Martin
|
||||||
|
X-KDE-PluginInfo-Category=
|
||||||
|
X-KDE-PluginInfo-Email=mart@kde.org
|
||||||
|
X-KDE-PluginInfo-License=GPLv2+
|
||||||
|
X-KDE-PluginInfo-Name=org.kde.phone.homescreen
|
||||||
|
X-KDE-PluginInfo-Version=
|
||||||
|
X-KDE-PluginInfo-Website=
|
||||||
|
X-Plasma-MainScript=ui/main.qml
|
||||||
|
|
@ -21,8 +21,7 @@ Item {
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
propagateComposedEvents: true
|
propagateComposedEvents: true
|
||||||
drag.target: stripe
|
|
||||||
drag.axis: Drag.YAxis
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (callback) {
|
if (callback) {
|
||||||
callback();
|
callback();
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,16 @@
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||||
|
|
||||||
Rectangle {
|
Item {
|
||||||
gradient: Gradient {
|
PlasmaCore.FrameSvgItem {
|
||||||
GradientStop { position: 0.0; color: "#FFEDDF00" }
|
z: -1
|
||||||
GradientStop { position: 3.0; color: "#00EDDF00" }
|
imagePath: "widgets/background"
|
||||||
|
enabledBorders: PlasmaCore.FrameSvgItem.TopBorder | PlasmaCore.FrameSvgItem.BottomBorder
|
||||||
|
anchors {
|
||||||
|
fill: parent
|
||||||
|
topMargin: -margins.top
|
||||||
|
bottomMargin: -margins.bottom
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
opacity: 0.6
|
opacity: 0.6
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ import org.kde.kquickcontrolsaddons 2.0
|
||||||
import MeeGo.QOfono 0.2
|
import MeeGo.QOfono 0.2
|
||||||
import "../components"
|
import "../components"
|
||||||
|
|
||||||
MouseEventListener {
|
Item {
|
||||||
id: homescreen
|
id: homescreen
|
||||||
width: 1080
|
width: 1080
|
||||||
height: 1920
|
height: 1920
|
||||||
|
|
@ -39,6 +39,7 @@ MouseEventListener {
|
||||||
property Item wallpaper;
|
property Item wallpaper;
|
||||||
property var pendingRemovals: [];
|
property var pendingRemovals: [];
|
||||||
property int notificationId: 0;
|
property int notificationId: 0;
|
||||||
|
property int buttonHeight: width/4
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Notificadtion data object has the following properties:
|
Notificadtion data object has the following properties:
|
||||||
|
|
@ -88,10 +89,6 @@ MouseEventListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onPressAndHold: {
|
|
||||||
containment.action("configure").trigger();
|
|
||||||
}
|
|
||||||
|
|
||||||
OfonoManager {
|
OfonoManager {
|
||||||
id: ofonoManager
|
id: ofonoManager
|
||||||
onAvailableChanged: {
|
onAvailableChanged: {
|
||||||
|
|
@ -210,6 +207,18 @@ MouseEventListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
z: 1
|
||||||
|
color: Qt.rgba(0, 0, 0, 0.9 * (Math.min(applications.contentY + homescreen.height, homescreen.height) / homescreen.height))
|
||||||
|
anchors.fill: parent
|
||||||
|
}
|
||||||
|
|
||||||
|
PlasmaCore.DataSource {
|
||||||
|
id: timeSource
|
||||||
|
engine: "time"
|
||||||
|
connectedSources: ["Local"]
|
||||||
|
interval: 60 * 1000
|
||||||
|
}
|
||||||
PlasmaCore.DataSource {
|
PlasmaCore.DataSource {
|
||||||
id: notificationsSource
|
id: notificationsSource
|
||||||
|
|
||||||
|
|
@ -303,19 +312,12 @@ MouseEventListener {
|
||||||
right: parent.right
|
right: parent.right
|
||||||
}
|
}
|
||||||
height: units.iconSizes.small
|
height: units.iconSizes.small
|
||||||
z: 1
|
z: 2
|
||||||
colorGroup: PlasmaCore.Theme.ComplementaryColorGroup
|
colorGroup: PlasmaCore.Theme.ComplementaryColorGroup
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color: Qt.rgba(0, 0, 0, 0.7)
|
color: Qt.rgba(0, 0, 0, 0.9)
|
||||||
|
|
||||||
PlasmaCore.DataSource {
|
|
||||||
id: timeSource
|
|
||||||
engine: "time"
|
|
||||||
connectedSources: ["Local"]
|
|
||||||
interval: 500
|
|
||||||
}
|
|
||||||
|
|
||||||
PlasmaCore.IconItem {
|
PlasmaCore.IconItem {
|
||||||
id: strengthIcon
|
id: strengthIcon
|
||||||
|
|
@ -396,32 +398,74 @@ MouseEventListener {
|
||||||
height: homescreen.height
|
height: homescreen.height
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
PlasmaCore.ColorScope {
|
PlasmaCore.ColorScope {
|
||||||
z: 1
|
z: 1
|
||||||
anchors {
|
anchors {
|
||||||
top: statusPanel.bottom
|
fill: parent
|
||||||
|
}
|
||||||
|
|
||||||
|
colorGroup: PlasmaCore.Theme.ComplementaryColorGroup
|
||||||
|
|
||||||
|
SatelliteComponents.ApplicationListModel {
|
||||||
|
id: appListModel
|
||||||
|
}
|
||||||
|
|
||||||
|
GridView {
|
||||||
|
id: applications
|
||||||
|
anchors {
|
||||||
|
top: parent.top
|
||||||
bottom: parent.bottom
|
bottom: parent.bottom
|
||||||
left: parent.left
|
left: parent.left
|
||||||
right: parent.right
|
right: parent.right
|
||||||
}
|
}
|
||||||
|
z: 1
|
||||||
|
cellWidth: homescreen.buttonHeight
|
||||||
|
cellHeight: cellWidth
|
||||||
|
model: appListModel
|
||||||
|
snapMode: GridView.SnapToRow
|
||||||
|
clip: true
|
||||||
|
header: MouseArea {
|
||||||
|
z: 999
|
||||||
|
width: homescreen.width
|
||||||
|
height: homescreen.height - units.iconSizes.medium
|
||||||
|
|
||||||
colorGroup: PlasmaCore.Theme.ComplementaryColorGroup
|
onPressAndHold: {
|
||||||
|
containment.action("configure").trigger();
|
||||||
|
}
|
||||||
|
|
||||||
|
PlasmaComponents.Label {
|
||||||
|
id: bigClock
|
||||||
|
anchors {
|
||||||
|
horizontalCenter: parent.horizontalCenter
|
||||||
|
top: parent.top
|
||||||
|
bottom: notificationView.top
|
||||||
|
}
|
||||||
|
text: Qt.formatTime(timeSource.data.Local.DateTime, "hh:mm")
|
||||||
|
color: PlasmaCore.ColorScope.textColor
|
||||||
|
horizontalAlignment: Qt.AlignHCenter
|
||||||
|
verticalAlignment: Qt.AlignVCenter
|
||||||
|
font.pointSize: 40
|
||||||
|
style: Text.Raised
|
||||||
|
styleColor: "black"
|
||||||
|
}
|
||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
id: notificationView
|
id: notificationView
|
||||||
spacing: units.smallSpacing
|
spacing: units.smallSpacing
|
||||||
anchors {
|
anchors {
|
||||||
top: parent.top
|
bottom: parent.bottom
|
||||||
bottom: stripe.top
|
|
||||||
left: parent.left
|
left: parent.left
|
||||||
right: parent.right
|
right: parent.right
|
||||||
bottomMargin: units.smallSpacing
|
bottomMargin: stripe.height * 2
|
||||||
}
|
}
|
||||||
|
height: parent.height / 3
|
||||||
|
interactive: false
|
||||||
|
|
||||||
z: 1
|
z: 1
|
||||||
clip: true
|
|
||||||
verticalLayoutDirection: ListView.BottomToTop
|
verticalLayoutDirection: ListView.BottomToTop
|
||||||
model: notificationsModel
|
model: notificationsModel
|
||||||
|
|
||||||
add: Transition {
|
add: Transition {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
properties: "x"
|
properties: "x"
|
||||||
|
|
@ -451,11 +495,12 @@ MouseEventListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
delegate: NotificationStripe {}
|
delegate: NotificationStripe {}
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
SatelliteStripe {
|
SatelliteStripe {
|
||||||
id: stripe
|
id: stripe
|
||||||
z: 1
|
z: 99
|
||||||
|
y: Math.max(applications.contentY + parent.height, parent.height - height)
|
||||||
|
|
||||||
PlasmaCore.Svg {
|
PlasmaCore.Svg {
|
||||||
id: stripeIcons
|
id: stripeIcons
|
||||||
|
|
@ -500,28 +545,11 @@ MouseEventListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SatelliteComponents.ApplicationListModel {
|
|
||||||
id: appListModel
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GridView {
|
|
||||||
id: applications
|
|
||||||
anchors {
|
|
||||||
top: stripe.bottom
|
|
||||||
bottom: parent.bottom
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
topMargin: units.smallSpacing
|
|
||||||
}
|
|
||||||
z: 1
|
|
||||||
cellWidth: stripe.height * 2
|
|
||||||
cellHeight: cellWidth
|
|
||||||
model: appListModel
|
|
||||||
snapMode: GridView.SnapToRow
|
|
||||||
clip: true
|
|
||||||
delegate: HomeLauncher {}
|
delegate: HomeLauncher {}
|
||||||
Component.onCompleted : { console.log("WTF " + width) }
|
Component.onCompleted : { console.log("WTF " + width) }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue