[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kde-workspace/plasma/sreich/tasks-qml] plasma/desktop/applets/tasks/package/contents/ui: use a flow
From:       Shaun Reich <shaun.reich () kdemail ! net>
Date:       2012-02-13 1:13:37
Message-ID: 20120213011337.1BCA2A60A6 () git ! kde ! org
[Download RAW message or body]

Git commit f3f0aba2942ce0b064a01ea5c21ba8642c31ee12 by Shaun Reich.
Committed on 13/02/2012 at 02:12.
Pushed by sreich into branch 'plasma/sreich/tasks-qml'.

use a flow layout and a repeater. back to square one for now (no data)

just data couutn for now (well, model count)

M  +130  -134  plasma/desktop/applets/tasks/package/contents/ui/main.qml

http://commits.kde.org/kde-workspace/f3f0aba2942ce0b064a01ea5c21ba8642c31ee12

diff --git a/plasma/desktop/applets/tasks/package/contents/ui/main.qml \
b/plasma/desktop/applets/tasks/package/contents/ui/main.qml index f3a3b80..6ca944c \
                100644
--- a/plasma/desktop/applets/tasks/package/contents/ui/main.qml
+++ b/plasma/desktop/applets/tasks/package/contents/ui/main.qml
@@ -48,21 +48,17 @@ Item {
  //       plasmoid.aspectRatioMode = IgnoreAspectRatio;
     }
 
-    GridView {
-        id: tasksGrid
 
+    Flow {
         anchors.fill: parent
-
-        model: tasksModel
-        delegate: tasksDelegate
-
-        cellWidth: 300; cellHeight: 30
-
-        focus: true
-        interactive: false
-
-
-
+        Repeater {
+            model: tasksModel
+            Rectangle {
+                width: 100; height: 40
+                border.width: 1
+                color: "yellow"
+            }
+        }
     }
 
     Component {
@@ -89,129 +85,129 @@ Item {
         }
     }
 
-    Component {
-        id: tasksDelegate
-
-        Item {
-            id: wrapper
-            width: 300
-            height: 30
-
-            //FIXME: make it not be created in the first place..
-//            visible: model.onCurrentDesktop
-
-            GridView.onRemove: SequentialAnimation {
-                PropertyAction { target: wrapper ; property: "GridView.delayRemove"; \
                value: true }
-                NumberAnimation { target: taskBackground; property: "opacity"; to: \
                0; duration: 2500; easing.type: Easing.InOutQuad }
-                PropertyAction { target: wrapper; property: "GridView.delayRemove"; \
                value: false }
-            }
-
-            states: [
-                State {
-                    name: "none"
-                    when: !hovered && !model.minimized
-
-                    PropertyChanges {
-                        target: taskBackground
-                        prefix: "normal"
-                    }
-                },
-                State {
-                    name: "hovered"
-                    when: hovered && !model.minimized
-
-                    PropertyChanges {
-                        target: taskBackground
-                        prefix: "hover"
-                    }
-                },
-                State {
-                    name: "minimized"
-                    when: model.minimized
-
-                    PropertyChanges {
-                        target: taskBackground
-                        prefix: "focus"
-                    }
-                }
-            ]
-
-            property bool hovered: false
-            property ContextMenu contextMenu
-            MouseArea {
-                id: mouseArea
-                anchors.fill: parent
-                hoverEnabled: true
-
-  
-
-                onClicked: {
-                    for (i in model) {
-                        print(i+" "+model[i])
-                    }
-                   // if (!contextMenu) {
-                    if (mouse.button == Qt.RightButton) {
-                        contextMenu = contextMenuComponent.createObject(wrapper)
-                        contextMenu.open()
-                    }
-                    
-                   // }
-                }
-
-                onEntered: {
-                    hovered = true;
-                }
-
-                onExited: {
-                    hovered = false;
-                }
-            }
-
-            PlasmaCore.FrameSvgItem {
-                id: taskBackground
-
-                anchors { left: icon.left; right: text.right; top: icon.top; bottom: \
                icon.bottom }
-
-                imagePath: "widgets/tasks"
-//                prefix: {
-//                    if (model.minimized) {
-//                        "focus"
-//                    } else {
-//                        if (hovered) {
-//                            "hover"
-//                        } else {
-//                            "normal"
-//                        }
+//    Component {
+//        id: tasksDelegate
+//
+//        Item {
+//            id: wrapper
+//            width: 300
+//            height: 30
+//
+//            //FIXME: make it not be created in the first place..
+////            visible: model.onCurrentDesktop
+//
+//            GridView.onRemove: SequentialAnimation {
+//                PropertyAction { target: wrapper ; property: \
"GridView.delayRemove"; value: true } +//                NumberAnimation { target: \
taskBackground; property: "opacity"; to: 0; duration: 2500; easing.type: \
Easing.InOutQuad } +//                PropertyAction { target: wrapper; property: \
"GridView.delayRemove"; value: false } +//            }
+//
+//            states: [
+//                State {
+//                    name: "none"
+//                    when: !hovered && !model.minimized
+//
+//                    PropertyChanges {
+//                        target: taskBackground
+//                        prefix: "normal"
+//                    }
+//                },
+//                State {
+//                    name: "hovered"
+//                    when: hovered && !model.minimized
+//
+//                    PropertyChanges {
+//                        target: taskBackground
+//                        prefix: "hover"
+//                    }
+//                },
+//                State {
+//                    name: "minimized"
+//                    when: model.minimized
+//
+//                    PropertyChanges {
+//                        target: taskBackground
+//                        prefix: "focus"
 //                    }
 //                }
-            }
-
-            QIconItem {
-                id: icon
-
-                anchors { left: taskBackground.left; verticalCenter: \
                taskBackground.verticalCenter }
-
-                icon: model.DecorationRole
-                width: 22
-                height: 22
-            }
-
-            PlasmaComponents.Label {
-                id: text
-
-                anchors { left: icon.right; top: icon.top; bottom: icon.bottom }
-
-                height: tasksGrid.cellHeight
-                width: 200
-
-                verticalAlignment: Text.AlignVCenter
-
-                clip: true
-                text: model.DisplayRole
-            }
-        }
-    }
-
+//            ]
+//
+//            property bool hovered: false
+//            property ContextMenu contextMenu
+//            MouseArea {
+//                id: mouseArea
+//                anchors.fill: parent
+//                hoverEnabled: true
+//
+//  
+//
+//                onClicked: {
+//                    for (i in model) {
+//                        print(i+" "+model[i])
+//                    }
+//                   // if (!contextMenu) {
+//                    if (mouse.button == Qt.RightButton) {
+//                        contextMenu = contextMenuComponent.createObject(wrapper)
+//                        contextMenu.open()
+//                    }
+//                    
+//                   // }
+//                }
+//
+//                onEntered: {
+//                    hovered = true;
+//                }
+//
+//                onExited: {
+//                    hovered = false;
+//                }
+//            }
+//
+//            PlasmaCore.FrameSvgItem {
+//                id: taskBackground
+//
+//                anchors { left: icon.left; right: text.right; top: icon.top; \
bottom: icon.bottom } +//
+//                imagePath: "widgets/tasks"
+////                prefix: {
+////                    if (model.minimized) {
+////                        "focus"
+////                    } else {
+////                        if (hovered) {
+////                            "hover"
+////                        } else {
+////                            "normal"
+////                        }
+////                    }
+////                }
+//            }
+//
+//            QIconItem {
+//                id: icon
+//
+//                anchors { left: taskBackground.left; verticalCenter: \
taskBackground.verticalCenter } +//
+//                icon: model.DecorationRole
+//                width: 22
+//                height: 22
+//            }
+//
+//            PlasmaComponents.Label {
+//                id: text
+//
+//                anchors { left: icon.right; top: icon.top; bottom: icon.bottom }
+//
+//                height: tasksGrid.cellHeight
+//                width: 200
+//
+//                verticalAlignment: Text.AlignVCenter
+//
+//                clip: true
+//                text: model.DisplayRole
+//            }
+//        }
+//    }
+//
 
 //        PlasmaComponents.Label {
 //            id: header


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic