Merge pull request #32 from razcampagne/master
Add support for inverted orientations
This commit is contained in:
commit
2104ebff13
25 changed files with 106 additions and 78 deletions
|
|
@ -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 {}
|
||||
|
|
|
|||
|
|
@ -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 {}
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 {}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 {}
|
||||
|
|
|
|||
|
|
@ -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 {}
|
||||
|
|
|
|||
|
|
@ -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 {}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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: {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 {}
|
||||
|
|
|
|||
|
|
@ -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 {}
|
||||
|
|
|
|||
|
|
@ -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: {
|
||||
|
|
|
|||
|
|
@ -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: {
|
||||
|
|
|
|||
|
|
@ -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 {}
|
||||
|
|
|
|||
|
|
@ -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 {}
|
||||
|
|
|
|||
|
|
@ -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 {}
|
||||
|
|
|
|||
|
|
@ -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 {}
|
||||
|
|
|
|||
|
|
@ -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 {}
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 {}
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue