diff --git a/sailfish/qml/AboutPage.qml b/sailfish/qml/AboutPage.qml index ba160f3..5a7628e 100644 --- a/sailfish/qml/AboutPage.qml +++ b/sailfish/qml/AboutPage.qml @@ -28,11 +28,11 @@ Page { allowedOrientations: { switch (settings.allowedOrientations) { case 1: - return Orientation.Portrait; + return Orientation.PortraitMask; case 2: - return Orientation.Landscape; + return Orientation.LandscapeMask; } - return Orientation.Landscape | Orientation.Portrait; + return Orientation.All; } ActiveDetector {} diff --git a/sailfish/qml/AccountsDialog.qml b/sailfish/qml/AccountsDialog.qml index 67887e1..6ea2eae 100644 --- a/sailfish/qml/AccountsDialog.qml +++ b/sailfish/qml/AccountsDialog.qml @@ -28,11 +28,11 @@ Page { allowedOrientations: { switch (settings.allowedOrientations) { case 1: - return Orientation.Portrait; + return Orientation.PortraitMask; case 2: - return Orientation.Landscape; + return Orientation.LandscapeMask; } - return Orientation.Landscape | Orientation.Portrait; + return Orientation.All; } ActiveDetector {} diff --git a/sailfish/qml/AuthWebViewPage.qml b/sailfish/qml/AuthWebViewPage.qml index 0d0ee0d..508e4a6 100644 --- a/sailfish/qml/AuthWebViewPage.qml +++ b/sailfish/qml/AuthWebViewPage.qml @@ -65,11 +65,11 @@ Page { allowedOrientations: { switch (settings.allowedOrientations) { case 1: - return Orientation.Portrait; + return Orientation.PortraitMask; case 2: - return Orientation.Landscape; + return Orientation.LandscapeMask; } - return Orientation.Landscape | Orientation.Portrait; + return Orientation.All; } SilicaWebView { diff --git a/sailfish/qml/ChangelogPage.qml b/sailfish/qml/ChangelogPage.qml index a8f2d78..605847f 100644 --- a/sailfish/qml/ChangelogPage.qml +++ b/sailfish/qml/ChangelogPage.qml @@ -28,11 +28,11 @@ Page { allowedOrientations: { switch (settings.allowedOrientations) { case 1: - return Orientation.Portrait + return Orientation.PortraitMask; case 2: - return Orientation.Landscape + return Orientation.LandscapeMask; } - return Orientation.Landscape | Orientation.Portrait + return Orientation.All; } ActiveDetector {} diff --git a/sailfish/qml/ControlBar.qml b/sailfish/qml/ControlBar.qml index 6ef8d66..f784438 100644 --- a/sailfish/qml/ControlBar.qml +++ b/sailfish/qml/ControlBar.qml @@ -43,7 +43,7 @@ Item { property Flickable flick: null // other - readonly property bool isPortrait: app.orientation === Orientation.Portrait + readonly property bool isPortrait: app.orientation == Orientation.Portrait || app.orientation == Orientation.PortraitInverted readonly property int stdHeight: isPortrait ? Theme.itemSizeMedium : 0.8 * Theme.itemSizeMedium height: root.stdHeight diff --git a/sailfish/qml/DashboardDialog.qml b/sailfish/qml/DashboardDialog.qml index 7ce593d..35b2a3c 100644 --- a/sailfish/qml/DashboardDialog.qml +++ b/sailfish/qml/DashboardDialog.qml @@ -29,11 +29,11 @@ Dialog { allowedOrientations: { switch (settings.allowedOrientations) { case 1: - return Orientation.Portrait; + return Orientation.PortraitMask; case 2: - return Orientation.Landscape; + return Orientation.LandscapeMask; } - return Orientation.Landscape | Orientation.Portrait; + return Orientation.All; } ActiveDetector {} diff --git a/sailfish/qml/DashboardPage.qml b/sailfish/qml/DashboardPage.qml index 0e77a70..475d61d 100644 --- a/sailfish/qml/DashboardPage.qml +++ b/sailfish/qml/DashboardPage.qml @@ -29,11 +29,11 @@ Page { allowedOrientations: { switch (settings.allowedOrientations) { case 1: - return Orientation.Portrait; + return Orientation.PortraitMask; case 2: - return Orientation.Landscape; + return Orientation.LandscapeMask; } - return Orientation.Landscape | Orientation.Portrait; + return Orientation.All; } ActiveDetector {} diff --git a/sailfish/qml/DebugPage.qml b/sailfish/qml/DebugPage.qml index 038fa35..4b6ec9f 100644 --- a/sailfish/qml/DebugPage.qml +++ b/sailfish/qml/DebugPage.qml @@ -28,11 +28,11 @@ Page { allowedOrientations: { switch (settings.allowedOrientations) { case 1: - return Orientation.Portrait; + return Orientation.PortraitMask; case 2: - return Orientation.Landscape; + return Orientation.LandscapeMask; } - return Orientation.Landscape | Orientation.Portrait; + return Orientation.All; } ActiveDetector {} diff --git a/sailfish/qml/EntryPage.qml b/sailfish/qml/EntryPage.qml index 4bad337..d145347 100644 --- a/sailfish/qml/EntryPage.qml +++ b/sailfish/qml/EntryPage.qml @@ -28,11 +28,11 @@ Page { allowedOrientations: { switch (settings.allowedOrientations) { case 1: - return Orientation.Portrait; + return Orientation.PortraitMask; case 2: - return Orientation.Landscape; + return Orientation.LandscapeMask; } - return Orientation.Landscape | Orientation.Portrait; + return Orientation.All; } property bool showBar: true diff --git a/sailfish/qml/FeedPage.qml b/sailfish/qml/FeedPage.qml index 27c72a6..c1a7598 100644 --- a/sailfish/qml/FeedPage.qml +++ b/sailfish/qml/FeedPage.qml @@ -32,11 +32,11 @@ Page { allowedOrientations: { switch (settings.allowedOrientations) { case 1: - return Orientation.Portrait; + return Orientation.PortraitMask; case 2: - return Orientation.Landscape; + return Orientation.LandscapeMask; } - return Orientation.Landscape | Orientation.Portrait; + return Orientation.All; } property string title diff --git a/sailfish/qml/FeedWebContentPage.qml b/sailfish/qml/FeedWebContentPage.qml index 13ff3e3..250286b 100644 --- a/sailfish/qml/FeedWebContentPage.qml +++ b/sailfish/qml/FeedWebContentPage.qml @@ -70,11 +70,11 @@ Page { allowedOrientations: { switch (settings.allowedOrientations) { case 1: - return Orientation.Portrait; + return Orientation.PortraitMask; case 2: - return Orientation.Landscape; + return Orientation.LandscapeMask; } - return Orientation.Landscape | Orientation.Portrait; + return Orientation.All; } Component.onCompleted: { diff --git a/sailfish/qml/FirstPage.qml b/sailfish/qml/FirstPage.qml index 564dd5c..d7c8098 100644 --- a/sailfish/qml/FirstPage.qml +++ b/sailfish/qml/FirstPage.qml @@ -29,11 +29,11 @@ Page { allowedOrientations: { switch (settings.allowedOrientations) { case 1: - return Orientation.Portrait; + return Orientation.PortraitMask; case 2: - return Orientation.Landscape; + return Orientation.LandscapeMask; } - return Orientation.Landscape | Orientation.Portrait; + return Orientation.All; } SilicaListView { diff --git a/sailfish/qml/NvSignInDialog.qml b/sailfish/qml/NvSignInDialog.qml index 5514ba0..eefaa94 100644 --- a/sailfish/qml/NvSignInDialog.qml +++ b/sailfish/qml/NvSignInDialog.qml @@ -32,11 +32,11 @@ Dialog { allowedOrientations: { switch (settings.allowedOrientations) { case 1: - return Orientation.Portrait; + return Orientation.PortraitMask; case 2: - return Orientation.Landscape; + return Orientation.LandscapeMask; } - return Orientation.Landscape | Orientation.Portrait; + return Orientation.All; } ActiveDetector {} diff --git a/sailfish/qml/OldReaderSignInDialog.qml b/sailfish/qml/OldReaderSignInDialog.qml index 81cec15..78f6e13 100644 --- a/sailfish/qml/OldReaderSignInDialog.qml +++ b/sailfish/qml/OldReaderSignInDialog.qml @@ -31,11 +31,11 @@ Dialog { allowedOrientations: { switch (settings.allowedOrientations) { case 1: - return Orientation.Portrait; + return Orientation.PortraitMask; case 2: - return Orientation.Landscape; + return Orientation.LandscapeMask; } - return Orientation.Landscape | Orientation.Portrait; + return Orientation.All; } ActiveDetector {} diff --git a/sailfish/qml/PocketAuthWebViewPage.qml b/sailfish/qml/PocketAuthWebViewPage.qml index dc30707..ba9677d 100644 --- a/sailfish/qml/PocketAuthWebViewPage.qml +++ b/sailfish/qml/PocketAuthWebViewPage.qml @@ -46,11 +46,11 @@ Page { allowedOrientations: { switch (settings.allowedOrientations) { case 1: - return Orientation.Portrait; + return Orientation.PortraitMask; case 2: - return Orientation.Landscape; + return Orientation.LandscapeMask; } - return Orientation.Landscape | Orientation.Portrait; + return Orientation.All; } onStatusChanged: { diff --git a/sailfish/qml/PocketDialog.qml b/sailfish/qml/PocketDialog.qml index 54b7799..a8b76f6 100644 --- a/sailfish/qml/PocketDialog.qml +++ b/sailfish/qml/PocketDialog.qml @@ -45,11 +45,11 @@ Dialog { allowedOrientations: { switch (settings.allowedOrientations) { case 1: - return Orientation.Portrait; + return Orientation.PortraitMask; case 2: - return Orientation.Landscape; + return Orientation.LandscapeMask; } - return Orientation.Landscape | Orientation.Portrait; + return Orientation.All; } onAccepted: { diff --git a/sailfish/qml/ReadAllDialog.qml b/sailfish/qml/ReadAllDialog.qml index 520d8dd..d625dc9 100644 --- a/sailfish/qml/ReadAllDialog.qml +++ b/sailfish/qml/ReadAllDialog.qml @@ -30,11 +30,11 @@ Dialog { allowedOrientations: { switch (settings.allowedOrientations) { case 1: - return Orientation.Portrait; + return Orientation.PortraitMask; case 2: - return Orientation.Landscape; + return Orientation.LandscapeMask; } - return Orientation.Landscape | Orientation.Portrait; + return Orientation.All; } ActiveDetector {} diff --git a/sailfish/qml/SettingsPage.qml b/sailfish/qml/SettingsPage.qml index 8afe2a0..ba342ef 100644 --- a/sailfish/qml/SettingsPage.qml +++ b/sailfish/qml/SettingsPage.qml @@ -28,11 +28,11 @@ Page { allowedOrientations: { switch (settings.allowedOrientations) { case 1: - return Orientation.Portrait; + return Orientation.PortraitMask; case 2: - return Orientation.Landscape; + return Orientation.LandscapeMask; } - return Orientation.Landscape | Orientation.Portrait; + return Orientation.All; } ActiveDetector {} diff --git a/sailfish/qml/ShareDialog.qml b/sailfish/qml/ShareDialog.qml index 6a13ac0..5cdc067 100644 --- a/sailfish/qml/ShareDialog.qml +++ b/sailfish/qml/ShareDialog.qml @@ -33,11 +33,11 @@ Dialog { allowedOrientations: { switch (settings.allowedOrientations) { case 1: - return Orientation.Portrait; + return Orientation.PortraitMask; case 2: - return Orientation.Landscape; + return Orientation.LandscapeMask; } - return Orientation.Landscape | Orientation.Portrait; + return Orientation.All; } ActiveDetector {} diff --git a/sailfish/qml/SignOutDialog.qml b/sailfish/qml/SignOutDialog.qml index 1b3ab42..609418e 100644 --- a/sailfish/qml/SignOutDialog.qml +++ b/sailfish/qml/SignOutDialog.qml @@ -29,11 +29,11 @@ Dialog { allowedOrientations: { switch (settings.allowedOrientations) { case 1: - return Orientation.Portrait; + return Orientation.PortraitMask; case 2: - return Orientation.Landscape; + return Orientation.LandscapeMask; } - return Orientation.Landscape | Orientation.Portrait; + return Orientation.All; } ActiveDetector {} diff --git a/sailfish/qml/TTRssSignInDialog.qml b/sailfish/qml/TTRssSignInDialog.qml index f77bf2e..142852d 100644 --- a/sailfish/qml/TTRssSignInDialog.qml +++ b/sailfish/qml/TTRssSignInDialog.qml @@ -32,11 +32,11 @@ Dialog { allowedOrientations: { switch (settings.allowedOrientations) { case 1: - return Orientation.Portrait; + return Orientation.PortraitMask; case 2: - return Orientation.Landscape; + return Orientation.LandscapeMask; } - return Orientation.Landscape | Orientation.Portrait; + return Orientation.All; } ActiveDetector {} diff --git a/sailfish/qml/TabPage.qml b/sailfish/qml/TabPage.qml index bb23f64..1f9b016 100644 --- a/sailfish/qml/TabPage.qml +++ b/sailfish/qml/TabPage.qml @@ -31,11 +31,11 @@ Page { allowedOrientations: { switch (settings.allowedOrientations) { case 1: - return Orientation.Portrait + return Orientation.PortraitMask; case 2: - return Orientation.Landscape + return Orientation.LandscapeMask; } - return Orientation.Landscape | Orientation.Portrait + return Orientation.All; } ActiveDetector { diff --git a/sailfish/qml/UnreadAllDialog.qml b/sailfish/qml/UnreadAllDialog.qml index ea07337..c9ac8c1 100644 --- a/sailfish/qml/UnreadAllDialog.qml +++ b/sailfish/qml/UnreadAllDialog.qml @@ -30,11 +30,11 @@ Dialog { allowedOrientations: { switch (settings.allowedOrientations) { case 1: - return Orientation.Portrait; + return Orientation.PortraitMask; case 2: - return Orientation.Landscape; + return Orientation.LandscapeMask; } - return Orientation.Landscape | Orientation.Portrait; + return Orientation.All; } ActiveDetector {} diff --git a/sailfish/qml/WebPreviewPage.qml b/sailfish/qml/WebPreviewPage.qml index 1ab0b2b..2deb1be 100644 --- a/sailfish/qml/WebPreviewPage.qml +++ b/sailfish/qml/WebPreviewPage.qml @@ -189,11 +189,11 @@ Page { allowedOrientations: { switch (settings.allowedOrientations) { case 1: - return Orientation.Portrait; + return Orientation.PortraitMask; case 2: - return Orientation.Landscape; + return Orientation.LandscapeMask; } - return Orientation.Landscape | Orientation.Portrait; + return Orientation.All; } Component.onCompleted: init() diff --git a/sailfish/qml/main.qml b/sailfish/qml/main.qml index b36884d..4eaee18 100644 --- a/sailfish/qml/main.qml +++ b/sailfish/qml/main.qml @@ -31,7 +31,7 @@ ApplicationWindow { readonly property bool isNetvibes: settings.signinType >= 0 && settings.signinType < 10 readonly property bool isOldReader: settings.signinType >= 10 && settings.signinType < 20 readonly property bool isTTRss: settings.signinType >= 30 && settings.signinType < 40 - readonly property int stdHeight: orientation==Orientation.Portrait ? Theme.itemSizeMedium : 0.8 * Theme.itemSizeMedium + readonly property int stdHeight: isPortraitOrientation(orientation) ? Theme.itemSizeMedium : 0.8 * Theme.itemSizeMedium cover: CoverPage {} @@ -51,6 +51,10 @@ ApplicationWindow { } } + function isPortraitOrientation(orientation) { + return orientation == Orientation.Portrait || orientation == Orientation.PortraitInverted; + } + function hideBar() { bar.hide(); } @@ -407,25 +411,49 @@ ApplicationWindow { id: notification } - property int panelWidth: app.orientation==Orientation.Portrait ? Screen.width : Screen.height + property int panelWidth: isPortraitOrientation(app.orientation) ? Screen.width : Screen.height property int landscapeContentPanelWidth: isTablet ? - app.orientation === Orientation.Portrait ? Screen.width-700 : Screen.height-700 : - app.orientation === Orientation.Portrait ? Screen.width/2 : Screen.height/2 + isPortraitOrientation(app.orientation) ? Screen.width-700 : Screen.height-700 : + isPortraitOrientation(app.orientation) ? Screen.width/2 : Screen.height/2 property int flickHeight: { var size = 0 if (bar.open) size += bar.stdHeight - return app.orientation === Orientation.Portrait ? Screen.height-size : Screen.width-size; + return isPortraitOrientation(app.orientation) ? Screen.height-size : Screen.width-size; + } + + property int barX: { + switch (app.orientation) { + case Orientation.Portrait: return 0; + case Orientation.Landscape: return bar.height; + case Orientation.PortraitInverted: return Screen.width; + case Orientation.LandscapeInverted: return Screen.width - bar.height; + } + } + + property int barY: { + switch (app.orientation) { + case Orientation.Portrait: return Screen.height - bar.height; + case Orientation.Landscape: return 0; + case Orientation.PortraitInverted: return bar.height; + case Orientation.LandscapeInverted: return Screen.height; + } } - property int barX: app.orientation === Orientation.Portrait ? 0 : bar.height - property int barY: app.orientation === Orientation.Portrait ? Screen.height - bar.height : 0 readonly property alias barHeight: bar.height ControlBar { id: bar busy: app.fetcherBusyStatus || dm.removerBusy || dm.busy - rotation: app.orientation === Orientation.Portrait ? 0 : 90 + + rotation: { + switch (app.orientation) { + case Orientation.Portrait: return 0; + case Orientation.Landscape: return 90; + case Orientation.PortraitInverted: 180; + case Orientation.LandscapeInverted: 270; + } + transformOrigin: Item.TopLeft width: app.panelWidth