From 08b8dcfa43d55bafbf3abcef04ba542f90910a50 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 19 Jan 2022 17:59:41 +0100 Subject: [PATCH] Use custom scroll bar for object selector Contributes to issue CURA-8686. --- resources/qml/ObjectSelector.qml | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/resources/qml/ObjectSelector.qml b/resources/qml/ObjectSelector.qml index 5f7de1f301..db68ff6c03 100644 --- a/resources/qml/ObjectSelector.qml +++ b/resources/qml/ObjectSelector.qml @@ -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