on xenial help sign in
avoid playback to pause on orientation changes
b19ec48Andrea Cimitan
qml/Dash/Previews/Preview.qml+16
@@ -37,12 +37,16 @@ Item {
37 //! \brief The ScopeStyle component.
37 //! \brief The ScopeStyle component.
38 property var scopeStyle: null
38 property var scopeStyle: null
39
39
40+ //! Should the orientation be locked
41+ property int orientationLockCount: 0
42+
40 clip: true
43 clip: true
41
44
42 Binding {
45 Binding {
43 target: previewModel
46 target: previewModel
44 property: "widgetColumnCount"
47 property: "widgetColumnCount"
45 value: row.columns
48 value: row.columns
49+ when: root.orientationLockCount === 0
46 }
50 }
47
51
48 MouseArea {
52 MouseArea {
@@ -109,6 +113,18 @@ Item {
109 column.forceLayout();
113 column.forceLayout();
110 column.positionViewAtIndex(index, ListView.Contain)
114 column.positionViewAtIndex(index, ListView.Contain)
111 }
115 }
116+
117+ onOrientationLockChanged: {
118+ if (orientationLock)
119+ root.orientationLockCount++;
120+ else
121+ root.orientationLockCount = Math.max(0, root.orientationLockCount--);
122+ }
123+
124+ Component.onDestruction: {
125+ if (orientationLock)
126+ root.orientationLockCount = Math.max(0, root.orientationLockCount--);
127+ }
112 }
128 }
113 }
129 }
114 }
130 }
qml/Dash/Previews/PreviewImageGallery.qml+2
@@ -27,6 +27,8 @@ PreviewWidget {
27 id: root
27 id: root
28 implicitHeight: units.gu(22)
28 implicitHeight: units.gu(22)
29
29
30+ orientationLock: overlay.visible
31+
30 property Item rootItem: QuickUtils.rootItem(root)
32 property Item rootItem: QuickUtils.rootItem(root)
31
33
32 ListView {
34 ListView {
qml/Dash/Previews/PreviewInlineVideo.qml+1
@@ -33,6 +33,7 @@ PreviewWidget {
33 implicitHeight: services.height
33 implicitHeight: services.height
34
34
35 widgetMargins: -units.gu(1)
35 widgetMargins: -units.gu(1)
36+ orientationLock: services.fullscreen
36
37
37 property alias rootItem: services.rootItem
38 property alias rootItem: services.rootItem
38
39
qml/Dash/Previews/PreviewWidget.qml+3
@@ -31,6 +31,9 @@ Item {
31 //! Should the widget show in expanded mode (For those that support it)
31 //! Should the widget show in expanded mode (For those that support it)
32 property bool expanded: true
32 property bool expanded: true
33
33
34+ //! Should the orientation be locked
35+ property bool orientationLock: false
36+
34 //! Set margins width.
37 //! Set margins width.
35 property real widgetMargins: units.gu(1)
38 property real widgetMargins: units.gu(1)
36
39
qml/Dash/Previews/PreviewWidgetFactory.qml+3
@@ -37,6 +37,9 @@ Loader {
37 //! Should the widget show in expanded mode (For those that support it)
37 //! Should the widget show in expanded mode (For those that support it)
38 property bool expanded: widgetType !== "expandable" || widgetData["expanded"] === true
38 property bool expanded: widgetType !== "expandable" || widgetData["expanded"] === true
39
39
40+ //! Should the orientation be locked
41+ readonly property bool orientationLock: status === Loader.Ready ? item.orientationLock : false
42+
40 //! Set margins width.
43 //! Set margins width.
41 property real widgetMargins: status === Loader.Ready ? item.widgetMargins : units.gu(1)
44 property real widgetMargins: status === Loader.Ready ? item.widgetMargins : units.gu(1)
42
45
qml/Dash/Previews/PreviewZoomableImage.qml+1
@@ -31,6 +31,7 @@ PreviewWidget {
31 implicitHeight: lazyImage.height
31 implicitHeight: lazyImage.height
32
32
33 widgetMargins: -units.gu(1)
33 widgetMargins: -units.gu(1)
34+ orientationLock: overlay.visible
34
35
35 property Item rootItem: QuickUtils.rootItem(root)
36 property Item rootItem: QuickUtils.rootItem(root)
36
37