Guest User

Untitled

a guest
Nov 25th, 2018
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1.  
  2.  
  3.  
  4.  
  5. function inputMaskForOrientation(orientation) {
  6. // mask is in portrait window coordinates
  7. var mask = Qt.rect(0, 0, Screen.width, Screen.height)
  8. if (!window.opaqueBackground && webView.enabled && browserPage.active && !webView.touchBlocked && !downloadPopup.visible) {
  9. var overlayVisibleHeight = browserPage.height - overlay.y
  10.  
  11. switch (orientation) {
  12. case Orientation.None:
  13. case Orientation.Landscape:
  14. mask.y = overlay.y
  15. // fallthrough
  16. case Orientation.LandscapeInverted:
  17. mask.height = overlayVisibleHeight
  18. break
  19.  
  20. case Orientation.PortraitInverted:
  21. mask.x = overlay.y
  22. // fallthrough
  23. case Orientation.Portrait:
  24. mask.width = overlayVisibleHeight
  25. }
  26. }
  27. return mask
  28. }
  29.  
  30.  
  31. function applyContentOrientation(orientation) {
  32. orientationFader.waitForWebContentOrientationChanged = (contentItem && contentItem.active)
  33.  
  34. switch (orientation) {
  35. case Orientation.None:
  36. case Orientation.Portrait:
  37. updateContentOrientation(Qt.InvertedLandscapeOrientation)
  38. break
  39. case Orientation.Landscape:
  40. updateContentOrientation(Qt.PortraitOrientation)
  41. break
  42. case Orientation.PortraitInverted:
  43. updateContentOrientation(Qt.LandscapeOrientation)
  44. break
  45. case Orientation.LandscapeInverted:
  46. updateContentOrientation(Qt.InvertedPortraitOrientation)
  47. break
  48. }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment