From e40a219b53d5ae414bea28fec3b14903aea573e2 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Fri, 1 Apr 2022 11:36:22 +0200 Subject: [PATCH 1/6] Add back code for resizing contentContainer. This makes sure that the background get smaller when the setting container is resized. CURA-8640 --- resources/qml/ExpandableComponent.qml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/resources/qml/ExpandableComponent.qml b/resources/qml/ExpandableComponent.qml index 3742c6d5e5..6717be94a5 100644 --- a/resources/qml/ExpandableComponent.qml +++ b/resources/qml/ExpandableComponent.qml @@ -307,4 +307,16 @@ 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 + } + } } From 0ab8f278b27991b0c87cd2eb673859c7d04bd9ef Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 1 Apr 2022 13:16:14 +0200 Subject: [PATCH 2/6] Add hack to get mouse handling working again --- resources/qml/Cura.qml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index 2b419a5d76..4bfc2959a2 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -48,6 +48,22 @@ UM.MainWindow 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 { id: greyOutBackground From a92a9dd4c0c7ab8e4c8439f9dbbaf0a03397359d Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 1 Apr 2022 13:22:53 +0200 Subject: [PATCH 3/6] Fix context menu settings --- resources/qml/Settings/SettingItem.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Settings/SettingItem.qml b/resources/qml/Settings/SettingItem.qml index b7c276369d..6787855775 100644 --- a/resources/qml/Settings/SettingItem.qml +++ b/resources/qml/Settings/SettingItem.qml @@ -97,7 +97,7 @@ Item anchors.fill: parent - acceptedButtons: Qt.MouseButton.RightButton + acceptedButtons: Qt.RightButton hoverEnabled: true; onClicked: base.contextMenuRequested() From e0ec64ee0e000bdb3f53b4483410631587f401a7 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 1 Apr 2022 13:40:29 +0200 Subject: [PATCH 4/6] Fix deleting item with backspace --- resources/qml/Cura.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index 4bfc2959a2..61b4813d28 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -164,7 +164,7 @@ UM.MainWindow //DeleteSelection on the keypress backspace event Keys.onPressed: { - if (event.key == Qt.Key.Key_Backspace) + if (event.key == Qt.Key_Backspace) { Cura.Actions.deleteSelection.trigger() } From 4520fc15f9bebed8b781c327c1d19759e9555c95 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 1 Apr 2022 13:45:11 +0200 Subject: [PATCH 5/6] Fix display of UM monitor page --- .../resources/qml/MonitorCarousel.qml | 37 +++---------------- 1 file changed, 5 insertions(+), 32 deletions(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorCarousel.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorCarousel.qml index e604b7af1c..df6748cc36 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorCarousel.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorCarousel.qml @@ -38,24 +38,10 @@ Item } height: parent.height z: 10 - LinearGradient + Rectangle { anchors.fill: parent - start: Qt.point(0, 0) - 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") - } - } + color: UM.Theme.getColor("monitor_stage_background") } MouseArea { @@ -193,24 +179,11 @@ Item height: centerSection.height z: 10 - LinearGradient + Rectangle { anchors.fill: parent - start: Qt.point(0, 0) - 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") - } - } + color: UM.Theme.getColor("monitor_stage_background_fade") + } MouseArea { From 3a1862f15f3b010d9c12aa95b6e98ab4a54ec342 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 1 Apr 2022 13:47:21 +0200 Subject: [PATCH 6/6] Fix deprecation warning on recentfilesmenu --- resources/qml/Menus/RecentFilesMenu.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/qml/Menus/RecentFilesMenu.qml b/resources/qml/Menus/RecentFilesMenu.qml index 8f4f328927..19ff681219 100644 --- a/resources/qml/Menus/RecentFilesMenu.qml +++ b/resources/qml/Menus/RecentFilesMenu.qml @@ -29,7 +29,7 @@ Cura.Menu } onTriggered: CuraApplication.readLocalFile(modelData) } - onObjectAdded: menu.insertItem(index, object) - onObjectRemoved: menu.removeItem(object) + onObjectAdded: (index, object) => menu.insertItem(index, object) + onObjectRemoved: (object) => menu.removeItem(object) } }