Customise scrollbar for extruder selectors

Contributes to issue CURA-8686.
This commit is contained in:
Ghostkeeper 2022-01-20 17:26:49 +01:00
parent 08b8dcfa43
commit 4f82137035
No known key found for this signature in database
GPG key ID: D2A8871EE34EC59A
4 changed files with 19 additions and 19 deletions

View file

@ -71,7 +71,7 @@ UM.Dialog
} }
ListView ListView
{ {
id: listview id: listview
anchors anchors
{ {

View file

@ -1,9 +1,9 @@
// Copyright (c) 2020 Ultimaker B.V. // Copyright (c) 2022 Ultimaker B.V.
// 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 1.4 import QtQuick.Controls 1.4 as OldControls
import QtQuick.Controls 2.3 as Controls2 import QtQuick.Controls 2.3
import UM 1.5 as UM import UM 1.5 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
@ -73,7 +73,7 @@ Item
} }
} }
Controls2.ComboBox ComboBox
{ {
id: supportExtruderCombobox id: supportExtruderCombobox
@ -200,7 +200,7 @@ Item
} }
} }
contentItem:UM.Label contentItem: UM.Label
{ {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left anchors.left: parent.left
@ -229,7 +229,7 @@ Item
} }
} }
popup: Controls2.Popup popup: Popup
{ {
y: supportExtruderCombobox.height - UM.Theme.getSize("default_lining").height y: supportExtruderCombobox.height - UM.Theme.getSize("default_lining").height
width: supportExtruderCombobox.width width: supportExtruderCombobox.width
@ -238,12 +238,12 @@ Item
contentItem: ListView contentItem: ListView
{ {
clip: true
implicitHeight: contentHeight implicitHeight: contentHeight
ScrollBar.vertical: UM.ScrollBar {}
clip: true
model: supportExtruderCombobox.popup.visible ? supportExtruderCombobox.delegateModel : null model: supportExtruderCombobox.popup.visible ? supportExtruderCombobox.delegateModel : null
currentIndex: supportExtruderCombobox.highlightedIndex currentIndex: supportExtruderCombobox.highlightedIndex
Controls2.ScrollIndicator.vertical: Controls2.ScrollIndicator { }
} }
background: Rectangle background: Rectangle
@ -253,7 +253,7 @@ Item
} }
} }
delegate: Controls2.ItemDelegate delegate: ItemDelegate
{ {
width: supportExtruderCombobox.width - 2 * UM.Theme.getSize("default_lining").width width: supportExtruderCombobox.width - 2 * UM.Theme.getSize("default_lining").width
height: supportExtruderCombobox.height height: supportExtruderCombobox.height

View file

@ -1,4 +1,4 @@
// Copyright (c) 2016 Ultimaker B.V. // Copyright (c) 2022 Ultimaker B.V.
// Uranium is released under the terms of the LGPLv3 or higher. // Uranium is released under the terms of the LGPLv3 or higher.
import QtQuick 2.7 import QtQuick 2.7
@ -178,12 +178,12 @@ SettingItem
contentItem: ListView contentItem: ListView
{ {
clip: true
implicitHeight: contentHeight implicitHeight: contentHeight
ScrollBar.vertical: UM.ScrollBar {}
clip: true
model: control.popup.visible ? control.delegateModel : null model: control.popup.visible ? control.delegateModel : null
currentIndex: control.highlightedIndex currentIndex: control.highlightedIndex
ScrollIndicator.vertical: ScrollIndicator { }
} }
background: Rectangle background: Rectangle

View file

@ -1,4 +1,4 @@
// Copyright (c) 2018 Ultimaker B.V. // Copyright (c) 2022 Ultimaker B.V.
// 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.7 import QtQuick 2.7
@ -181,12 +181,12 @@ SettingItem
contentItem: ListView contentItem: ListView
{ {
clip: true
implicitHeight: contentHeight implicitHeight: contentHeight
ScrollBar.vertical: UM.ScrollBar {}
clip: true
model: control.popup.visible ? control.delegateModel : null model: control.popup.visible ? control.delegateModel : null
currentIndex: control.highlightedIndex currentIndex: control.highlightedIndex
ScrollIndicator.vertical: ScrollIndicator { }
} }
background: Rectangle { background: Rectangle {