Fix variant poup on Linux
Maybe WM specific, but sizing the window late seems to trigger a bug. Fixes repeated variant selection on Ubuntu for me.
This commit is contained in:
parent
6475ae32b1
commit
a311e744ff
1 changed files with 7 additions and 4 deletions
|
@ -72,7 +72,7 @@ Rectangle {
|
||||||
|
|
||||||
popupFrame.x = screenPos.x;
|
popupFrame.x = screenPos.x;
|
||||||
popupFrame.y = screenPos.y;
|
popupFrame.y = screenPos.y;
|
||||||
popupFrame.visible = true
|
popupFrame.show()
|
||||||
tracker.window = popupFrame
|
tracker.window = popupFrame
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -92,7 +92,6 @@ Rectangle {
|
||||||
width: root.width
|
width: root.width
|
||||||
flags: Qt.Popup
|
flags: Qt.Popup
|
||||||
height: choicesColumn.childrenRect.height
|
height: choicesColumn.childrenRect.height
|
||||||
visible: false
|
|
||||||
color: "white"
|
color: "white"
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
@ -105,7 +104,11 @@ Rectangle {
|
||||||
id: choicesColumn
|
id: choicesColumn
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
model: popupFrame.visible ? aircraftInfo.variantNames : 0
|
// would prefer the model to be conditional on visiblity,
|
||||||
|
// but this trips up the Window sizing on Linux (Ubuntu at
|
||||||
|
// least) and we get a mis-aligned origin
|
||||||
|
model: aircraftInfo.variantNames
|
||||||
|
|
||||||
delegate: Item {
|
delegate: Item {
|
||||||
width: popupFrame.width
|
width: popupFrame.width
|
||||||
height: choiceText.implicitHeight
|
height: choiceText.implicitHeight
|
||||||
|
@ -130,8 +133,8 @@ Rectangle {
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
popupFrame.hide()
|
||||||
root.selected(model.index)
|
root.selected(model.index)
|
||||||
popupFrame.visible = false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // of delegate Item
|
} // of delegate Item
|
||||||
|
|
Loading…
Add table
Reference in a new issue