mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-09 15:19:00 +08:00

loaded in different moments. The SliceProcessWidget is loaded once there is something to slice and it also shows the process of slicing. The OutputProcessWidget will show the print information and the actions to do to output the results, such as Print over network, Save to file, ... Contributes to CURA-5786.
63 lines
1.6 KiB
QML
63 lines
1.6 KiB
QML
// Copyright (c) 2018 Ultimaker B.V.
|
|
// Cura is released under the terms of the LGPLv3 or higher.
|
|
|
|
import QtQuick 2.7
|
|
import QtQuick.Controls 2.1
|
|
import QtQuick.Layouts 1.3
|
|
|
|
import UM 1.1 as UM
|
|
import Cura 1.0 as Cura
|
|
|
|
Column
|
|
{
|
|
id: widget
|
|
|
|
spacing: UM.Theme.getSize("default_margin").height
|
|
|
|
UM.I18nCatalog
|
|
{
|
|
id: catalog
|
|
name: "cura"
|
|
}
|
|
|
|
property real progress: UM.Backend.progress
|
|
property int backendState: UM.Backend.state
|
|
|
|
Rectangle
|
|
{
|
|
id: progressBar
|
|
width: parent.width
|
|
height: UM.Theme.getSize("progressbar").height
|
|
visible: widget.backendState == 2
|
|
radius: UM.Theme.getSize("progressbar_radius").width
|
|
color: UM.Theme.getColor("progressbar_background")
|
|
|
|
Rectangle
|
|
{
|
|
width: Math.max(parent.width * base.progress)
|
|
height: parent.height
|
|
radius: UM.Theme.getSize("progressbar_radius").width
|
|
color: UM.Theme.getColor("progressbar_control")
|
|
}
|
|
}
|
|
|
|
Cura.ActionButton
|
|
{
|
|
id: prepareButton
|
|
width: UM.Theme.getSize("action_panel_button").width
|
|
height: UM.Theme.getSize("action_panel_button").height
|
|
text: widget.backendState == 1 ? catalog.i18nc("@button", "Prepare") : catalog.i18nc("@button", "Cancel")
|
|
onClicked:
|
|
{
|
|
if ([1, 5].indexOf(widget.backendState) != -1)
|
|
{
|
|
CuraApplication.backend.forceSlice()
|
|
}
|
|
else
|
|
{
|
|
CuraApplication.backend.stopSlicing()
|
|
}
|
|
}
|
|
}
|
|
}
|