Merge remote-tracking branch 'origin/qt6_beyond_the_splash' into qt6_beyond_the_splash

This commit is contained in:
c.lamboo 2022-04-01 14:56:52 +02:00
commit 90f03befc8
5 changed files with 37 additions and 36 deletions

View File

@ -38,24 +38,10 @@ Item
} }
height: parent.height height: parent.height
z: 10 z: 10
LinearGradient Rectangle
{ {
anchors.fill: parent anchors.fill: parent
start: Qt.point(0, 0) color: UM.Theme.getColor("monitor_stage_background")
end: Qt.point(leftHint.width, 0)
gradient: Gradient
{
GradientStop
{
position: 0.0
color: UM.Theme.getColor("monitor_stage_background")
}
GradientStop
{
position: 1.0
color: UM.Theme.getColor("monitor_stage_background_fade")
}
}
} }
MouseArea MouseArea
{ {
@ -193,24 +179,11 @@ Item
height: centerSection.height height: centerSection.height
z: 10 z: 10
LinearGradient Rectangle
{ {
anchors.fill: parent anchors.fill: parent
start: Qt.point(0, 0) color: UM.Theme.getColor("monitor_stage_background_fade")
end: Qt.point(rightHint.width, 0)
gradient: Gradient
{
GradientStop
{
position: 0.0
color: UM.Theme.getColor("monitor_stage_background_fade")
}
GradientStop
{
position: 1.0
color: UM.Theme.getColor("monitor_stage_background")
}
}
} }
MouseArea MouseArea
{ {

View File

@ -48,6 +48,22 @@ UM.MainWindow
tooltip.hide(); tooltip.hide();
} }
MouseArea
{
// Hack introduced when switching to qt6
// We used to be able to let the main window's default handlers control this, but something seems to be changed
// for qt6 in the ordering. TODO; We should find out what changed and have a less hacky fix for that.
enabled: parent.visible
anchors.fill: parent
hoverEnabled: true
acceptedButtons: Qt.AllButtons
onPositionChanged: (mouse) => {base.mouseMoved(mouse);}
onPressed: (mouse) => { base.mousePressed(mouse);}
onReleased: (mouse) => { base.mouseReleased(mouse);}
onWheel: (wheel) => {base.wheel(wheel)}
}
Rectangle Rectangle
{ {
id: greyOutBackground id: greyOutBackground
@ -148,7 +164,7 @@ UM.MainWindow
//DeleteSelection on the keypress backspace event //DeleteSelection on the keypress backspace event
Keys.onPressed: Keys.onPressed:
{ {
if (event.key == Qt.Key.Key_Backspace) if (event.key == Qt.Key_Backspace)
{ {
Cura.Actions.deleteSelection.trigger() Cura.Actions.deleteSelection.trigger()
} }

View File

@ -307,4 +307,16 @@ Item
contentItem: Item {} contentItem: Item {}
} }
} }
// DO NOT MOVE UP IN THE CODE: This connection has to be here, after the definition of the content item.
// Apparently the order in which these are handled matters and so the height is correctly updated if this is here.
Connections
{
// Since it could be that the content is dynamically populated, we should also take these changes into account.
target: content.contentItem
function onHeightChanged()
{
contentContainer.height = contentHeader.height + content.height
}
}
} }

View File

@ -29,7 +29,7 @@ Cura.Menu
} }
onTriggered: CuraApplication.readLocalFile(modelData) onTriggered: CuraApplication.readLocalFile(modelData)
} }
onObjectAdded: menu.insertItem(index, object) onObjectAdded: (index, object) => menu.insertItem(index, object)
onObjectRemoved: menu.removeItem(object) onObjectRemoved: (object) => menu.removeItem(object)
} }
} }

View File

@ -97,7 +97,7 @@ Item
anchors.fill: parent anchors.fill: parent
acceptedButtons: Qt.MouseButton.RightButton acceptedButtons: Qt.RightButton
hoverEnabled: true; hoverEnabled: true;
onClicked: base.contextMenuRequested() onClicked: base.contextMenuRequested()