on xenial help sign in
avoid playback to pause on orientation changes
commitb19ec482609752d3aa8ae4adcc9cda07a997ed98 authorAndrea Cimitan <andrea.cimitan@gmail.com> dateWed 1 Jun 2016, 17:05 (10 years ago) parent1b01462
6 files changed+26
qml/Dash/Previews/Preview.qml+16 qml/Dash/Previews/PreviewImageGallery.qml+2 qml/Dash/Previews/PreviewInlineVideo.qml+1 qml/Dash/Previews/PreviewWidget.qml+3 qml/Dash/Previews/PreviewWidgetFactory.qml+3 qml/Dash/Previews/PreviewZoomableImage.qml+1
qml/Dash/Previews/Preview.qml+16
@@ -37,12 +37,16 @@ Item {
3737 //! \brief The ScopeStyle component.
3838 property var scopeStyle: null
3939
40+ //! Should the orientation be locked
41+ property int orientationLockCount: 0
42+
4043 clip: true
4144
4245 Binding {
4346 target: previewModel
4447 property: "widgetColumnCount"
4548 value: row.columns
49+ when: root.orientationLockCount === 0
4650 }
4751
4852 MouseArea {
@@ -109,6 +113,18 @@ Item {
109113 column.forceLayout();
110114 column.positionViewAtIndex(index, ListView.Contain)
111115 }
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+ }
112128 }
113129 }
114130 }
qml/Dash/Previews/PreviewImageGallery.qml+2
@@ -27,6 +27,8 @@ PreviewWidget {
2727 id: root
2828 implicitHeight: units.gu(22)
2929
30+ orientationLock: overlay.visible
31+
3032 property Item rootItem: QuickUtils.rootItem(root)
3133
3234 ListView {
qml/Dash/Previews/PreviewInlineVideo.qml+1
@@ -33,6 +33,7 @@ PreviewWidget {
3333 implicitHeight: services.height
3434
3535 widgetMargins: -units.gu(1)
36+ orientationLock: services.fullscreen
3637
3738 property alias rootItem: services.rootItem
3839
qml/Dash/Previews/PreviewWidget.qml+3
@@ -31,6 +31,9 @@ Item {
3131 //! Should the widget show in expanded mode (For those that support it)
3232 property bool expanded: true
3333
34+ //! Should the orientation be locked
35+ property bool orientationLock: false
36+
3437 //! Set margins width.
3538 property real widgetMargins: units.gu(1)
3639
qml/Dash/Previews/PreviewWidgetFactory.qml+3
@@ -37,6 +37,9 @@ Loader {
3737 //! Should the widget show in expanded mode (For those that support it)
3838 property bool expanded: widgetType !== "expandable" || widgetData["expanded"] === true
3939
40+ //! Should the orientation be locked
41+ readonly property bool orientationLock: status === Loader.Ready ? item.orientationLock : false
42+
4043 //! Set margins width.
4144 property real widgetMargins: status === Loader.Ready ? item.widgetMargins : units.gu(1)
4245
qml/Dash/Previews/PreviewZoomableImage.qml+1
@@ -31,6 +31,7 @@ PreviewWidget {
3131 implicitHeight: lazyImage.height
3232
3333 widgetMargins: -units.gu(1)
34+ orientationLock: overlay.visible
3435
3536 property Item rootItem: QuickUtils.rootItem(root)
3637