mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-30 06:11:09 -07:00
Split the action button panel in two different components that are
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.
This commit is contained in:
parent
5de367bcc4
commit
bf59097320
5 changed files with 172 additions and 222 deletions
62
resources/qml/SliceProcessWidget.qml
Normal file
62
resources/qml/SliceProcessWidget.qml
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
// 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()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue