mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-10-04 18:26:30 +08:00
Add scrollview to nested material list
CURA-6867
This commit is contained in:
parent
d4679515b6
commit
e0a091e768
@ -105,6 +105,9 @@ Cura.MenuItem
|
|||||||
var parentGlobalX = parent.mapToItem(null, 0, 0).x
|
var parentGlobalX = parent.mapToItem(null, 0, 0).x
|
||||||
var overflowX = (parentGlobalX + defaultX + menuPopup.width) - mainWindow.width
|
var overflowX = (parentGlobalX + defaultX + menuPopup.width) - mainWindow.width
|
||||||
x = overflowX > 0 ? overflowX : defaultX
|
x = overflowX > 0 ? overflowX : defaultX
|
||||||
|
|
||||||
|
scrollViewMaterialType.height = popupHeight > mainWindow.height ? mainWindow.height: popupHeight
|
||||||
|
menuPopup.height = popupHeight > mainWindow.height ? mainWindow.height: popupHeight
|
||||||
}
|
}
|
||||||
|
|
||||||
padding: background.border.width
|
padding: background.border.width
|
||||||
@ -128,9 +131,26 @@ Cura.MenuItem
|
|||||||
border.width: UM.Theme.getSize("default_lining").width
|
border.width: UM.Theme.getSize("default_lining").width
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ScrollView
|
||||||
|
{
|
||||||
|
id: scrollViewMaterialType
|
||||||
|
width: UM.Theme.getSize("menu").width + scrollbar.width
|
||||||
|
height: parent.height
|
||||||
|
clip: true
|
||||||
|
|
||||||
|
ScrollBar.vertical: UM.ScrollBar
|
||||||
|
{
|
||||||
|
id: scrollbar
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
}
|
||||||
|
|
||||||
Column
|
Column
|
||||||
{
|
{
|
||||||
id: materialTypesList
|
id: materialTypesList
|
||||||
|
width: UM.Theme.getSize("menu").width
|
||||||
|
height: parent.height
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
property var brandMaterials: materialTypesModel.material_types
|
property var brandMaterials: materialTypesModel.material_types
|
||||||
@ -255,7 +275,6 @@ Cura.MenuItem
|
|||||||
var overflowX = (parentGlobalX + parent.width + colorPopup.width) - mainWindow.width
|
var overflowX = (parentGlobalX + parent.width + colorPopup.width) - mainWindow.width
|
||||||
x = overflowX > 0 ? parent.width - overflowX : parent.width
|
x = overflowX > 0 ? parent.width - overflowX : parent.width
|
||||||
|
|
||||||
var popupHeight = model.colors.count * UM.Theme.getSize("menu").height
|
|
||||||
scrollView.height = popupHeight > mainWindow.height ? mainWindow.height: popupHeight
|
scrollView.height = popupHeight > mainWindow.height ? mainWindow.height: popupHeight
|
||||||
colorPopup.height = popupHeight > mainWindow.height ? mainWindow.height: popupHeight
|
colorPopup.height = popupHeight > mainWindow.height ? mainWindow.height: popupHeight
|
||||||
}
|
}
|
||||||
@ -301,7 +320,7 @@ Cura.MenuItem
|
|||||||
height: UM.Theme.getSize("menu").height
|
height: UM.Theme.getSize("menu").height
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
|
||||||
// color: materialColorButton.containsMouse ? UM.Theme.getColor("background_2") : UM.Theme.getColor("background_1")
|
color: materialColorButton.containsMouse ? UM.Theme.getColor("background_2") : UM.Theme.getColor("background_1")
|
||||||
|
|
||||||
Rectangle
|
Rectangle
|
||||||
{
|
{
|
||||||
@ -372,3 +391,4 @@ Cura.MenuItem
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user