From 68d8004ce23d61b96c8076dad49d79fa8e532a55 Mon Sep 17 00:00:00 2001 From: Papoteur Date: Fri, 17 May 2019 14:22:44 +0200 Subject: Resize to maximal available space if smaller than default --- qml/mageiawelcome.py | 4 ++-- qml/mw-ui.qml | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/qml/mageiawelcome.py b/qml/mageiawelcome.py index 83193d9..310d2e8 100644 --- a/qml/mageiawelcome.py +++ b/qml/mageiawelcome.py @@ -191,8 +191,8 @@ if __name__ == '__main__': sc = nr.startupcheck() factor = cl.factor(app) screen = app.primaryScreen() - defaultHeight = 700 * factor - defaultWidth = 1000 * factor + defaultHeight = min(700 * factor, screen.availableGeometry().height()) + defaultWidth = min(1000 * factor, screen.availableGeometry().width()) centerPoint = screen.availableGeometry().center() view.setGeometry(centerPoint.x() -defaultWidth/2, centerPoint.y() - defaultHeight/2, defaultWidth,defaultHeight) view.rootContext().setContextProperty('link', cb) diff --git a/qml/mw-ui.qml b/qml/mw-ui.qml index ed1623f..d2bf720 100644 --- a/qml/mw-ui.qml +++ b/qml/mw-ui.qml @@ -11,14 +11,15 @@ import QtQuick.Dialogs 1.1 Rectangle { id: box - width: 1000 * Screen.devicePixelRatio; height: 650 * Screen.devicePixelRatio + //width: 1000 * Screen.devicePixelRatio; height: 650 * Screen.devicePixelRatio property alias view: view - //: For Right to Left language, set this string to RTL + //: For Right to Left language, set this string to RTL, else keep it untranslated property var direction: qsTr("LTR") LayoutMirroring.enabled: (direction == "LTR" ? false : true) // for tests //LayoutMirroring.enabled: true + // TO-DO GridLayout RowLayout are not sensible to mirroring, change to other layout tools LayoutMirroring.childrenInherit: true Settings { -- cgit v1.2.1