WIP: Make reusable widget CuraProgressBar

This commit is contained in:
Lipu Fei 2019-02-28 08:06:28 +01:00
parent 92730a09a2
commit 51c773fd80
4 changed files with 54 additions and 71 deletions

View file

@ -9,6 +9,8 @@ import QtQuick.Controls 1.4 as Controls1
import UM 1.1 as UM
import Cura 1.0 as Cura
import "../Widgets"
// This element contains all the elements the user needs to create a printjob from the
// model(s) that is(are) on the buildplate. Mainly the button to start/stop the slicing
@ -64,7 +66,7 @@ Column
}
// Progress bar, only visible when the backend is in the process of slice the printjob
ProgressBar
CuraProgressBar
{
id: progressBar
width: parent.width
@ -72,25 +74,6 @@ Column
value: progress
indeterminate: widget.backendState == UM.Backend.NotStarted
visible: (widget.backendState == UM.Backend.Processing || (prepareButtons.autoSlice && widget.backendState == UM.Backend.NotStarted))
background: Rectangle
{
anchors.fill: parent
radius: UM.Theme.getSize("progressbar_radius").width
color: UM.Theme.getColor("progressbar_background")
}
contentItem: Item
{
anchors.fill: parent
Rectangle
{
width: progressBar.visualPosition * parent.width
height: parent.height
radius: UM.Theme.getSize("progressbar_radius").width
color: UM.Theme.getColor("progressbar_control")
}
}
}
Item