Advertisement
Guest User

Untitled

a guest
Nov 28th, 2018
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.80 KB | None | 0 0
  1. hkmwsesuv
  2. sailfish-browser-1.17.7-1.12.5.jolla.armv7hl.rpm
  3.  
  4. https://github.com/sailfishos/sailfish-browser/commit/66e744da14fc4268bfd232678386496016aa3a57#diff-ba3c890c29799181dff248914805b990
  5.  
  6. declarativewebcontainer.cpp
  7. void DeclarativeWebContainer::updateContentOrientation(Qt::ScreenOrientation orientation)
  8. {
  9. if (gForceLandscapeToPortrait) {
  10.  
  11. if (orientation == Qt::PortraitOrientation) {
  12. orientation = Qt::InvertedLandscapeOrientation;
  13. }
  14.  
  15. else if (orientation == Qt::InvertedPortraitOrientation) {
  16. orientation = Qt::LandscapeOrientation;
  17. }
  18.  
  19. else if (orientation == Qt::LandscapeOrientation) {
  20. orientation = Qt::PortraitOrientation;
  21. }
  22.  
  23. else if (orientation == Qt::InvertedLandscapeOrientation) {
  24. orientation = Qt::InvertedPortraitOrientation;
  25. }
  26. }
  27.  
  28. if (m_mozWindow) {
  29. bool orientationShouldChange = (orientation != m_mozWindow->pendingOrientation());
  30. m_mozWindow->setContentOrientation(orientation);
  31. if (orientationShouldChange) {
  32. emit pendingWebContentOrientationChanged();
  33. }
  34. }
  35.  
  36. if (gForceLandscapeToPortrait) {
  37.  
  38. if (orientation == Qt::InvertedLandscapeOrientation) {
  39. orientation = Qt::PortraitOrientation;
  40. }
  41.  
  42. else if (orientation == Qt::LandscapeOrientation) {
  43. orientation = Qt::InvertedPortraitOrientation;
  44. }
  45.  
  46. else if (orientation == Qt::PortraitOrientation) {
  47. orientation = Qt::LandscapeOrientation;
  48. }
  49.  
  50. else if (orientation == Qt::InvertedPortraitOrientation) {
  51. orientation = Qt::InvertedLandscapeOrientation;
  52. }
  53. }
  54. reportContentOrientationChange(orientation);
  55. }
  56.  
  57. browserpage.qml
  58. function inputMaskForOrientation(orientation) {
  59. // mask is in portrait window coordinates
  60. var mask = Qt.rect(0, 0, Screen.width, Screen.height)
  61. if (!window.opaqueBackground && webView.enabled && browserPage.active && !webView.touchBlocked && !downloadPopup.visible) {
  62. var overlayVisibleHeight = browserPage.height - overlay.y
  63.  
  64. switch (orientation) {
  65. case Orientation.None:
  66. case Orientation.Landscape:
  67. mask.y = overlay.y
  68. // fallthrough
  69. case Orientation.LandscapeInverted:
  70. mask.height = overlayVisibleHeight
  71. break
  72.  
  73. case Orientation.PortraitInverted:
  74. mask.x = overlay.y
  75. // fallthrough
  76. case Orientation.Portrait:
  77. mask.width = overlayVisibleHeight
  78. }
  79. }
  80. return mask
  81. }
  82.  
  83. sailfish-browser.spec
  84. Version: 1.17.7
  85. Release: 1.12.5.jolla
  86.  
  87. 70-browser.conf
  88. BROWSER_FORCE_LANDSCAPE_TO_PORTRAIT="1"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement