@@ -23,6 +23,8 @@ import Unity.Application 0.1 // for MirSurfaceItem
23FocusScope {
23FocusScope {
25 objectName: "surfaceContainer"
25 objectName: "surfaceContainer"
26+ implicitWidth: surfaceItem.implicitWidth
27+ implicitHeight: surfaceItem.implicitHeight
27 // Must be set from outside
29 // Must be set from outside
28 property var surface: null
30 property var surface: null
@@ -42,6 +44,16 @@ FocusScope {
42 surfaceItem.surface = surface;
44 surfaceItem.surface = surface;
47+ onImplicitWidthChanged: print("implicit width changed", implicitWidth)
48+ onImplicitHeightChanged: print("implicit height changed", implicitHeight)
54+ onTriggered: print("implicit size:", root.implicitWidth, root.implicitHeight)
45 InputWatcher {
57 InputWatcher {
46 target: surfaceItem
58 target: surfaceItem
47 onTargetPressedChanged: {
59 onTargetPressedChanged: {
@@ -101,33 +113,33 @@ FocusScope {
101 enabled: surfaceItem.enabled
113 enabled: surfaceItem.enabled
104− // MirSurface size drives SurfaceContainer size
116+// // MirSurface size drives SurfaceContainer size
105− Binding {
117+// Binding {
106− target: surfaceItem; property: "width"; value: root.surface ? root.surface.size.width : 0
118+// target: surfaceItem; property: "width"; value: root.surface ? root.surface.size.width : 0
107− when: root.requestedWidth >= 0 && root.surface
119+// when: root.requestedWidth >= 0 && root.surface
109− Binding {
121+// Binding {
110− target: surfaceItem; property: "height"; value: root.surface ? root.surface.size.height : 0
122+// target: surfaceItem; property: "height"; value: root.surface ? root.surface.size.height : 0
111− when: root.requestedHeight >= 0 && root.surface
123+// when: root.requestedHeight >= 0 && root.surface
113− Binding {
125+// Binding {
114− target: root; property: "implicitWidth"; value: surfaceItem.width
126+// target: root; property: "implicitWidth"; value: surfaceItem.width
115− when: root.requestedWidth >= 0
127+// when: root.requestedWidth >= 0
117− Binding {
129+// Binding {
118− target: root; property: "implicitHeight"; value: surfaceItem.height
130+// target: root; property: "implicitHeight"; value: surfaceItem.height
119− when: root.requestedHeight >= 0
131+// when: root.requestedHeight >= 0
122− // SurfaceContainer size drives MirSurface size
134+// // SurfaceContainer size drives MirSurface size
123− Binding {
135+// Binding {
124− target: surfaceItem; property: "width"; value: root.width
136+// target: surfaceItem; property: "width"; value: root.width
125− when: root.requestedWidth < 0
137+// when: root.requestedWidth < 0
127− Binding {
139+// Binding {
128− target: surfaceItem; property: "height"; value: root.height
140+// target: surfaceItem; property: "height"; value: root.height
129− when: root.requestedHeight < 0
141+// when: root.requestedHeight < 0
133 id: animationsLoader
145 id: animationsLoader