Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function inputMaskForOrientation(orientation) {
- // mask is in portrait window coordinates
- var mask = Qt.rect(0, 0, Screen.width, Screen.height)
- if (!window.opaqueBackground && webView.enabled && browserPage.active && !webView.touchBlocked && !downloadPopup.visible) {
- var overlayVisibleHeight = browserPage.height - overlay.y
- switch (orientation) {
- case Orientation.None:
- case Orientation.Landscape:
- mask.y = overlay.y
- // fallthrough
- case Orientation.LandscapeInverted:
- mask.height = overlayVisibleHeight
- break
- case Orientation.PortraitInverted:
- mask.x = overlay.y
- // fallthrough
- case Orientation.Portrait:
- mask.width = overlayVisibleHeight
- }
- }
- return mask
- }
- function applyContentOrientation(orientation) {
- orientationFader.waitForWebContentOrientationChanged = (contentItem && contentItem.active)
- switch (orientation) {
- case Orientation.None:
- case Orientation.Portrait:
- updateContentOrientation(Qt.InvertedLandscapeOrientation)
- break
- case Orientation.Landscape:
- updateContentOrientation(Qt.PortraitOrientation)
- break
- case Orientation.PortraitInverted:
- updateContentOrientation(Qt.LandscapeOrientation)
- break
- case Orientation.LandscapeInverted:
- updateContentOrientation(Qt.InvertedPortraitOrientation)
- break
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment