Commit 0c7e970a authored by Don Gagne's avatar Don Gagne

Fix for small screens

parent 5a508286
...@@ -11,6 +11,7 @@ Text { ...@@ -11,6 +11,7 @@ Text {
property bool enabled: true property bool enabled: true
font.pixelSize: ScreenTools.defaultFontPixelSize font.pixelSize: ScreenTools.defaultFontPixelSize
fontSizeMode: Text.HorizontalFit
color: __qgcPal.text color: __qgcPal.text
antialiasing: true antialiasing: true
} }
...@@ -156,6 +156,7 @@ Rectangle { ...@@ -156,6 +156,7 @@ Rectangle {
errorDialog.visible = false errorDialog.visible = false
} }
} }
Rectangle { Rectangle {
id: _offlineMapTopRect id: _offlineMapTopRect
width: parent.width width: parent.width
...@@ -180,25 +181,29 @@ Rectangle { ...@@ -180,25 +181,29 @@ Rectangle {
} }
} }
} }
QGCFlickable { QGCFlickable {
id: _tileSetList id: _tileSetList
clip: true clip: true
anchors.top: _offlineMapTopRect.bottom anchors.top: _offlineMapTopRect.bottom
width: parent.width anchors.left: parent.left
height: parent.height - _offlineMapTopRect.height anchors.right: parent.right
anchors.bottom: _optionsButton.top
contentHeight: _cacheList.height contentHeight: _cacheList.height
contentWidth: parent.width
flickableDirection: Flickable.VerticalFlick flickableDirection: Flickable.VerticalFlick
Column { Column {
id: _cacheList id: _cacheList
width: _offlineMapRoot.width width: Math.min(parent.width, (ScreenTools.defaultFontPixelWidth * 50).toFixed(0))
anchors.margins: ScreenTools.defaultFontPixelWidth anchors.margins: ScreenTools.defaultFontPixelWidth
spacing: (ScreenTools.defaultFontPixelHeight * 0.5).toFixed(0) spacing: (ScreenTools.defaultFontPixelHeight * 0.5).toFixed(0)
anchors.horizontalCenter: parent.horizontalCenter
OfflineMapButton { OfflineMapButton {
text: "Add new set" text: "Add new set"
width: (ScreenTools.defaultFontPixelWidth * 50).toFixed(0) anchors.left: parent.left
anchors.right: parent.right
height: (ScreenTools.defaultFontPixelHeight * 2).toFixed(0) height: (ScreenTools.defaultFontPixelHeight * 2).toFixed(0)
anchors.horizontalCenter: parent.horizontalCenter
onClicked: { onClicked: {
_offlineMapRoot._currentSelection = null _offlineMapRoot._currentSelection = null
showMap() showMap()
...@@ -210,9 +215,9 @@ Rectangle { ...@@ -210,9 +215,9 @@ Rectangle {
text: object.name text: object.name
size: object.downloadStatus size: object.downloadStatus
complete: object.complete complete: object.complete
width: (ScreenTools.defaultFontPixelWidth * 50).toFixed(0) anchors.left: parent.left
anchors.right: parent.right
height: (ScreenTools.defaultFontPixelHeight * 2).toFixed(0) height: (ScreenTools.defaultFontPixelHeight * 2).toFixed(0)
anchors.horizontalCenter: parent.horizontalCenter
onClicked: { onClicked: {
_offlineMapRoot._currentSelection = object _offlineMapRoot._currentSelection = object
showInfo() showInfo()
...@@ -221,16 +226,17 @@ Rectangle { ...@@ -221,16 +226,17 @@ Rectangle {
} }
} }
} }
QGCButton { QGCButton {
id: _optionsButton id: _optionsButton
text: "Options" text: "Options"
width: ScreenTools.defaultFontPixelWidth * 10
visible: _tileSetList.visible visible: _tileSetList.visible
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.right: parent.right anchors.right: parent.right
anchors.margins: ScreenTools.defaultFontPixelWidth anchors.margins: ScreenTools.defaultFontPixelWidth
onClicked: showOptions() onClicked: showOptions()
} }
//-- Offline Map Definition //-- Offline Map Definition
Rectangle { Rectangle {
id: _mapView id: _mapView
......
...@@ -42,6 +42,7 @@ Item { ...@@ -42,6 +42,7 @@ Item {
readonly property int __animationDuration: 100 readonly property int __animationDuration: 100
readonly property real __closeButtonSize: ScreenTools.defaultFontPixelHeight * 2 readonly property real __closeButtonSize: ScreenTools.defaultFontPixelHeight * 2
readonly property real _margins: ScreenTools.defaultFontPixelHeight / 2
onVisibleChanged: { onVisibleChanged: {
//-- Unselect any selected button //-- Unselect any selected button
...@@ -129,31 +130,40 @@ Item { ...@@ -129,31 +130,40 @@ Item {
// This is the menu dialog panel which is anchored to the left edge // This is the menu dialog panel which is anchored to the left edge
Rectangle { Rectangle {
id: __leftMenu id: __leftMenu
width: (tbButtonWidth * 2) + (tbSpacing * 4) + 1 width: ScreenTools.defaultFontPixelWidth * 12
anchors.left: parent.left anchors.left: parent.left
anchors.top: __topSeparator.bottom anchors.top: __topSeparator.bottom
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
color: __qgcPal.windowShadeDark color: __qgcPal.windowShadeDark
QGCFlickable {
anchors.fill: parent
contentHeight: buttonColumn.height + _margins
flickableDirection: Flickable.VerticalFlick
clip: true
ExclusiveGroup { id: panelActionGroup } ExclusiveGroup { id: panelActionGroup }
Column { Column {
width: parent.width id: buttonColumn
anchors.leftMargin: _margins
anchors.rightMargin: _margins
anchors.left: parent.left
anchors.right: parent.right
anchors.topMargin: _margins
anchors.top: parent.top
spacing: ScreenTools.defaultFontPixelHeight spacing: ScreenTools.defaultFontPixelHeight
Item {
width: 1
height: ScreenTools.defaultFontPixelHeight * 0.5
}
QGCLabel { QGCLabel {
text: "Preferences" text: "Preferences"
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
} }
QGCButton { QGCButton {
width: parent.width * 0.85 anchors.left: parent.left
height: ScreenTools.defaultFontPixelHeight * 2.5 anchors.right: parent.right
text: "General" text: "General"
exclusiveGroup: panelActionGroup exclusiveGroup: panelActionGroup
anchors.horizontalCenter: parent.horizontalCenter
onClicked: { onClicked: {
if(__rightPanel.source != "GeneralSettings.qml") { if(__rightPanel.source != "GeneralSettings.qml") {
__rightPanel.source = "GeneralSettings.qml" __rightPanel.source = "GeneralSettings.qml"
...@@ -161,12 +171,12 @@ Item { ...@@ -161,12 +171,12 @@ Item {
checked = true checked = true
} }
} }
QGCButton { QGCButton {
width: parent.width * 0.85 anchors.left: parent.left
height: ScreenTools.defaultFontPixelHeight * 2.5 anchors.right: parent.right
text: "Comm Links" text: "Comm Links"
exclusiveGroup: panelActionGroup exclusiveGroup: panelActionGroup
anchors.horizontalCenter: parent.horizontalCenter
onClicked: { onClicked: {
if(__rightPanel.source != "LinkSettings.qml") { if(__rightPanel.source != "LinkSettings.qml") {
__rightPanel.source = "LinkSettings.qml" __rightPanel.source = "LinkSettings.qml"
...@@ -174,12 +184,12 @@ Item { ...@@ -174,12 +184,12 @@ Item {
checked = true checked = true
} }
} }
QGCButton { QGCButton {
width: parent.width * 0.85 anchors.left: parent.left
height: ScreenTools.defaultFontPixelHeight * 2.5 anchors.right: parent.right
text: "Offline Maps" text: "Offline Maps"
exclusiveGroup: panelActionGroup exclusiveGroup: panelActionGroup
anchors.horizontalCenter: parent.horizontalCenter
onClicked: { onClicked: {
if(__rightPanel.source != "OfflineMap.qml") { if(__rightPanel.source != "OfflineMap.qml") {
__rightPanel.source = "OfflineMap.qml" __rightPanel.source = "OfflineMap.qml"
...@@ -187,12 +197,12 @@ Item { ...@@ -187,12 +197,12 @@ Item {
checked = true checked = true
} }
} }
QGCButton { QGCButton {
width: parent.width * 0.85 anchors.left: parent.left
height: ScreenTools.defaultFontPixelHeight * 2.5 anchors.right: parent.right
text: "MavLink" text: "MavLink"
exclusiveGroup: panelActionGroup exclusiveGroup: panelActionGroup
anchors.horizontalCenter: parent.horizontalCenter
onClicked: { onClicked: {
if(__rightPanel.source != "MavlinkSettings.qml") { if(__rightPanel.source != "MavlinkSettings.qml") {
__rightPanel.source = "MavlinkSettings.qml" __rightPanel.source = "MavlinkSettings.qml"
...@@ -200,13 +210,13 @@ Item { ...@@ -200,13 +210,13 @@ Item {
checked = true checked = true
} }
} }
QGCButton { QGCButton {
width: parent.width * 0.85 anchors.left: parent.left
height: ScreenTools.defaultFontPixelHeight * 2.5 anchors.right: parent.right
text: "Mock Link" text: "Mock Link"
visible: ScreenTools.isDebug visible: ScreenTools.isDebug
exclusiveGroup: panelActionGroup exclusiveGroup: panelActionGroup
anchors.horizontalCenter: parent.horizontalCenter
onClicked: { onClicked: {
if(__rightPanel.source != "MockLink.qml") { if(__rightPanel.source != "MockLink.qml") {
__rightPanel.source = "MockLink.qml" __rightPanel.source = "MockLink.qml"
...@@ -214,13 +224,13 @@ Item { ...@@ -214,13 +224,13 @@ Item {
checked = true checked = true
} }
} }
QGCButton { QGCButton {
width: parent.width * 0.85 anchors.left: parent.left
height: ScreenTools.defaultFontPixelHeight * 2.5 anchors.right: parent.right
text: "Debug" text: "Debug"
visible: ScreenTools.isDebug visible: ScreenTools.isDebug
exclusiveGroup: panelActionGroup exclusiveGroup: panelActionGroup
anchors.horizontalCenter: parent.horizontalCenter
onClicked: { onClicked: {
if(__rightPanel.source != "DebugWindow.qml") { if(__rightPanel.source != "DebugWindow.qml") {
__rightPanel.source = "DebugWindow.qml" __rightPanel.source = "DebugWindow.qml"
...@@ -230,6 +240,7 @@ Item { ...@@ -230,6 +240,7 @@ Item {
} }
} }
} }
}
//-- Clicking in tool bar area dismiss it all //-- Clicking in tool bar area dismiss it all
MouseArea { MouseArea {
......
...@@ -49,14 +49,13 @@ Rectangle { ...@@ -49,14 +49,13 @@ Rectangle {
clip: true clip: true
anchors.fill: parent anchors.fill: parent
contentHeight: settingsColumn.height contentHeight: settingsColumn.height
contentWidth: _generalRoot.width contentWidth: settingsColumn.width
flickableDirection: Flickable.VerticalFlick
Column { Column {
id: settingsColumn id: settingsColumn
width: _generalRoot.width
anchors.margins: ScreenTools.defaultFontPixelWidth anchors.margins: ScreenTools.defaultFontPixelWidth
spacing: ScreenTools.defaultFontPixelHeight / 2 spacing: ScreenTools.defaultFontPixelHeight / 2
QGCLabel { QGCLabel {
text: "General Settings" text: "General Settings"
font.pixelSize: ScreenTools.mediumFontPixelSize font.pixelSize: ScreenTools.mediumFontPixelSize
......
...@@ -134,7 +134,6 @@ Rectangle { ...@@ -134,7 +134,6 @@ Rectangle {
} }
} }
QGCButton { QGCButton {
width: ScreenTools.defaultFontPixelWidth * 10
text: "Edit" text: "Edit"
enabled: _currentSelection && !_currentSelection.link enabled: _currentSelection && !_currentSelection.link
onClicked: { onClicked: {
...@@ -142,14 +141,12 @@ Rectangle { ...@@ -142,14 +141,12 @@ Rectangle {
} }
} }
QGCButton { QGCButton {
width: ScreenTools.defaultFontPixelWidth * 10
text: "Add" text: "Add"
onClicked: { onClicked: {
_linkRoot.openCommSettings(null) _linkRoot.openCommSettings(null)
} }
} }
QGCButton { QGCButton {
width: ScreenTools.defaultFontPixelWidth * 10
text: "Connect" text: "Connect"
enabled: _currentSelection && !_currentSelection.link enabled: _currentSelection && !_currentSelection.link
onClicked: { onClicked: {
...@@ -158,7 +155,6 @@ Rectangle { ...@@ -158,7 +155,6 @@ Rectangle {
} }
} }
QGCButton { QGCButton {
width: ScreenTools.defaultFontPixelWidth * 10
text: "Disconnect" text: "Disconnect"
enabled: _currentSelection && _currentSelection.link enabled: _currentSelection && _currentSelection.link
onClicked: { onClicked: {
......
...@@ -48,14 +48,14 @@ Rectangle { ...@@ -48,14 +48,14 @@ Rectangle {
anchors.fill: parent anchors.fill: parent
anchors.margins: ScreenTools.defaultFontPixelWidth anchors.margins: ScreenTools.defaultFontPixelWidth
contentHeight: settingsColumn.height contentHeight: settingsColumn.height
contentWidth: __mavlinkRoot.width contentWidth: settingsColumn.width
flickableDirection: Flickable.VerticalFlick
Column { Column {
id: settingsColumn id: settingsColumn
width: __mavlinkRoot.width
spacing: ScreenTools.defaultFontPixelHeight spacing: ScreenTools.defaultFontPixelHeight
anchors.margins: ScreenTools.defaultFontPixelWidth anchors.margins: ScreenTools.defaultFontPixelWidth
anchors.left: parent.left
anchors.top: parent.top
QGCLabel { QGCLabel {
text: "MavLink Settings" text: "MavLink Settings"
font.pixelSize: ScreenTools.mediumFontPixelSize font.pixelSize: ScreenTools.mediumFontPixelSize
......
...@@ -30,10 +30,18 @@ import QGroundControl.ScreenTools 1.0 ...@@ -30,10 +30,18 @@ import QGroundControl.ScreenTools 1.0
Rectangle { Rectangle {
color: qgcPal.window color: qgcPal.window
anchors.fill: parent
QGCPalette { id: qgcPal; colorGroupEnabled: true } QGCPalette { id: qgcPal; colorGroupEnabled: true }
QGCFlickable {
anchors.fill: parent
contentWidth: column.width
contentHeight: column.height
clip: true
Column { Column {
id: column
anchors.margins: ScreenTools.defaultFontPixelHeight anchors.margins: ScreenTools.defaultFontPixelHeight
anchors.left: parent.left anchors.left: parent.left
anchors.top: parent.top anchors.top: parent.top
...@@ -64,4 +72,5 @@ Rectangle { ...@@ -64,4 +72,5 @@ Rectangle {
onClicked: QGroundControl.stopAllMockLinks() onClicked: QGroundControl.stopAllMockLinks()
} }
} }
}
} }
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