Skip to content

Commit

Permalink
Tablet UI improvements
Browse files Browse the repository at this point in the history
emericg committed Jun 28, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 69f45f4 commit e2e3819
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions qml/DeviceEnvironmental.qml
Original file line number Diff line number Diff line change
@@ -43,6 +43,10 @@ Loader {

focus: parent.focus

// 1: single column (single column view or portrait tablet)
// 2: wide mode (wide view)
property int uiMode: (singleColumn || (isTablet && screenOrientation === Qt.PortraitOrientation)) ? 1 : 2

property bool isAirMonitor: false
property bool isWeatherStation: false
property bool isGeigerCounter: false
@@ -399,16 +403,8 @@ Loader {
property int dimboxw: Math.min(deviceEnvironmental.width * 0.4, isPhone ? 320 : 600)
property int dimboxh: Math.max(deviceEnvironmental.height * 0.333, isPhone ? 180 : 256)

width: {
if (isTablet && screenOrientation == Qt.PortraitOrientation) return parent.width
//if (isTablet && screenOrientation == Qt.LandscapeOrientation) return parent.width
return singleColumn ? parent.width : dimboxw
}
height: {
if (isTablet && screenOrientation == Qt.PortraitOrientation) return dimboxh
//if (isTablet && screenOrientation == Qt.LandscapeOrientation) return dimboxh
return singleColumn ? dimboxh : parent.height
}
width: (uiMode === 1) ? parent.width : dimboxw
height: (uiMode === 1) ? dimboxh : parent.height

color: Theme.colorHeader
z: 5
@@ -435,7 +431,7 @@ Loader {

AirQualityIndicator {
id: indicatorAirQuality
width: singleColumn ? headerBox.height * 0.72 : headerBox.width * 0.5
width: (uiMode === 1) ? headerBox.height * 0.72 : headerBox.width * 0.5
height: width

color: cccc

0 comments on commit e2e3819

Please sign in to comment.