port to new api

This commit is contained in:
Marco Martin 2014-02-04 17:29:28 +01:00
parent 9275e84a99
commit 308f59bc68
13 changed files with 59 additions and 52 deletions

View File

@ -19,13 +19,14 @@
*/ */
import QtQuick 2.0 import QtQuick 2.0
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents import org.kde.plasma.components 2.0 as PlasmaComponents
Item { Item {
property int minimumWidth: 200 Layout.minimumWidth: 200
property int minimumHeight: 300 Layout.minimumHeight: 300
property Component compactRepresentation: Component { Plasmoid.compactRepresentation: Component {
PlasmaComponents.Button { PlasmaComponents.Button {
text: i18n("Click me") text: i18n("Click me")
onClicked: plasmoid.expanded = !plasmoid.expanded onClicked: plasmoid.expanded = !plasmoid.expanded

View File

@ -17,6 +17,7 @@
*/ */
import QtQuick 2.0 import QtQuick 2.0
import org.kde.plasma.plasmoid 2.0
import QtQuick.Layouts 1.0 import QtQuick.Layouts 1.0
import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.core 2.0 as PlasmaCore
@ -30,10 +31,10 @@ Rectangle {
height: 100 height: 100
radius: 10 radius: 10
smooth: true smooth: true
property int minimumWidth: units.gridUnit * 20 Layout.minimumWidth: units.gridUnit * 20
property int minimumHeight: column.implicitHeight Layout.minimumHeight: column.implicitHeight
property Component compactRepresentation: Component { Plasmoid.compactRepresentation: Component {
Rectangle { Rectangle {
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent

View File

@ -26,8 +26,8 @@ Item {
id: root id: root
width: 100 width: 100
height: 100 height: 100
property int minimumWidth: units.gridUnit * 20 Layout.minimumWidth: units.gridUnit * 20
property int minimumHeight: column.implicitHeight Layout.minimumHeight: column.implicitHeight
ColumnLayout { ColumnLayout {

View File

@ -19,6 +19,7 @@
*/ */
import QtQuick 2.0 import QtQuick 2.0
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.extras 2.0 as PlasmaExtras import org.kde.plasma.extras 2.0 as PlasmaExtras
@ -26,8 +27,8 @@ import org.kde.plasma.extras 2.0 as PlasmaExtras
Column { Column {
width: 500 width: 500
height: 500 height: 500
property int minimumWidth: 200 Layout.minimumWidth: 200
property int minimumHeight: 300 Layout.minimumHeight: 300
PlasmaCore.DataSource { PlasmaCore.DataSource {
id: source id: source

View File

@ -19,12 +19,13 @@
*/ */
import QtQuick 2.0 import QtQuick 2.0
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents import org.kde.plasma.components 2.0 as PlasmaComponents
Item { Item {
property int minimumWidth: 200 Layout.minimumWidth: 200
property int minimumHeight: 300 Layout.minimumHeight: 300
PlasmaComponents.Label { PlasmaComponents.Label {
text: i18n("Hello world") text: i18n("Hello world")

View File

@ -18,12 +18,13 @@
*/ */
import QtQuick 2.0 import QtQuick 2.0
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents import org.kde.plasma.components 2.0 as PlasmaComponents
PlasmaCore.SvgItem { PlasmaCore.SvgItem {
property int minimumWidth: 150 Layout.minimumWidth: 150
property int minimumHeight: 150 Layout.minimumHeight: 150
svg: PlasmaCore.Svg("widgets/notes") svg: PlasmaCore.Svg("widgets/notes")
elementId: "yellow-notes" elementId: "yellow-notes"

View File

@ -27,8 +27,8 @@ Item {
width: 400 width: 400
height: 32 height: 32
property bool fillWidth: true Layout.fillWidth: true
property bool fillHeight: true Layout.fillHeight: true
implicitWidth: tasksModel.count * 50 implicitWidth: tasksModel.count * 50
PlasmaCore.DataSource { PlasmaCore.DataSource {

View File

@ -28,8 +28,8 @@ Item {
width: 100 width: 100
height: 100 height: 100
clip: true clip: true
property int minimumWidth: units.gridUnit * 20 Layout.minimumWidth: units.gridUnit * 20
property int minimumHeight: units.gridUnit * 30 Layout.minimumHeight: units.gridUnit * 30
property int _s: units.iconSizes.small property int _s: units.iconSizes.small
property int _h: units.iconSizes.desktop property int _h: units.iconSizes.desktop

View File

@ -28,8 +28,8 @@ Item {
width: 400 width: 400
height: 400 height: 400
property int minimumWidth: units.gridUnit * 20 Layout.minimumWidth: units.gridUnit * 20
property int minimumHeight: units.gridUnit * 30 Layout.minimumHeight: units.gridUnit * 30
property int _s: units.iconSizes.small property int _s: units.iconSizes.small
property int _h: units.iconSizes.desktop property int _h: units.iconSizes.desktop
property int _m: 12 property int _m: 12

View File

@ -28,8 +28,8 @@ Item {
width: 300 width: 300
height: 400 height: 400
clip: true clip: true
property int minimumWidth: units.gridUnit * 10 Layout.minimumWidth: units.gridUnit * 10
property int minimumHeight: units.gridUnit * 10 Layout.minimumHeight: units.gridUnit * 10
property int _s: units.iconSizes.small property int _s: units.iconSizes.small
property int _h: units.iconSizes.medium property int _h: units.iconSizes.medium

View File

@ -18,40 +18,40 @@
*/ */
import QtQuick 2.0 import QtQuick 2.0
import org.kde.plasma.plasmoid 2.0
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import org.kde.plasma.components 2.0 import org.kde.plasma.components 2.0
import org.kde.plasma.shell 2.0
Item { Item {
Layout.minimumWidth: 300
Layout.minimumHeight: 400
Plasmoid.title: "bah"
Plasmoid.switchWidth: 300 Plasmoid.switchWidth: 300
Plasmoid.switchHeight: 400 Plasmoid.switchHeight: 400
ToolBar { Plasmoid.fullRepresentation: Item {
id: toolBar Layout.minimumWidth: 300
z: 10 Layout.minimumHeight: 400
//AppletInterface.title: "bah"
anchors {
top: parent.top
left: parent.left
right: parent.right
}
}
ToolBar {
PageStack { id: toolBar
id: pageStack z: 10
toolBar: toolBar //AppletInterface.title: "bah"
clip: true anchors {
anchors { top: parent.top
top: toolBar.bottom left: parent.left
left: parent.left right: parent.right
right: parent.right }
bottom: parent.bottom }
PageStack {
id: pageStack
toolBar: toolBar
clip: true
anchors {
top: toolBar.bottom
left: parent.left
right: parent.right
bottom: parent.bottom
}
initialPage: Qt.createComponent("Menu.qml")
} }
initialPage: Qt.createComponent("Menu.qml")
} }
} }

View File

@ -18,11 +18,12 @@
*/ */
import QtQuick 2.0 import QtQuick 2.0
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.components 2.0 import org.kde.plasma.components 2.0
Image { Image {
property int minimumWidth: 300 Layout.minimumWidth: 300
property int minimumHeight: 400 Layout.minimumHeight: 400
source: "image://appbackgrounds/standard" source: "image://appbackgrounds/standard"
fillMode: Image.Tile fillMode: Image.Tile
asynchronous: true asynchronous: true

View File

@ -20,6 +20,7 @@
*/ */
import QtQuick 2.0 import QtQuick 2.0
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.extras 2.0 as PlasmaExtras import org.kde.plasma.extras 2.0 as PlasmaExtras
@ -28,8 +29,8 @@ Item {
width: 400 width: 400
height: 32 height: 32
property bool fillWidth: true Layout.fillWidth: true
property bool fillHeight: true Layout.fillHeight: true
PlasmaCore.DataSource { PlasmaCore.DataSource {
id: tasksSource id: tasksSource