Commit 1d29f087 authored by Marco Martin's avatar Marco Martin

Merge branch 'mart/homeScreenSingleScroll'

parents f5f1dedd 897f109c
......@@ -48,3 +48,4 @@ add_subdirectory(bin)
add_subdirectory(qmlcomponents)
add_subdirectory(services)
add_subdirectory(settingsmodules)
add_subdirectory(containments)
......@@ -154,8 +154,8 @@ Rectangle {
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
height: compositorRoot.state == "homeScreen" ? 0 : bottomBarHeight
color: Qt.rgba(0, 0, 0, 0.9 + 0.1*windowsZoom.scale)
height: bottomBarHeight
color: Qt.rgba(0, 0, 0, 0.9)
Behavior on height {
NumberAnimation {
......@@ -167,11 +167,32 @@ Rectangle {
RowLayout {
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 {
colorGroup: PlasmaCore.Theme.ComplementaryColorGroup
width: units.iconSizes.smallMedium
height: width
source: "go-home"
enabled: compositorRoot.state != "homeScreen";
opacity: enabled ? 1 : 0.2
Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: units.iconSizes.medium
......@@ -190,7 +211,7 @@ Rectangle {
height: width
source: "window-close"
enabled: compositorRoot.currentWindow
opacity: enabled ? 1 : 0.6
opacity: enabled ? 1 : 0.2
Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: units.iconSizes.medium
......
plasma_install_package(homescreen org.kde.phone.homescreen)
This diff is collapsed.
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
}
}
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);
}
}
}
}
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
}
/*
* 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")
}
}
\ No newline at end of file
[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 {
anchors.fill: parent
propagateComposedEvents: true
drag.target: stripe
drag.axis: Drag.YAxis
onClicked: {
if (callback) {
callback();
......
import QtQuick 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
Rectangle {
gradient: Gradient {
GradientStop { position: 0.0; color: "#FFEDDF00" }
GradientStop { position: 3.0; color: "#00EDDF00" }
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
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment