Commit 52a18d72 authored by Don Gagne's avatar Don Gagne

Merge pull request #3493 from DonLakeFlyer/GeneralSettingSizing

General setting sizing
parents d009c117 fd091a62
...@@ -231,7 +231,7 @@ Fact* QGroundControlQmlGlobal::offlineEditingFirmwareType(void) ...@@ -231,7 +231,7 @@ Fact* QGroundControlQmlGlobal::offlineEditingFirmwareType(void)
_offlineEditingFirmwareTypeFact = new SettingsFact(QString(), "OfflineEditingFirmwareType", FactMetaData::valueTypeUint32, (uint32_t)MAV_AUTOPILOT_ARDUPILOTMEGA); _offlineEditingFirmwareTypeFact = new SettingsFact(QString(), "OfflineEditingFirmwareType", FactMetaData::valueTypeUint32, (uint32_t)MAV_AUTOPILOT_ARDUPILOTMEGA);
_offlineEditingFirmwareTypeMetaData = new FactMetaData(FactMetaData::valueTypeUint32); _offlineEditingFirmwareTypeMetaData = new FactMetaData(FactMetaData::valueTypeUint32);
enumStrings << "ArduPilot Flight Stack" << "PX4 Flight Stack" << "Mavlink Generic Flight Stack"; enumStrings << "ArduPilot Firmware" << "PX4 Firmware" << "Mavlink Generic Firmware";
enumValues << QVariant::fromValue((uint32_t)MAV_AUTOPILOT_ARDUPILOTMEGA) << QVariant::fromValue((uint32_t)MAV_AUTOPILOT_PX4) << QVariant::fromValue((uint32_t)MAV_AUTOPILOT_GENERIC); enumValues << QVariant::fromValue((uint32_t)MAV_AUTOPILOT_ARDUPILOTMEGA) << QVariant::fromValue((uint32_t)MAV_AUTOPILOT_PX4) << QVariant::fromValue((uint32_t)MAV_AUTOPILOT_GENERIC);
_offlineEditingFirmwareTypeMetaData->setEnumInfo(enumStrings, enumValues); _offlineEditingFirmwareTypeMetaData->setEnumInfo(enumStrings, enumValues);
...@@ -270,7 +270,7 @@ Fact* QGroundControlQmlGlobal::speedUnits(void) ...@@ -270,7 +270,7 @@ Fact* QGroundControlQmlGlobal::speedUnits(void)
_speedUnitsFact = new SettingsFact(QString(), "SpeedUnits", FactMetaData::valueTypeUint32, SpeedUnitsMetersPerSecond); _speedUnitsFact = new SettingsFact(QString(), "SpeedUnits", FactMetaData::valueTypeUint32, SpeedUnitsMetersPerSecond);
_speedUnitsMetaData = new FactMetaData(FactMetaData::valueTypeUint32); _speedUnitsMetaData = new FactMetaData(FactMetaData::valueTypeUint32);
enumStrings << "Feet per second" << "Meters per second" << "Miles per hour" << "Kilometers per hour" << "Knots"; enumStrings << "Feet/second" << "Meters/second" << "Miles/hour" << "Kilometers/hour" << "Knots";
enumValues << QVariant::fromValue((uint32_t)SpeedUnitsFeetPerSecond) << QVariant::fromValue((uint32_t)SpeedUnitsMetersPerSecond) << QVariant::fromValue((uint32_t)SpeedUnitsMilesPerHour) << QVariant::fromValue((uint32_t)SpeedUnitsKilometersPerHour) << QVariant::fromValue((uint32_t)SpeedUnitsKnots); enumValues << QVariant::fromValue((uint32_t)SpeedUnitsFeetPerSecond) << QVariant::fromValue((uint32_t)SpeedUnitsMetersPerSecond) << QVariant::fromValue((uint32_t)SpeedUnitsMilesPerHour) << QVariant::fromValue((uint32_t)SpeedUnitsKilometersPerHour) << QVariant::fromValue((uint32_t)SpeedUnitsKnots);
_speedUnitsMetaData->setEnumInfo(enumStrings, enumValues); _speedUnitsMetaData->setEnumInfo(enumStrings, enumValues);
......
...@@ -28,8 +28,7 @@ Rectangle { ...@@ -28,8 +28,7 @@ Rectangle {
anchors.margins: ScreenTools.defaultFontPixelWidth anchors.margins: ScreenTools.defaultFontPixelWidth
property Fact _percentRemainingAnnounce: QGroundControl.multiVehicleManager.disconnectedVehicle.battery.percentRemainingAnnounce property Fact _percentRemainingAnnounce: QGroundControl.multiVehicleManager.disconnectedVehicle.battery.percentRemainingAnnounce
property real _firstLabelWidth: ScreenTools.defaultFontPixelWidth * 16 property real _editFieldWidth: ScreenTools.defaultFontPixelWidth * 15
property real _editFieldWidth: ScreenTools.defaultFontPixelWidth * 22
QGCPalette { id: qgcPal } QGCPalette { id: qgcPal }
...@@ -48,11 +47,13 @@ Rectangle { ...@@ -48,11 +47,13 @@ Rectangle {
text: qsTr("General Settings") text: qsTr("General Settings")
font.pointSize: ScreenTools.mediumFontPointSize font.pointSize: ScreenTools.mediumFontPointSize
} }
Rectangle { Rectangle {
height: 1 height: 1
width: parent.width width: parent.width
color: qgcPal.button color: qgcPal.text
} }
Item { Item {
height: ScreenTools.defaultFontPixelHeight / 2 height: ScreenTools.defaultFontPixelHeight / 2
width: parent.width width: parent.width
...@@ -62,63 +63,63 @@ Rectangle { ...@@ -62,63 +63,63 @@ Rectangle {
//-- Base UI Font Point Size //-- Base UI Font Point Size
Row { Row {
spacing: ScreenTools.defaultFontPixelWidth spacing: ScreenTools.defaultFontPixelWidth
QGCLabel { QGCLabel {
width: _firstLabelWidth id: baseFontLabel
text: qsTr("Base UI font size:") text: qsTr("Base UI font size:")
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
} }
Row { Row {
id: baseFontRow
spacing: ScreenTools.defaultFontPixelWidth / 2
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
Rectangle {
width: baseFontEdit.height QGCButton {
height: width id: decrementButton
color: qgcPal.button width: height
QGCLabel { height: baseFontEdit.height
text: "-" text: "-"
anchors.centerIn: parent
}
MouseArea {
anchors.fill: parent
onClicked: { onClicked: {
if(ScreenTools.defaultFontPointSize > 6) if(ScreenTools.defaultFontPointSize > 6) {
QGroundControl.baseFontPointSize = QGroundControl.baseFontPointSize - 1 QGroundControl.baseFontPointSize = QGroundControl.baseFontPointSize - 1
} }
} }
} }
QGCTextField { QGCTextField {
id: baseFontEdit id: baseFontEdit
width: _editFieldWidth - (height * 2) width: _editFieldWidth - (decrementButton.width * 2) - (baseFontRow.spacing * 2)
text: QGroundControl.baseFontPointSize text: QGroundControl.baseFontPointSize
showUnits: true showUnits: true
unitsLabel: "pt" unitsLabel: "pt"
maximumLength: 6 maximumLength: 6
validator: DoubleValidator {bottom: 6.0; top: 48.0; decimals: 2;} validator: DoubleValidator {bottom: 6.0; top: 48.0; decimals: 2;}
onEditingFinished: { onEditingFinished: {
var point = parseFloat(text) var point = parseFloat(text)
if(point >= 6.0 && point <= 48.0) if(point >= 6.0 && point <= 48.0)
QGroundControl.baseFontPointSize = point; QGroundControl.baseFontPointSize = point;
} }
} }
Rectangle {
width: baseFontEdit.height QGCButton {
height: width width: height
color: qgcPal.button height: baseFontEdit.height
QGCLabel {
text: "+" text: "+"
anchors.centerIn: parent
}
MouseArea {
anchors.fill: parent
onClicked: { onClicked: {
if(ScreenTools.defaultFontPointSize < 49) if(ScreenTools.defaultFontPointSize < 49) {
QGroundControl.baseFontPointSize = QGroundControl.baseFontPointSize + 1 QGroundControl.baseFontPointSize = QGroundControl.baseFontPointSize + 1
} }
} }
} }
} }
QGCLabel { QGCLabel {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
text: qsTr("(requires reboot to take affect)") text: qsTr("(requires app restart)")
} }
} }
...@@ -129,7 +130,7 @@ Rectangle { ...@@ -129,7 +130,7 @@ Rectangle {
spacing: ScreenTools.defaultFontPixelWidth spacing: ScreenTools.defaultFontPixelWidth
QGCLabel { QGCLabel {
width: _firstLabelWidth width: baseFontLabel.width
anchors.baseline: distanceUnitsCombo.baseline anchors.baseline: distanceUnitsCombo.baseline
text: qsTr("Distance units:") text: qsTr("Distance units:")
} }
...@@ -143,7 +144,7 @@ Rectangle { ...@@ -143,7 +144,7 @@ Rectangle {
QGCLabel { QGCLabel {
anchors.baseline: distanceUnitsCombo.baseline anchors.baseline: distanceUnitsCombo.baseline
text: qsTr("(requires reboot to take affect)") text: qsTr("(requires app restart)")
} }
} }
...@@ -152,8 +153,8 @@ Rectangle { ...@@ -152,8 +153,8 @@ Rectangle {
spacing: ScreenTools.defaultFontPixelWidth spacing: ScreenTools.defaultFontPixelWidth
QGCLabel { QGCLabel {
width: baseFontLabel.width
anchors.baseline: speedUnitsCombo.baseline anchors.baseline: speedUnitsCombo.baseline
width: _firstLabelWidth
text: qsTr("Speed units:") text: qsTr("Speed units:")
} }
...@@ -166,10 +167,15 @@ Rectangle { ...@@ -166,10 +167,15 @@ Rectangle {
QGCLabel { QGCLabel {
anchors.baseline: speedUnitsCombo.baseline anchors.baseline: speedUnitsCombo.baseline
text: qsTr("(requires reboot to take affect)") text: qsTr("(requires app restart)")
} }
} }
Item {
height: ScreenTools.defaultFontPixelHeight / 2
width: parent.width
}
//----------------------------------------------------------------- //-----------------------------------------------------------------
//-- Scale on Flight View //-- Scale on Flight View
QGCCheckBox { QGCCheckBox {
...@@ -246,7 +252,7 @@ Rectangle { ...@@ -246,7 +252,7 @@ Rectangle {
QGCCheckBox { QGCCheckBox {
id: announcePercentCheckbox id: announcePercentCheckbox
anchors.baseline: announcePercent.baseline anchors.baseline: announcePercent.baseline
text: qsTr("Announce battery percent lower than:") text: qsTr("Announce battery lower than:")
checked: _percentRemainingAnnounce.value != 0 checked: _percentRemainingAnnounce.value != 0
onClicked: { onClicked: {
...@@ -269,15 +275,18 @@ Rectangle { ...@@ -269,15 +275,18 @@ Rectangle {
height: ScreenTools.defaultFontPixelHeight / 2 height: ScreenTools.defaultFontPixelHeight / 2
width: parent.width width: parent.width
} }
//----------------------------------------------------------------- //-----------------------------------------------------------------
//-- Map Providers //-- Map Providers
Row { Row {
spacing: ScreenTools.defaultFontPixelWidth spacing: ScreenTools.defaultFontPixelWidth
QGCLabel { QGCLabel {
id: mapProvidersLabel
anchors.baseline: mapProviders.baseline anchors.baseline: mapProviders.baseline
width: _firstLabelWidth
text: qsTr("Map Providers:") text: qsTr("Map Providers:")
} }
QGCComboBox { QGCComboBox {
id: mapProviders id: mapProviders
width: _editFieldWidth width: _editFieldWidth
...@@ -303,16 +312,19 @@ Rectangle { ...@@ -303,16 +312,19 @@ Rectangle {
//-- Palette Styles //-- Palette Styles
Row { Row {
spacing: ScreenTools.defaultFontPixelWidth spacing: ScreenTools.defaultFontPixelWidth
QGCLabel { QGCLabel {
width: mapProvidersLabel.width
anchors.baseline: paletteCombo.baseline anchors.baseline: paletteCombo.baseline
width: _firstLabelWidth
text: qsTr("Style:") text: qsTr("Style:")
} }
QGCComboBox { QGCComboBox {
id: paletteCombo id: paletteCombo
width: _editFieldWidth width: _editFieldWidth
model: [ qsTr("Indoor"), qsTr("Outdoor") ] model: [ qsTr("Indoor"), qsTr("Outdoor") ]
currentIndex: QGroundControl.isDarkStyle ? 0 : 1 currentIndex: QGroundControl.isDarkStyle ? 0 : 1
onActivated: { onActivated: {
if (index != -1) { if (index != -1) {
currentIndex = index currentIndex = index
...@@ -392,13 +404,13 @@ Rectangle { ...@@ -392,13 +404,13 @@ Rectangle {
spacing: ScreenTools.defaultFontPixelWidth spacing: ScreenTools.defaultFontPixelWidth
QGCLabel { QGCLabel {
text: qsTr("Offline mission editing vehicle type:") text: qsTr("Offline mission editing:")
anchors.baseline: offlineTypeCombo.baseline anchors.baseline: offlineTypeCombo.baseline
} }
FactComboBox { FactComboBox {
id: offlineTypeCombo id: offlineTypeCombo
width: ScreenTools.defaultFontPixelWidth * 25 width: ScreenTools.defaultFontPixelWidth * 18
fact: QGroundControl.offlineEditingFirmwareType fact: QGroundControl.offlineEditingFirmwareType
indexModel: false indexModel: false
} }
......
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