@@ -0,0 +1,144 @@
2+import Ubuntu.Components 1.1
3+import Unity.Application 0.1
11+ target: ApplicationManager
12+ onApplicationAdded: {
13+ ApplicationManager.requestFocusApplication(ApplicationManager.get(ApplicationManager.count-1).appId)
14+// ApplicationManager.move(ApplicationManager.count - 1, 0)
18+ var appIndex = priv.indexOf(appId);
19+ ApplicationManager.move(appIndex, 0);
20+ ApplicationManager.focusApplication(appId);
21+ appRepeater.itemAt(appIndex).state = "normal"
27+ function indexOf(appId) {
28+ for (var i = 0; i < ApplicationManager.count; i++) {
29+ if (ApplicationManager.get(i).appId == appId) {
41+ model: ApplicationManager
49+ z: ApplicationManager.count - index
57+ PropertyChanges { target: appDelegate; x: 0; y: 0; width: root.width; height: root.height }
61+ PropertyChanges { target: appDelegate; x: 0; width: units.gu(5); height: units.gu(5); opacity: 0 }
66+ PropertyAnimation { target: appDelegate; properties: "x,y,opacity,width,height" }
73+ margins: -units.gu(2)
75+ source: "graphics/dropshadow2gu.sci"
77+ Behavior on opacity { UbuntuNumberAnimation {} }
82+ anchors.margins: -units.gu(0.5)
84+ property bool resizeWidth: false
85+ property bool resizeHeight: false
87+ property int startX: 0
88+ property int startWidth: 0
89+ property int startY: 0
90+ property int startHeight: 0
93+ ApplicationManager.requestFocusApplication(model.appId)
94+ if (mouseX > width - units.gu(1)) {
97+ startWidth = appDelegate.width;
99+ if (mouseY > height - units.gu(1)) {
100+ resizeHeight = true;
102+ startHeight = appDelegate.height;
104+ if (!resizeHeight && !resizeWidth) {
105+ drag.target = appDelegate;
111+ appDelegate.width = startWidth + (mouseX - startX)
116+ appDelegate.height = startHeight + (mouseY - startY)
121+ resizeWidth = false;
122+ resizeHeight = false;
123+ drag.target = undefined;
128+ anchors { left: parent.left; top: parent.top; right: parent.right }
131+ onClose: ApplicationManager.stopApplication(model.appId)
132+ onMaximize: appDelegate.state = "maximized"
133+ onMinimize: appDelegate.state = "minimized"
137+ anchors.fill: parent
138+ anchors.topMargin: units.gu(3)
139+ application: ApplicationManager.get(index)
140+ interactive: index == 0