@@ -24,6 +24,7 @@ FocusScope {
2424 property string context: ""
2525 property list<Action> actions
2626 property Item rootItem: QuickUtils.rootItem(root)
27+ property var maximumEmbeddedHeight
2728
2829 property alias header: headerContent.item
2930 property alias content: contentLoader.item
@@ -32,39 +33,47 @@ FocusScope {
3233
3334 signal close();
3435
35− implicitHeight: {
36− if (fullscreen && parent) {
37− return parent.height;
38− }
39− return content ? content.implicitHeight : parent.height
40− }
41−
4236 onFullscreenChanged: {
4337 if (!fullscreen) rotationAction.checked = false;
4438 }
4539
4640 OrientationHelper {
4741 id: orientationHelper
48− automaticOrientation: fullscreen && !rotationAction.checked
49−
50− states: [
51− State {
52− name: "portrait"
53− when: !orientationHelper.automaticOrientation && !rotationAction.checked
54− PropertyChanges {
55− target: orientationHelper
56− orientationAngle: 0
42+ automaticOrientation: fullscreen
43+
44+ StateGroup {
45+ id: orientationState
46+
47+ states: [
48+ State {
49+ name: "portrait"
50+ when: !rotationAction.checked
51+ },
52+ State {
53+ name: "landscape"
54+ when: rotationAction.checked
5755 }
58− },
59− State {
60− name: "landscape"
61− when: !orientationHelper.automaticOrientation && rotationAction.checked
62− PropertyChanges {
63− target: orientationHelper
64− orientationAngle: orientationHelper.orientationAngle == 270 ? 270 : 90
56+ ]
57+
58+ transitions: [
59+ Transition {
60+ to: "landscape"
61+ SequentialAnimation {
62+ PropertyAction { target: orientationHelper; property: "automaticOrientation"; value: false }
63+ PropertyAction { target: orientationHelper; property: "orientationAngle"; value: 90 }
64+ PropertyAction { target: orientationHelper; property: "automaticOrientation"; value: false }
65+ }
66+ },
67+ Transition {
68+ to: "portrait"
69+ SequentialAnimation {
70+ PropertyAction { target: orientationHelper; property: "automaticOrientation"; value: false }
71+ PropertyAction { target: orientationHelper; property: "orientationAngle"; value: 0 }
72+ PropertyAction { target: orientationHelper; property: "automaticOrientation"; value: fullscreen }
73+ }
6574 }
66− }
67− ]
75+ ]
76+ }
6877
6978 Loader {
7079 id: contentLoader
@@ -91,9 +100,9 @@ FocusScope {
91100
92101 width: orientationHelper.width
93102 height: orientationHelper.height
94−
103+ maximumEmbeddedHeight: root.maximumEmbeddedHeight
95104 fixedHeight: fullscreen
96− orientation: orientationHelper.state == "portrait" ? Qt.PortraitOrientation : Qt.LandscapeOrientation
105+ orientation: orientationState.state == "landscape" ? Qt.LandscapeOrientation : Qt.PortraitOrientation
97106
98107 screenshot: {
99108 var screenshot = root.sourceData["screenshot"];
@@ -323,21 +332,22 @@ FocusScope {
323332 State {
324333 name: "minimized"
325334 when: !priv.fullscreen
335+ PropertyChanges { target: root; implicitHeight: content ? content.implicitHeight : 0; }
326336 },
327337 State {
328338 name: "fullscreen"
329339 when: priv.fullscreen
330− ParentChange { target: root; parent: rootItem; x: 0; y: 0; width: parent.width; height: parent.height }
340+ ParentChange { target: root; parent: rootItem; x: 0; y: 0; width: parent.width; }
341+ PropertyChanges { target: root; implicitHeight: root.parent ? root.parent.height : 0; }
331342 PropertyChanges { target: fullscreenAction; iconName: "view-restore" }
332343 }
333344 ]
334345
335346 transitions: Transition {
336347 ParentAnimation {
337− UbuntuNumberAnimation { properties: "x,y,width,height"; duration: UbuntuAnimation.FastDuration }
348+ UbuntuNumberAnimation { properties: "x,y,width,implicitHeight"; duration: UbuntuAnimation.FastDuration }
338349 }
339350 }
340−
341351 }
342352
343353 QtObject {