From e5e4f86db7f64092ce626d47b36dfeffb3ac8cb8 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Wed, 17 Jun 2015 16:20:10 +0200 Subject: Add physical screen size override slider to settings The slider is in inches and assumes the usual 16:9 aspect ratio. It will then rewrite appcontroller.conf to include QT_QPA_EGLFS_PHYSICAL_WIDTH and HEIGHT. It can also parse the already set values. This is essential because many framebuffer drivers do not provide any physical size information, so overriding with the environment variables is often necessary. Task-number: QTEE-935 Change-Id: I29452bc20cc58a259191fd65e7463f98ff792523 Reviewed-by: Eirik Aavitsland --- basicsuite/launchersettings/main.qml | 63 ++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) (limited to 'basicsuite/launchersettings') diff --git a/basicsuite/launchersettings/main.qml b/basicsuite/launchersettings/main.qml index 3e73107..f609724 100644 --- a/basicsuite/launchersettings/main.qml +++ b/basicsuite/launchersettings/main.qml @@ -250,6 +250,69 @@ Rectangle { } } + GroupBox { + id: dpiOptions + title: "Physical screen size" + style: SettingsGroupBoxStyle {} + Layout.fillWidth: true + implicitWidth: 0 + height: implicitHeight + + GridLayout { + rows: 2 + columns: 2 + anchors.fill: parent + + RowLayout { + Layout.columnSpan: 2 + Label { + text: "Override (needs restart)" + font.pixelSize: engine.smallFontSize() * 0.8 + color: "white" + } + CheckBox { + id: physSizeCb + style: SettingsCheckBoxStyle {} + checked: B2QtDevice.physicalScreenSizeOverride + onCheckedChanged: B2QtDevice.physicalScreenSizeOverride = checked + } + } + + Label { + visible: physSizeCb.checked + text: "Size: " + physSizeSlider.value + " inches" + font.pixelSize: engine.smallFontSize() * 0.8 + color: "white" + } + + Slider { + visible: physSizeCb.checked + id: physSizeSlider + maximumValue: 60 + minimumValue: 4 + Layout.fillWidth: true + value: B2QtDevice.physicalScreenSizeInch + stepSize: 1 + style: SliderStyle { + handle: Rectangle { + anchors.centerIn: parent + color: "white" + border.color: "gray" + border.width: 2 + width: engine.mm(6) + height: engine.mm(6) + radius: 20 + } + } + } + Binding { + target: B2QtDevice + property: "physicalScreenSizeInch" + value: physSizeSlider.value + } + } + } + GroupBox { id: wifiOptions title: "Wifi" -- cgit v1.2.3