mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-24 15:13:56 -06:00
Use custom scroll bar for object selector
Contributes to issue CURA-8686.
This commit is contained in:
parent
796779316f
commit
08b8dcfa43
1 changed files with 10 additions and 11 deletions
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) 2020 Ultimaker B.V.
|
||||
// Copyright (c) 2022 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.10
|
||||
|
@ -76,7 +76,7 @@ Item
|
|||
id: contents
|
||||
width: parent.width
|
||||
visible: objectSelector.opened
|
||||
height: visible ? listView.height : 0
|
||||
height: visible ? listView.height + border.width * 2 : 0
|
||||
color: UM.Theme.getColor("main_background")
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color: UM.Theme.getColor("lining")
|
||||
|
@ -99,23 +99,22 @@ Item
|
|||
ListView
|
||||
{
|
||||
id: listView
|
||||
clip: true
|
||||
anchors
|
||||
{
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
top: parent.top
|
||||
margins: UM.Theme.getSize("default_lining").width
|
||||
}
|
||||
|
||||
ScrollBar.vertical: ScrollBar
|
||||
{
|
||||
hoverEnabled: true
|
||||
}
|
||||
|
||||
property real maximumHeight: UM.Theme.getSize("objects_menu_size").height
|
||||
|
||||
height: Math.min(contentHeight, maximumHeight)
|
||||
|
||||
ScrollBar.vertical: UM.ScrollBar
|
||||
{
|
||||
id: scrollBar
|
||||
}
|
||||
clip: true
|
||||
|
||||
model: Cura.ObjectsModel {}
|
||||
|
||||
delegate: ObjectItemButton
|
||||
|
@ -128,7 +127,7 @@ Item
|
|||
value: model.selected
|
||||
}
|
||||
text: model.name
|
||||
width: listView.width
|
||||
width: listView.width - scrollBar.width
|
||||
property bool outsideBuildArea: model.outside_build_area
|
||||
property int perObjectSettingsCount: model.per_object_settings_count
|
||||
property string meshType: model.mesh_type
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue