mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-05 21:13:58 -06: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 changed files with 10 additions and 14 deletions
|
@ -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.
|
||||
|
||||
import QtQuick 2.7
|
||||
import QtQuick.Controls 2.3
|
||||
|
||||
import UM 1.4 as UM
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Item
|
||||
|
@ -67,18 +67,14 @@ Item
|
|||
contentHeight: configurationList.height
|
||||
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.background: Rectangle
|
||||
{
|
||||
implicitWidth: UM.Theme.getSize("scrollbar").width
|
||||
radius: width / 2
|
||||
color: UM.Theme.getColor("scrollbar_background")
|
||||
}
|
||||
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")
|
||||
ScrollBar.vertical: UM.ScrollBar {
|
||||
parent: container
|
||||
anchors
|
||||
{
|
||||
top: parent.top
|
||||
right: parent.right
|
||||
bottom: parent.bottom
|
||||
}
|
||||
}
|
||||
|
||||
ButtonGroup
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue