Make recommended mode-window scrollable

CURA-9793
This commit is contained in:
c.lamboo 2022-12-13 17:05:51 +01:00
parent 83603ec8fa
commit 2c7bd7883a
2 changed files with 21 additions and 10 deletions

View file

@ -67,6 +67,10 @@ Item
top: parent.top top: parent.top
} }
visible: currentModeIndex == PrintSetupSelectorContents.Mode.Recommended visible: currentModeIndex == PrintSetupSelectorContents.Mode.Recommended
height: {
const height = base.height - (customPrintSetup.mapToItem(null, 0, 0).y + buttonRow.height + UM.Theme.getSize("default_margin").height);
return Math.min(implicitHeight, height);
}
function onModeChanged() function onModeChanged()
{ {

View file

@ -2,34 +2,41 @@
//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
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import UM 1.6 as UM import UM 1.6 as UM
import Cura 1.6 as Cura import Cura 1.6 as Cura
import ".." import ".."
Item ScrollView
{ {
id: recommendedPrintSetup id: recommendedPrintSetup
height: childrenRect.height + 2 * padding implicitHeight: settingsColumn.height + 2 * padding
property bool settingsEnabled: Cura.ExtruderManager.activeExtruderStackId || extrudersEnabledCount.properties.value == 1 property bool settingsEnabled: Cura.ExtruderManager.activeExtruderStackId || extrudersEnabledCount.properties.value == 1
property real padding: UM.Theme.getSize("default_margin").width
padding: UM.Theme.getSize("default_margin").width
function onModeChanged() {} function onModeChanged() {}
Column ScrollBar.vertical: UM.ScrollBar {
{ id: scroll
spacing: UM.Theme.getSize("default_margin").height
anchors anchors
{ {
left: parent.left
right: parent.right
top: parent.top top: parent.top
margins: parent.padding right: parent.right
bottom: parent.bottom
} }
}
Column
{
id: settingsColumn
spacing: UM.Theme.getSize("default_margin").height
width: recommendedPrintSetup.width - 2 * recommendedPrintSetup.padding - (scroll.visible ? scroll.width : 0)
// TODO // TODO
property real firstColumnWidth: Math.round(width / 3) property real firstColumnWidth: Math.round(width / 3)