mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 07:35:59 +08:00
Re-use component scrollbar from Uranium
It's a new component so that we don't have to re-implement it everywhere. In this case we do have to anchor it correctly though because ScrollView doesn't do that by itself. Contributes to issue CURA-8686.
This commit is contained in:
parent
ae81b5e3e7
commit
7a1578cbc4
@ -1,10 +1,10 @@
|
|||||||
// 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
|
||||||
import QtQuick.Controls 2.3
|
import QtQuick.Controls 2.3
|
||||||
|
|
||||||
import UM 1.4 as UM
|
import UM 1.5 as UM
|
||||||
import Cura 1.0 as Cura
|
import Cura 1.0 as Cura
|
||||||
|
|
||||||
Item
|
Item
|
||||||
@ -67,18 +67,14 @@ Item
|
|||||||
contentHeight: configurationList.height
|
contentHeight: configurationList.height
|
||||||
clip: true
|
clip: true
|
||||||
|
|
||||||
ScrollBar.vertical.policy: (configurationList.height > maximumHeight) ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff //The AsNeeded policy also hides it when the cursor is away, and we don't want that.
|
ScrollBar.vertical: UM.ScrollBar {
|
||||||
ScrollBar.vertical.background: Rectangle
|
parent: container
|
||||||
{
|
anchors
|
||||||
implicitWidth: UM.Theme.getSize("scrollbar").width
|
{
|
||||||
radius: width / 2
|
top: parent.top
|
||||||
color: UM.Theme.getColor("scrollbar_background")
|
right: parent.right
|
||||||
}
|
bottom: parent.bottom
|
||||||
ScrollBar.vertical.contentItem: Rectangle
|
}
|
||||||
{
|
|
||||||
implicitWidth: UM.Theme.getSize("scrollbar").width
|
|
||||||
radius: width / 2
|
|
||||||
color: UM.Theme.getColor(parent.pressed ? "scrollbar_handle_down" : parent.hovered ? "scrollbar_handle_hover" : "scrollbar_handle")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ButtonGroup
|
ButtonGroup
|
||||||
|
Loading…
x
Reference in New Issue
Block a user