Commit 4dff9a3e authored by Don Gagne's avatar Don Gagne

Fixes for small screens

parent 5a508286
...@@ -49,12 +49,6 @@ ...@@ -49,12 +49,6 @@
</activity> </activity>
</application> </application>
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="22"/> <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="22"/>
<supports-screens android:smallScreens="false"
android:normalScreens="false"
android:largeScreens="true"
android:xlargeScreens="true"
android:anyDensity="true"
android:requiresSmallestWidthDp="600" />
<!-- Needed to keep working while 'asleep' --> <!-- Needed to keep working while 'asleep' -->
<uses-permission android:name="android.permission.WAKE_LOCK"/> <uses-permission android:name="android.permission.WAKE_LOCK"/>
......
...@@ -68,7 +68,7 @@ Map { ...@@ -68,7 +68,7 @@ Map {
onGcsPositionChanged: { onGcsPositionChanged: {
if (!_initialMapPositionSet) { if (!_initialMapPositionSet) {
_initialMapPositionSet = true _initialMapPositionSet = true
flightMap.center = mainWindow.gcsPosition center = mainWindow.gcsPosition
} }
} }
} }
......
...@@ -35,16 +35,14 @@ import QGroundControl.ScreenTools 1.0 ...@@ -35,16 +35,14 @@ import QGroundControl.ScreenTools 1.0
import QGroundControl.FactSystem 1.0 import QGroundControl.FactSystem 1.0
import QGroundControl.FlightMap 1.0 import QGroundControl.FlightMap 1.0
Rectangle { Item {
id: instrumentPanel id: instrumentPanel
height: compass.y + compass.height + _topBottomMargin height: instrumentColumn.y + instrumentColumn.height + _topBottomMargin
width: size width: size
radius: size / 2
color: _backgroundColor
property alias heading: compass.heading property alias heading: compass.heading
property alias rollAngle: attitude.rollAngle property alias rollAngle: attitudeWidget.rollAngle
property alias pitchAngle: attitude.pitchAngle property alias pitchAngle: attitudeWidget.pitchAngle
property real size: _defaultSize property real size: _defaultSize
property bool isSatellite: false property bool isSatellite: false
property bool active: false property bool active: false
...@@ -58,94 +56,111 @@ Rectangle { ...@@ -58,94 +56,111 @@ Rectangle {
property real _defaultSize: ScreenTools.defaultFontPixelSize * (9) property real _defaultSize: ScreenTools.defaultFontPixelSize * (9)
property color _backgroundColor: isSatellite ? Qt.rgba(1,1,1,0.75) : Qt.rgba(0,0,0,0.75) property color _backgroundColor: isSatellite ? Qt.rgba(1,1,1,0.75) : Qt.rgba(0,0,0,0.75)
property real _sizeRatio: ScreenTools.isTinyScreen ? (size / _defaultSize) * 0.5 : size / _defaultSize
property real _bigFontSize: ScreenTools.defaultFontPixelSize * 2.5 * _sizeRatio
property real _normalFontSize: ScreenTools.defaultFontPixelSize * 1.5 * _sizeRatio
property real _labelFontSize: ScreenTools.defaultFontPixelSize * 0.75 * _sizeRatio
property real _spacing: ScreenTools.defaultFontPixelSize * 0.33 property real _spacing: ScreenTools.defaultFontPixelSize * 0.33
property real _topBottomMargin: (size * 0.05) / 2 property real _topBottomMargin: (size * 0.05) / 2
property real _availableValueHeight: maxHeight - (attitude.height + _spacer1.height + _spacer2.height + compass.height + (_spacing * 4)) property real _availableValueHeight: maxHeight - (attitudeWidget.height + _spacer1.height + _spacer2.height + (_spacing * 4)) - (_showCompass ? compass.height : 0)
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
readonly property bool _showCompass: !ScreenTools.isShortScreen
Rectangle {
anchors.left: parent.left
anchors.right: parent.right
height: (_showCompass ? instrumentColumn.height : attitudeWidget.height) + (_topBottomMargin * 2)
radius: size / 2
color: _backgroundColor
}
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
onClicked: _valuesWidget.showPicker() onClicked: _valuesWidget.showPicker()
} }
QGCAttitudeWidget { Column {
id: attitude id: instrumentColumn
y: _topBottomMargin anchors.topMargin: _topBottomMargin
size: parent.width * 0.95 anchors.top: parent.top
active: instrumentPanel.active anchors.left: parent.left
anchors.horizontalCenter: parent.horizontalCenter anchors.right: parent.right
} spacing: _spacing
Image { Item {
id: gearThingy width: parent.width
anchors.bottom: attitude.bottom height: attitudeWidget.height
anchors.right: attitude.right
source: "/res/gear.svg" QGCAttitudeWidget {
mipmap: true id: attitudeWidget
opacity: 0.5 size: parent.width * 0.95
width: attitude.width * 0.15 active: instrumentPanel.active
fillMode: Image.PreserveAspectFit anchors.horizontalCenter: parent.horizontalCenter
visible: QGroundControl.multiVehicleManager.activeVehicle }
MouseArea { Image {
anchors.fill: parent id: gearThingy
hoverEnabled: true anchors.bottom: attitudeWidget.bottom
onEntered: gearThingy.opacity = 0.85 anchors.right: attitudeWidget.right
onExited: gearThingy.opacity = 0.5 source: "/res/gear.svg"
onClicked: _valuesWidget.showPicker() mipmap: true
opacity: 0.5
width: attitudeWidget.width * 0.15
fillMode: Image.PreserveAspectFit
visible: QGroundControl.multiVehicleManager.activeVehicle
MouseArea {
anchors.fill: parent
hoverEnabled: true
onEntered: gearThingy.opacity = 0.85
onExited: gearThingy.opacity = 0.5
onClicked: _valuesWidget.showPicker()
}
}
} }
}
Rectangle { Rectangle {
id: _spacer1 id: _spacer1
anchors.topMargin: _spacing height: 1
anchors.top: attitude.bottom width: parent.width * 0.9
height: 1 color: isSatellite ? Qt.rgba(0,0,0,0.25) : Qt.rgba(1,1,1,0.25)
width: parent.width * 0.9 anchors.horizontalCenter: parent.horizontalCenter
color: isSatellite ? Qt.rgba(0,0,0,0.25) : Qt.rgba(1,1,1,0.25) }
anchors.horizontalCenter: parent.horizontalCenter
}
InstrumentSwipeView { Item {
id: _valuesWidget width: parent.width
anchors.topMargin: _spacing height: _valuesWidget.height
anchors.top: _spacer1.bottom
width: parent.width Rectangle {
qgcView: instrumentPanel.qgcView anchors.fill: _valuesWidget
textColor: isSatellite ? "black" : "white" color: _backgroundColor
backgroundColor: _backgroundColor visible: !_showCompass && _activeVehicle
maxHeight: _availableValueHeight radius: _spacing
} }
InstrumentSwipeView {
id: _valuesWidget
width: parent.width
qgcView: instrumentPanel.qgcView
textColor: isSatellite ? "black" : "white"
backgroundColor: _backgroundColor
maxHeight: _availableValueHeight
}
}
Component {
id: valuesPage
Rectangle { Rectangle {
width: 100 id: _spacer2
height: 100 height: 1
color: index == 0 ? "red" : "blue" width: parent.width * 0.9
color: isSatellite ? Qt.rgba(0,0,0,0.25) : Qt.rgba(1,1,1,0.25)
visible: _showCompass
anchors.horizontalCenter: parent.horizontalCenter
} }
}
Rectangle { QGCCompassWidget {
id: _spacer2 id: compass
anchors.topMargin: _spacing size: parent.width * 0.95
anchors.top: _valuesWidget.bottom active: instrumentPanel.active
height: 1 visible: _showCompass
width: parent.width * 0.9 anchors.horizontalCenter: parent.horizontalCenter
color: isSatellite ? Qt.rgba(0,0,0,0.25) : Qt.rgba(1,1,1,0.25) }
anchors.horizontalCenter: parent.horizontalCenter
}
QGCCompassWidget {
id: compass
anchors.topMargin: _spacing
anchors.top: _spacer2.bottom
size: parent.width * 0.95
active: instrumentPanel.active
anchors.horizontalCenter: parent.horizontalCenter
} }
} }
...@@ -53,7 +53,7 @@ QGCView { ...@@ -53,7 +53,7 @@ QGCView {
readonly property real _margin: ScreenTools.defaultFontPixelHeight / 2 readonly property real _margin: ScreenTools.defaultFontPixelHeight / 2
readonly property var _activeVehicle: multiVehicleManager.activeVehicle readonly property var _activeVehicle: multiVehicleManager.activeVehicle
readonly property real _editFieldWidth: ScreenTools.defaultFontPixelWidth * 16 readonly property real _editFieldWidth: ScreenTools.defaultFontPixelWidth * 16
readonly property real _rightPanelWidth: ScreenTools.defaultFontPixelWidth * 30 readonly property real _rightPanelWidth: Math.min(parent.width / 3, ScreenTools.defaultFontPixelWidth * 30)
readonly property real _rightPanelOpacity: 0.8 readonly property real _rightPanelOpacity: 0.8
readonly property int _toolButtonCount: 6 readonly property int _toolButtonCount: 6
readonly property string _autoSyncKey: "AutoSync" readonly property string _autoSyncKey: "AutoSync"
...@@ -716,6 +716,7 @@ QGCView { ...@@ -716,6 +716,7 @@ QGCView {
currentMissionItem: _currentMissionItem currentMissionItem: _currentMissionItem
missionItems: controller.visualItems missionItems: controller.visualItems
expandedWidth: missionItemEditor.x - (ScreenTools.defaultFontPixelWidth * 2) expandedWidth: missionItemEditor.x - (ScreenTools.defaultFontPixelWidth * 2)
visible: !ScreenTools.isShortScreen
} }
} // FlightMap } // FlightMap
} // Item - split view container } // Item - split view container
......
...@@ -30,7 +30,7 @@ Rectangle { ...@@ -30,7 +30,7 @@ Rectangle {
property bool _currentItem: missionItem.isCurrentItem property bool _currentItem: missionItem.isCurrentItem
property color _outerTextColor: _currentItem ? "black" : qgcPal.text property color _outerTextColor: _currentItem ? "black" : qgcPal.text
readonly property real _editFieldWidth: ScreenTools.defaultFontPixelWidth * 16 readonly property real _editFieldWidth: Math.min(width - _margin * 2, ScreenTools.defaultFontPixelWidth * 16)
readonly property real _margin: ScreenTools.defaultFontPixelWidth / 2 readonly property real _margin: ScreenTools.defaultFontPixelWidth / 2
readonly property real _radius: ScreenTools.defaultFontPixelWidth / 2 readonly property real _radius: ScreenTools.defaultFontPixelWidth / 2
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment