mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 14:37:29 -06:00
Downgrade UM version, re-implementing scroll bar
This plug-in needs to be compatible with Cura 4.9 and up, which means we can't use UM.ScrollBar. Contributes to issue CURA-8686.
This commit is contained in:
parent
c6eb1e668d
commit
2a5abfdb01
1 changed files with 24 additions and 2 deletions
|
@ -5,7 +5,7 @@ import Qt.labs.qmlmodels 1.0
|
|||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
|
||||
import UM 1.5 as UM
|
||||
import UM 1.2 as UM
|
||||
|
||||
/*
|
||||
* A re-sizeable table of data.
|
||||
|
@ -109,7 +109,29 @@ Item
|
|||
}
|
||||
|
||||
clip: true
|
||||
ScrollBar.vertical: UM.ScrollBar {}
|
||||
ScrollBar.vertical: ScrollBar
|
||||
{
|
||||
// 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; } }
|
||||
}
|
||||
}
|
||||
columnWidthProvider: function(column)
|
||||
{
|
||||
return headerBar.children[column].width; //Cells get the same width as their column header.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue