Don't scroll beyond bounds in recommended menu

CURA-10650
This commit is contained in:
c.lamboo 2023-06-06 16:31:36 +02:00
parent 1bf5d740ef
commit 57bece831f

View File

@ -1,4 +1,4 @@
// Copyright (c) 2022 UltiMaker // Copyright (c) 2023 UltiMaker
//Cura is released under the terms of the LGPLv3 or higher. //Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.10 import QtQuick 2.10
@ -9,16 +9,16 @@ import UM 1.6 as UM
import Cura 1.6 as Cura import Cura 1.6 as Cura
import ".." import ".."
ScrollView Flickable
{ {
id: recommendedPrintSetup id: recommendedPrintSetup
clip: true
implicitHeight: settingsColumn.height + 2 * padding contentHeight: settingsColumn.height
implicitHeight: settingsColumn.height
property bool settingsEnabled: Cura.ExtruderManager.activeExtruderStackId || extrudersEnabledCount.properties.value == 1 property bool settingsEnabled: Cura.ExtruderManager.activeExtruderStackId || extrudersEnabledCount.properties.value == 1
padding: UM.Theme.getSize("default_margin").width
function onModeChanged() {} function onModeChanged() {}
ScrollBar.vertical: UM.ScrollBar { ScrollBar.vertical: UM.ScrollBar {
@ -31,12 +31,15 @@ ScrollView
} }
} }
boundsBehavior: Flickable.StopAtBounds
Column Column
{ {
id: settingsColumn id: settingsColumn
padding: UM.Theme.getSize("default_margin").width
spacing: UM.Theme.getSize("default_margin").height spacing: UM.Theme.getSize("default_margin").height
width: recommendedPrintSetup.width - 2 * recommendedPrintSetup.padding - (scroll.visible ? scroll.width : 0) width: recommendedPrintSetup.width - 2 * padding - (scroll.visible ? scroll.width : 0)
// TODO // TODO
property real firstColumnWidth: Math.round(width / 3) property real firstColumnWidth: Math.round(width / 3)
@ -97,7 +100,6 @@ ScrollView
width: parent.width width: parent.width
UM.Label UM.Label
{ {
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left anchors.left: parent.left
text: catalog.i18nc("@label", "Recommended print settings") text: catalog.i18nc("@label", "Recommended print settings")
font: UM.Theme.getFont("medium") font: UM.Theme.getFont("medium")
@ -106,7 +108,6 @@ ScrollView
Cura.SecondaryButton Cura.SecondaryButton
{ {
id: customSettingsButton id: customSettingsButton
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right anchors.right: parent.right
text: catalog.i18nc("@button", "Show Custom") text: catalog.i18nc("@button", "Show Custom")
textFont: UM.Theme.getFont("medium_bold") textFont: UM.Theme.getFont("medium_bold")