diff options
author | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-06-17 16:20:10 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-06-18 17:01:34 +0300 |
commit | e5e4f86db7f64092ce626d47b36dfeffb3ac8cb8 (patch) | |
tree | cba6994df1528066bc8733c1bdb9389de4e26e85 | |
parent | de50ff5dbf2f789786e25540ba0b0efc8c68e0f9 (diff) |
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 <eirik.aavitsland@theqtcompany.com>
-rw-r--r-- | basicsuite/launchersettings/main.qml | 63 |
1 files changed, 63 insertions, 0 deletions
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 @@ -251,6 +251,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" style: SettingsGroupBoxStyle {} |