mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-07-28 04:01:59 +08:00
Use custom scroll bar for qualities+intents menu
Contributes to issue CURA-8686.
This commit is contained in:
parent
c57126fb00
commit
5041162a99
@ -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.
|
// Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
import QtQuick 2.10
|
import QtQuick 2.10
|
||||||
@ -43,17 +43,29 @@ Popup
|
|||||||
// This repeater adds the intent labels
|
// This repeater adds the intent labels
|
||||||
ScrollView
|
ScrollView
|
||||||
{
|
{
|
||||||
|
id: qualityListScrollView
|
||||||
property real maximumHeight: screenScaleFactor * 400
|
property real maximumHeight: screenScaleFactor * 400
|
||||||
contentHeight: dataColumn.height
|
contentHeight: dataColumn.height
|
||||||
height: Math.min(contentHeight, maximumHeight)
|
height: Math.min(contentHeight, maximumHeight)
|
||||||
clip: true
|
width: parent.width
|
||||||
|
|
||||||
ScrollBar.vertical.policy: height == maximumHeight ? ScrollBar.AlwaysOn: ScrollBar.AlwaysOff
|
clip: true
|
||||||
|
ScrollBar.vertical: UM.ScrollBar
|
||||||
|
{
|
||||||
|
id: qualityListScrollBar
|
||||||
|
parent: qualityListScrollView
|
||||||
|
anchors
|
||||||
|
{
|
||||||
|
top: parent.top
|
||||||
|
right: parent.right
|
||||||
|
bottom: parent.bottom
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Column
|
Column
|
||||||
{
|
{
|
||||||
id: dataColumn
|
id: dataColumn
|
||||||
width: parent.width
|
width: qualityListScrollView.width - qualityListScrollBar.width
|
||||||
Repeater
|
Repeater
|
||||||
{
|
{
|
||||||
model: dataModel
|
model: dataModel
|
||||||
@ -64,7 +76,7 @@ Popup
|
|||||||
property variant subItemModel: model.qualities
|
property variant subItemModel: model.qualities
|
||||||
|
|
||||||
height: childrenRect.height
|
height: childrenRect.height
|
||||||
width: popup.contentWidth
|
width: dataColumn.width
|
||||||
|
|
||||||
UM.Label
|
UM.Label
|
||||||
{
|
{
|
||||||
@ -137,7 +149,7 @@ Popup
|
|||||||
Item
|
Item
|
||||||
{
|
{
|
||||||
height: childrenRect.height
|
height: childrenRect.height
|
||||||
width: popup.contentWidth
|
width: dataColumn.width
|
||||||
|
|
||||||
UM.Label
|
UM.Label
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user