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

Fixes for small screens

parent 5a508286
......@@ -49,12 +49,6 @@
</activity>
</application>
<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' -->
<uses-permission android:name="android.permission.WAKE_LOCK"/>
......
......@@ -68,7 +68,7 @@ Map {
onGcsPositionChanged: {
if (!_initialMapPositionSet) {
_initialMapPositionSet = true
flightMap.center = mainWindow.gcsPosition
center = mainWindow.gcsPosition
}
}
}
......
......@@ -35,16 +35,14 @@ import QGroundControl.ScreenTools 1.0
import QGroundControl.FactSystem 1.0
import QGroundControl.FlightMap 1.0
Rectangle {
Item {
id: instrumentPanel
height: compass.y + compass.height + _topBottomMargin
height: instrumentColumn.y + instrumentColumn.height + _topBottomMargin
width: size
radius: size / 2
color: _backgroundColor
property alias heading: compass.heading
property alias rollAngle: attitude.rollAngle
property alias pitchAngle: attitude.pitchAngle
property alias rollAngle: attitudeWidget.rollAngle
property alias pitchAngle: attitudeWidget.pitchAngle
property real size: _defaultSize
property bool isSatellite: false
property bool active: false
......@@ -58,94 +56,111 @@ Rectangle {
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 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 _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 {
anchors.fill: parent
onClicked: _valuesWidget.showPicker()
}
QGCAttitudeWidget {
id: attitude
y: _topBottomMargin
size: parent.width * 0.95
active: instrumentPanel.active
anchors.horizontalCenter: parent.horizontalCenter
}
Image {
id: gearThingy
anchors.bottom: attitude.bottom
anchors.right: attitude.right
source: "/res/gear.svg"
mipmap: true
opacity: 0.5
width: attitude.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()
Column {
id: instrumentColumn
anchors.topMargin: _topBottomMargin
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
spacing: _spacing
Item {
width: parent.width
height: attitudeWidget.height
QGCAttitudeWidget {
id: attitudeWidget
size: parent.width * 0.95
active: instrumentPanel.active
anchors.horizontalCenter: parent.horizontalCenter
}
Image {
id: gearThingy
anchors.bottom: attitudeWidget.bottom
anchors.right: attitudeWidget.right
source: "/res/gear.svg"
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 {
id: _spacer1
anchors.topMargin: _spacing
anchors.top: attitude.bottom
height: 1
width: parent.width * 0.9
color: isSatellite ? Qt.rgba(0,0,0,0.25) : Qt.rgba(1,1,1,0.25)
anchors.horizontalCenter: parent.horizontalCenter
}
Rectangle {
id: _spacer1
height: 1
width: parent.width * 0.9
color: isSatellite ? Qt.rgba(0,0,0,0.25) : Qt.rgba(1,1,1,0.25)
anchors.horizontalCenter: parent.horizontalCenter
}
InstrumentSwipeView {
id: _valuesWidget
anchors.topMargin: _spacing
anchors.top: _spacer1.bottom
width: parent.width
qgcView: instrumentPanel.qgcView
textColor: isSatellite ? "black" : "white"
backgroundColor: _backgroundColor
maxHeight: _availableValueHeight
}
Item {
width: parent.width
height: _valuesWidget.height
Rectangle {
anchors.fill: _valuesWidget
color: _backgroundColor
visible: !_showCompass && _activeVehicle
radius: _spacing
}
InstrumentSwipeView {
id: _valuesWidget
width: parent.width
qgcView: instrumentPanel.qgcView
textColor: isSatellite ? "black" : "white"
backgroundColor: _backgroundColor
maxHeight: _availableValueHeight
}
}
Component {
id: valuesPage
Rectangle {
width: 100
height: 100
color: index == 0 ? "red" : "blue"
id: _spacer2
height: 1
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 {
id: _spacer2
anchors.topMargin: _spacing
anchors.top: _valuesWidget.bottom
height: 1
width: parent.width * 0.9
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
QGCCompassWidget {
id: compass
size: parent.width * 0.95
active: instrumentPanel.active
visible: _showCompass
anchors.horizontalCenter: parent.horizontalCenter
}
}
}
......@@ -53,7 +53,7 @@ QGCView {
readonly property real _margin: ScreenTools.defaultFontPixelHeight / 2
readonly property var _activeVehicle: multiVehicleManager.activeVehicle
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 int _toolButtonCount: 6
readonly property string _autoSyncKey: "AutoSync"
......@@ -716,6 +716,7 @@ QGCView {
currentMissionItem: _currentMissionItem
missionItems: controller.visualItems
expandedWidth: missionItemEditor.x - (ScreenTools.defaultFontPixelWidth * 2)
visible: !ScreenTools.isShortScreen
}
} // FlightMap
} // Item - split view container
......
......@@ -30,7 +30,7 @@ Rectangle {
property bool _currentItem: missionItem.isCurrentItem
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 _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