Merge pull request #11839 from Ultimaker/CURA-9144_scrollbar_in_marketplace_libary_wrong

CURA-9144 Scrollbar in Marketplace and Digital Library are acting up
This commit is contained in:
Casper Lamboo 2022-04-22 10:36:57 +02:00 committed by GitHub
commit f8bfd0ef28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 43 deletions

View File

@ -6,7 +6,7 @@ import QtQuick.Window 2.2
import QtQuick.Controls 2.3 import QtQuick.Controls 2.3
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import UM 1.2 as UM import UM 1.6 as UM
import Cura 1.7 as Cura import Cura 1.7 as Cura
import DigitalFactory 1.0 as DF import DigitalFactory 1.0 as DF
@ -148,29 +148,7 @@ Item
contentHeight: projectsListView.implicitHeight contentHeight: projectsListView.implicitHeight
anchors.fill: parent anchors.fill: parent
ScrollBar.vertical: ScrollBar ScrollBar.vertical: UM.ScrollBar { id: verticalScrollBar }
{
// Vertical ScrollBar, styled similarly to the scrollBar in the settings panel
id: verticalScrollBar
visible: flickableView.contentHeight > flickableView.height
background: Rectangle
{
implicitWidth: UM.Theme.getSize("scrollbar").width
radius: Math.round(implicitWidth / 2)
color: UM.Theme.getColor("scrollbar_background")
}
contentItem: Rectangle
{
id: scrollViewHandle
implicitWidth: UM.Theme.getSize("scrollbar").width
radius: Math.round(implicitWidth / 2)
color: verticalScrollBar.pressed ? UM.Theme.getColor("scrollbar_handle_down") : verticalScrollBar.hovered ? UM.Theme.getColor("scrollbar_handle_hover") : UM.Theme.getColor("scrollbar_handle")
Behavior on color { ColorAnimation { duration: 50; } }
}
}
Column Column
{ {

View File

@ -1,9 +1,10 @@
// Copyright (c) 2021 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.15 import QtQuick 2.15
import QtQuick.Controls 2.15 import QtQuick.Controls 2.15
import UM 1.4 as UM
import UM 1.6 as UM
ListView ListView
@ -51,23 +52,7 @@ ListView
} }
} }
ScrollBar.vertical: ScrollBar ScrollBar.vertical: UM.ScrollBar { id: verticalScrollBar }
{
// Vertical ScrollBar, styled similarly to the scrollBar in the settings panel
id: verticalScrollBar
visible: packages.contentHeight > packages.height
anchors.right: parent.right
background: Item {}
contentItem: Rectangle
{
id: scrollViewHandle
implicitWidth: UM.Theme.getSize("scrollbar").width
radius: Math.round(implicitWidth / 2)
color: verticalScrollBar.pressed ? UM.Theme.getColor("scrollbar_handle_down") : verticalScrollBar.hovered ? UM.Theme.getColor("scrollbar_handle_hover") : UM.Theme.getColor("scrollbar_handle")
Behavior on color { ColorAnimation { duration: 50; } }
}
}
delegate: MouseArea delegate: MouseArea
{ {