Commit 12ed0dc8 authored by DonLakeFlyer's avatar DonLakeFlyer

parent ccd2a1ed
......@@ -545,7 +545,7 @@ Column {
ColorDialog {
id: colorPickerDialog
modality: Qt.ApplicationModal
currentColor: instrumentValue.rangeColors[colorIndex]
currentColor: instrumentValue.rangeColors.length ? instrumentValue.rangeColors[colorIndex] : "white"
onAccepted: updateColorValue(colorIndex, color)
property int colorIndex: 0
......
......@@ -23,8 +23,8 @@ Popup {
id: popupRoot
anchors.centerIn: parent
width: mainFlickable.width + (padding * 2)
height: mainFlickable.height + (padding * 2)
width: mainColumnLayout.width + (padding * 2)
height: mainColumnLayout.y + mainColumnLayout.height + padding
padding: 2
modal: true
focus: true
......@@ -34,8 +34,8 @@ Popup {
property string _dialogTitle
property real _contentMargin: ScreenTools.defaultFontPixelHeight / 2
property real _popupDoubleInset: ScreenTools.defaultFontPixelHeight * 2
property real _maxAvailableWidth: parent.width - _popupDoubleInset
property real _maxAvailableHeight: parent.height - _popupDoubleInset
property real _maxContentWidth: parent.width - _popupDoubleInset
property real _maxContentHeight: parent.height - titleRowLayout.height - _popupDoubleInset
background: Item {
Rectangle {
......@@ -160,13 +160,6 @@ Popup {
onHideDialog: close()
}
QGCFlickable {
id: mainFlickable
width: Math.min(mainColumnLayout.width, _maxAvailableWidth)
height: Math.min(mainColumnLayout.height, _maxAvailableHeight)
contentWidth: mainColumnLayout.width
contentHeight: mainColumnLayout.height
Rectangle {
width: titleRowLayout.width
height: titleRowLayout.height
......@@ -184,7 +177,7 @@ Popup {
QGCLabel {
Layout.leftMargin: ScreenTools.defaultFontPixelWidth
Layout.fillWidth: true
text: title
text: _dialogTitle
height: parent.height
verticalAlignment: Text.AlignVCenter
}
......@@ -201,10 +194,17 @@ Popup {
}
}
QGCFlickable {
id: mainFlickable
Layout.preferredWidth: Math.min(marginItem.width, _maxContentWidth)
Layout.preferredHeight: Math.min(marginItem.height, _maxContentHeight)
contentWidth: marginItem.width
contentHeight: marginItem.height
Item {
id: item
Layout.preferredWidth: dialogComponentLoader.width + (_contentMargin * 2)
Layout.preferredHeight: dialogComponentLoader.height + _contentMargin
id: marginItem
width: dialogComponentLoader.width + (_contentMargin * 2)
height: dialogComponentLoader.height + _contentMargin
Loader {
id: dialogComponentLoader
......
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