Merge branch 'cura4.0_action_panel' into cura4.0_header

This commit is contained in:
Remco Burema 2018-11-08 11:50:14 +01:00
commit aef5c67652
17 changed files with 857 additions and 275 deletions

View File

@ -21,6 +21,7 @@ Row
textColor: UM.Theme.getColor("main_window_header_button_text_active")
textHoverColor: UM.Theme.getColor("main_window_header_button_text_active")
onClicked: Qt.openUrlExternally("https://account.ultimaker.com")
fixedWidthMode: true
}
Cura.ActionButton
@ -29,5 +30,6 @@ Row
height: UM.Theme.getSize("account_button").height
text: catalog.i18nc("@button", "Login")
onClicked: Cura.API.account.login()
fixedWidthMode: true
}
}

View File

@ -21,6 +21,7 @@ Row
textColor: UM.Theme.getColor("main_window_header_button_text_active")
textHoverColor: UM.Theme.getColor("main_window_header_button_text_active")
onClicked: Qt.openUrlExternally("https://account.ultimaker.com")
fixedWidthMode: true
}
Cura.ActionButton
@ -29,5 +30,6 @@ Row
height: UM.Theme.getSize("account_button").height
text: catalog.i18nc("@button", "Logout")
onClicked: Cura.API.account.logout()
fixedWidthMode: true
}
}

View File

@ -14,6 +14,7 @@ Button
property alias iconSource: buttonIcon.source
property alias textFont: buttonText.font
property alias cornerRadius: backgroundRect.radius
property alias tooltip: tooltip.text
property var color: UM.Theme.getColor("primary")
property var hoverColor: UM.Theme.getColor("primary_hover")
property var disabledColor: color
@ -23,6 +24,10 @@ Button
property var outlineColor: color
property var outlineHoverColor: hoverColor
property var outlineDisabledColor: outlineColor
// This property is used to indicate whether the button has a fixed width or the width would depend on the contents
// Be careful when using fixedWidthMode, the translated texts can be too long that they won't fit. In any case,
// we elide the text to the right so the text will be cut off with the three dots at the end.
property var fixedWidthMode: false
contentItem: Row
{
@ -48,6 +53,9 @@ Button
visible: text != ""
renderType: Text.NativeRendering
anchors.verticalCenter: parent.verticalCenter
width: fixedWidthMode ? button.width - button.leftPadding - button.rightPadding : undefined
horizontalAlignment: Text.AlignHCenter
elide: Text.ElideRight
}
}
@ -60,6 +68,14 @@ Button
border.color: button.enabled ? (button.hovered ? button.outlineHoverColor : button.outlineColor) : button.outlineDisabledColor
}
ToolTip
{
id: tooltip
text: ""
delay: 500
visible: text != "" && button.hovered
}
MouseArea
{
id: mouseArea

View File

@ -0,0 +1,56 @@
// 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.2 as UM
import Cura 1.0 as Cura
// This element hold all the elements needed for the user to trigger the slicing process, and later
// to get information about the printing times, material consumption and the output process (such as
// saving to a file, printing over network, ...
Rectangle
{
id: actionPanelWidget
width: UM.Theme.getSize("action_panel_widget").width
height: childrenRect.height + 2 * UM.Theme.getSize("thick_margin").height
color: UM.Theme.getColor("main_background")
border.width: UM.Theme.getSize("default_lining").width
border.color: UM.Theme.getColor("lining")
radius: UM.Theme.getSize("default_radius").width
visible: CuraApplication.platformActivity
property bool outputAvailable: UM.Backend.state == UM.Backend.Done || UM.Backend.state == UM.Backend.Disabled
Loader
{
id: loader
anchors
{
top: parent.top
topMargin: UM.Theme.getSize("thick_margin").height
left: parent.left
leftMargin: UM.Theme.getSize("thick_margin").width
right: parent.right
rightMargin: UM.Theme.getSize("thick_margin").width
}
sourceComponent: outputAvailable ? outputProcessWidget : sliceProcessWidget
}
Component
{
id: sliceProcessWidget
SliceProcessWidget { }
}
Component
{
id: outputProcessWidget
OutputProcessWidget { }
}
}

View File

@ -0,0 +1,103 @@
// 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
Item
{
id: widget
Cura.ActionButton
{
id: saveToButton
height: parent.height
fixedWidthMode: true
anchors
{
top: parent.top
left: parent.left
right: deviceSelectionMenu.visible ? deviceSelectionMenu.left : parent.right
}
tooltip: UM.OutputDeviceManager.activeDeviceDescription
text: UM.OutputDeviceManager.activeDeviceShortDescription
onClicked:
{
forceActiveFocus();
UM.OutputDeviceManager.requestWriteToDevice(UM.OutputDeviceManager.activeDevice, PrintInformation.jobName,
{ "filter_by_machine": true, "preferred_mimetypes": Cura.MachineManager.activeMachine.preferred_output_file_formats });
}
}
Cura.ActionButton
{
id: deviceSelectionMenu
height: parent.height
anchors
{
top: parent.top
right: parent.right
}
tooltip: catalog.i18nc("@info:tooltip", "Select the active output device")
iconSource: popup.opened ? UM.Theme.getIcon("arrow_top") : UM.Theme.getIcon("arrow_bottom")
color: UM.Theme.getColor("action_panel_secondary")
visible: (devicesModel.deviceCount > 1)
onClicked: popup.opened ? popup.close() : popup.open()
Popup
{
id: popup
padding: 0
y: -height
x: parent.width - width
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent
contentItem: Column
{
Repeater
{
model: devicesModel
delegate: Cura.ActionButton
{
text: model.description
color: "transparent"
cornerRadius: 0
hoverColor: UM.Theme.getColor("primary")
onClicked:
{
UM.OutputDeviceManager.setActiveDevice(model.id)
popup.close()
}
}
}
}
background: Rectangle
{
opacity: visible ? 1 : 0
Behavior on opacity { NumberAnimation { duration: 100 } }
radius: UM.Theme.getSize("default_radius").width
color: UM.Theme.getColor("action_panel_secondary")
border.color: UM.Theme.getColor("lining")
border.width: UM.Theme.getSize("default_lining").width
}
}
}
UM.OutputDevicesModel { id: devicesModel }
}

View File

@ -0,0 +1,122 @@
// 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
// This element contains all the elements the user needs to visualize the data
// that is gather after the slicing process, such as printint time, material usage, ...
// There are also two buttons: one to previsualize the output layers, and the other to
// select what to do with it (such as print over network, save to file, ...)
Column
{
id: widget
spacing: UM.Theme.getSize("thin_margin").height
UM.I18nCatalog
{
id: catalog
name: "cura"
}
Item
{
id: information
width: parent.width
height: childrenRect.height
Column
{
id: timeAndCostsInformation
spacing: UM.Theme.getSize("thin_margin").height
anchors
{
left: parent.left
right: printInformationPanel.left
rightMargin: UM.Theme.getSize("thin_margin").height
}
Cura.IconLabel
{
id: estimatedTime
width: parent.width
text: PrintInformation.currentPrintTime.getDisplayString(UM.DurationFormat.Long)
source: UM.Theme.getIcon("clock")
font: UM.Theme.getFont("small")
}
Cura.IconLabel
{
id: estimatedCosts
width: parent.width
property var printMaterialLengths: PrintInformation.materialLengths
property var printMaterialWeights: PrintInformation.materialWeights
text:
{
var totalLengths = 0
var totalWeights = 0
if (printMaterialLengths)
{
for(var index = 0; index < printMaterialLengths.length; index++)
{
if(printMaterialLengths[index] > 0)
{
totalLengths += printMaterialLengths[index]
totalWeights += Math.round(printMaterialWeights[index])
}
}
}
return totalWeights + "g · " + totalLengths.toFixed(2) + "m"
}
source: UM.Theme.getIcon("spool")
font: UM.Theme.getFont("very_small")
}
}
PrintInformationWidget
{
id: printInformationPanel
anchors
{
right: parent.right
verticalCenter: timeAndCostsInformation.verticalCenter
}
}
}
Row
{
id: buttonRow
spacing: UM.Theme.getSize("default_margin").width
Cura.ActionButton
{
leftPadding: UM.Theme.getSize("default_margin").width
rightPadding: UM.Theme.getSize("default_margin").width
height: UM.Theme.getSize("action_panel_button").height
text: catalog.i18nc("@button", "Preview")
color: UM.Theme.getColor("secondary")
hoverColor: UM.Theme.getColor("secondary")
textColor: UM.Theme.getColor("primary")
textHoverColor: UM.Theme.getColor("text")
onClicked: UM.Controller.setActiveStage("MonitorStage")
}
Cura.OutputDevicesActionButton
{
width: UM.Theme.getSize("action_panel_button").width
height: UM.Theme.getSize("action_panel_button").height
}
}
}

View 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 UM 1.1 as UM
import Cura 1.0 as Cura
Button
{
id: widget
implicitHeight: UM.Theme.getSize("section_icon").height
implicitWidth: UM.Theme.getSize("section_icon").width
background: UM.RecolorImage
{
id: moreInformationIcon
source: UM.Theme.getIcon("info")
width: UM.Theme.getSize("section_icon").width
height: UM.Theme.getSize("section_icon").height
sourceSize.width: width
sourceSize.height: height
color: widget.hovered ? UM.Theme.getColor("primary") : UM.Theme.getColor("text_medium")
}
onClicked: popup.opened ? popup.close() : popup.open()
Popup
{
id: popup
y: -(height + UM.Theme.getSize("default_arrow").height + UM.Theme.getSize("thin_margin").height)
x: parent.width - width + UM.Theme.getSize("thin_margin").width
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent
contentItem: PrintJobInformation
{
id: printJobInformation
width: UM.Theme.getSize("action_panel_information_widget").width
}
background: UM.PointingRectangle
{
opacity: visible ? 1 : 0
Behavior on opacity { NumberAnimation { duration: 100 } }
color: UM.Theme.getColor("tool_panel_background")
borderColor: UM.Theme.getColor("lining")
borderWidth: UM.Theme.getSize("default_lining").width
target: Qt.point(width - (widget.width / 2) - UM.Theme.getSize("thin_margin").width,
height + UM.Theme.getSize("default_arrow").height - UM.Theme.getSize("thin_margin").height)
arrowSize: UM.Theme.getSize("default_arrow").width
}
}
}

View File

@ -0,0 +1,161 @@
// 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 UM 1.1 as UM
import Cura 1.0 as Cura
Column
{
id: base
spacing: UM.Theme.getSize("default_margin").width
UM.I18nCatalog
{
id: catalog
name: "cura"
}
Column
{
id: timeSpecification
spacing: UM.Theme.getSize("thin_margin").width
width: parent.width
topPadding: UM.Theme.getSize("default_margin").height
leftPadding: UM.Theme.getSize("default_margin").width
rightPadding: UM.Theme.getSize("default_margin").width
Label
{
text: catalog.i18nc("@label", "Time specification").toUpperCase()
color: UM.Theme.getColor("primary")
font: UM.Theme.getFont("small")
renderType: Text.NativeRendering
}
Label
{
property var printDuration: PrintInformation.currentPrintTime
text:
{
// All the time information for the different features is achieved
var printTime = PrintInformation.getFeaturePrintTimes()
var totalSeconds = parseInt(printDuration.getDisplayString(UM.DurationFormat.Seconds))
// A message is created and displayed when the user hover the time label
var text = "<table width=\"100%\">"
for(var feature in printTime)
{
if(!printTime[feature].isTotalDurationZero)
{
text += "<tr><td>" + feature + ":</td>" +
"<td align=\"right\" valign=\"bottom\">&nbsp;&nbsp;%1</td>".arg(printTime[feature].getDisplayString(UM.DurationFormat.ISO8601).slice(0,-3)) +
"<td align=\"right\" valign=\"bottom\">&nbsp;&nbsp;%1%</td>".arg(Math.round(100 * parseInt(printTime[feature].getDisplayString(UM.DurationFormat.Seconds)) / totalSeconds)) +
"</tr>"
}
}
text += "</table>"
return text
}
width: parent.width - 2 * UM.Theme.getSize("default_margin").width
color: UM.Theme.getColor("text")
font: UM.Theme.getFont("very_small")
renderType: Text.NativeRendering
textFormat: Text.RichText
}
}
Column
{
id: materialSpecification
spacing: UM.Theme.getSize("thin_margin").width
width: parent.width
bottomPadding: UM.Theme.getSize("default_margin").height
leftPadding: UM.Theme.getSize("default_margin").width
rightPadding: UM.Theme.getSize("default_margin").width
Label
{
text: catalog.i18nc("@label", "Material specification").toUpperCase()
color: UM.Theme.getColor("primary")
font: UM.Theme.getFont("small")
renderType: Text.NativeRendering
}
Label
{
property var printMaterialLengths: PrintInformation.materialLengths
property var printMaterialWeights: PrintInformation.materialWeights
property var printMaterialCosts: PrintInformation.materialCosts
property var printMaterialNames: PrintInformation.materialNames
function formatRow(items)
{
var rowHTML = "<tr>"
for(var item = 0; item < items.length; item++)
{
if (item == 0)
{
rowHTML += "<td valign=\"bottom\">%1</td>".arg(items[item])
}
else
{
rowHTML += "<td align=\"right\" valign=\"bottom\">&nbsp;&nbsp;%1</td>".arg(items[item])
}
}
rowHTML += "</tr>"
return rowHTML
}
text:
{
var lengths = []
var weights = []
var costs = []
var names = []
if(printMaterialLengths)
{
for(var index = 0; index < printMaterialLengths.length; index++)
{
if(printMaterialLengths[index] > 0)
{
names.push(printMaterialNames[index])
lengths.push(printMaterialLengths[index].toFixed(2))
weights.push(String(Math.round(printMaterialWeights[index])))
var cost = printMaterialCosts[index] == undefined ? 0 : printMaterialCosts[index].toFixed(2)
costs.push(cost)
}
}
}
if(lengths.length == 0)
{
lengths = ["0.00"]
weights = ["0"]
costs = ["0.00"]
}
var text = "<table width=\"100%\">"
for(var index = 0; index < lengths.length; index++)
{
text += formatRow([
"%1:".arg(names[index]),
catalog.i18nc("@label m for meter", "%1m").arg(lengths[index]),
catalog.i18nc("@label g for grams", "%1g").arg(weights[index]),
"%1&nbsp;%2".arg(UM.Preferences.getValue("cura/currency")).arg(costs[index]),
])
}
text += "</table>"
return text
}
width: parent.width - 2 * UM.Theme.getSize("default_margin").width
color: UM.Theme.getColor("text")
font: UM.Theme.getFont("very_small")
renderType: Text.NativeRendering
textFormat: Text.RichText
}
}
}

View File

@ -0,0 +1,139 @@
// 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 QtQuick.Controls 1.4 as Controls1
import UM 1.1 as UM
import Cura 1.0 as Cura
// 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
// process and a progress bar to see the progress of the process.
Column
{
id: widget
spacing: UM.Theme.getSize("thin_margin").height
UM.I18nCatalog
{
id: catalog
name: "cura"
}
property real progress: UM.Backend.progress
property int backendState: UM.Backend.state
function sliceOrStopSlicing()
{
if (widget.backendState == UM.Backend.NotStarted)
{
CuraApplication.backend.forceSlice()
}
else
{
CuraApplication.backend.stopSlicing()
}
}
Cura.IconLabel
{
id: message
width: parent.width
visible: widget.backendState == UM.Backend.Error
text: catalog.i18nc("@label:PrintjobStatus", "Unable to Slice")
source: UM.Theme.getIcon("warning")
color: UM.Theme.getColor("warning")
font: UM.Theme.getFont("very_small")
}
// Progress bar, only visible when the backend is in the process of slice the printjob
ProgressBar
{
id: progressBar
width: parent.width
height: UM.Theme.getSize("progressbar").height
value: progress
visible: widget.backendState == UM.Backend.Processing
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")
}
}
}
Cura.ActionButton
{
id: prepareButton
width: parent.width
height: UM.Theme.getSize("action_panel_button").height
fixedWidthMode: true
text:
{
if ([UM.Backend.NotStarted, UM.Backend.Error].indexOf(widget.backendState) != -1)
{
return catalog.i18nc("@button", "Slice")
}
if (autoSlice)
{
return catalog.i18nc("@button", "Auto slicing...")
}
return catalog.i18nc("@button", "Cancel")
}
enabled: !autoSlice && !disabledSlice
// Get the current value from the preferences
property bool autoSlice: UM.Preferences.getValue("general/auto_slice")
// Disable the slice process when
property bool disabledSlice: [UM.Backend.Done, UM.Backend.Error].indexOf(widget.backendState) != -1
disabledColor: disabledSlice ? UM.Theme.getColor("action_button_disabled") : "transparent"
textDisabledColor: disabledSlice ? UM.Theme.getColor("action_button_disabled_text") : UM.Theme.getColor("primary")
outlineDisabledColor: disabledSlice ? UM.Theme.getColor("action_button_disabled_border") : "transparent"
onClicked: sliceOrStopSlicing()
}
// React when the user changes the preference of having the auto slice enabled
Connections
{
target: UM.Preferences
onPreferenceChanged:
{
var autoSlice = UM.Preferences.getValue("general/auto_slice")
prepareButton.autoSlice = autoSlice
}
}
// Shortcut for "slice/stop"
Controls1.Action
{
shortcut: "Ctrl+P"
onTriggered:
{
if (prepareButton.enabled)
{
sliceOrStopSlicing()
}
}
}
}

View File

@ -1,239 +0,0 @@
// 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.0
import QtQuick.Layouts 1.3
import UM 1.2 as UM
import Cura 1.0 as Cura
Rectangle
{
id: base
// We need a whole lot of print duration information.
property variant printDuration: PrintInformation.currentPrintTime
// This widget doesn't show tooltips by itself. Instead it emits signals so others can do something with it.
signal showTooltip(Item item, point location, string text)
signal hideTooltip()
color: UM.Theme.getColor("main_background")
// Also add an extra margin, as we want some breathing room around the edges.
height: saveButton.height + UM.Theme.getSize("thick_margin").height
Label
{
id: timeDetails
anchors.left: parent.left
anchors.bottom: costSpec.top
anchors.leftMargin: UM.Theme.getSize("thick_margin").width
font: UM.Theme.getFont("large")
color: UM.Theme.getColor("text_subtext")
text: (!base.printDuration || !base.printDuration.valid) ? catalog.i18nc("@label Hours and minutes", "00h 00min") : base.printDuration.getDisplayString(UM.DurationFormat.Short)
renderType: Text.NativeRendering
MouseArea
{
id: timeDetailsMouseArea
anchors.fill: parent
hoverEnabled: true
onEntered:
{
if(base.printDuration.valid && !base.printDuration.isTotalDurationZero)
{
// All the time information for the different features is achieved
var print_time = PrintInformation.getFeaturePrintTimes();
var total_seconds = parseInt(base.printDuration.getDisplayString(UM.DurationFormat.Seconds))
// A message is created and displayed when the user hover the time label
var tooltip_html = "<b>%1</b><br/><table width=\"100%\">".arg(catalog.i18nc("@tooltip", "Time specification"));
for(var feature in print_time)
{
if(!print_time[feature].isTotalDurationZero)
{
tooltip_html += "<tr><td>" + feature + ":</td>" +
"<td align=\"right\" valign=\"bottom\">&nbsp;&nbsp;%1</td>".arg(print_time[feature].getDisplayString(UM.DurationFormat.ISO8601).slice(0,-3)) +
"<td align=\"right\" valign=\"bottom\">&nbsp;&nbsp;%1%</td>".arg(Math.round(100 * parseInt(print_time[feature].getDisplayString(UM.DurationFormat.Seconds)) / total_seconds)) +
"</td></tr>";
}
}
tooltip_html += "</table>";
base.showTooltip(parent, Qt.point(-UM.Theme.getSize("thick_margin").width, 0), tooltip_html);
}
}
onExited:
{
base.hideTooltip();
}
}
}
Label
{
function formatRow(items)
{
var row_html = "<tr>";
for(var item = 0; item < items.length; item++)
{
if (item == 0)
{
row_html += "<td valign=\"bottom\">%1</td>".arg(items[item]);
}
else
{
row_html += "<td align=\"right\" valign=\"bottom\">&nbsp;&nbsp;%1</td>".arg(items[item]);
}
}
row_html += "</tr>";
return row_html;
}
function getSpecsData()
{
var lengths = [];
var total_length = 0;
var weights = [];
var total_weight = 0;
var costs = [];
var total_cost = 0;
var some_costs_known = false;
var names = [];
if(base.printMaterialLengths)
{
for(var index = 0; index < base.printMaterialLengths.length; index++)
{
if(base.printMaterialLengths[index] > 0)
{
names.push(base.printMaterialNames[index]);
lengths.push(base.printMaterialLengths[index].toFixed(2));
weights.push(String(Math.round(base.printMaterialWeights[index])));
var cost = base.printMaterialCosts[index] == undefined ? 0 : base.printMaterialCosts[index].toFixed(2);
costs.push(cost);
if(cost > 0)
{
some_costs_known = true;
}
total_length += base.printMaterialLengths[index];
total_weight += base.printMaterialWeights[index];
total_cost += base.printMaterialCosts[index];
}
}
}
if(lengths.length == 0)
{
lengths = ["0.00"];
weights = ["0"];
costs = ["0.00"];
}
var tooltip_html = "<b>%1</b><br/><table width=\"100%\">".arg(catalog.i18nc("@label", "Cost specification"));
for(var index = 0; index < lengths.length; index++)
{
tooltip_html += formatRow([
"%1:".arg(names[index]),
catalog.i18nc("@label m for meter", "%1m").arg(lengths[index]),
catalog.i18nc("@label g for grams", "%1g").arg(weights[index]),
"%1&nbsp;%2".arg(UM.Preferences.getValue("cura/currency")).arg(costs[index]),
]);
}
if(lengths.length > 1)
{
tooltip_html += formatRow([
catalog.i18nc("@label", "Total:"),
catalog.i18nc("@label m for meter", "%1m").arg(total_length.toFixed(2)),
catalog.i18nc("@label g for grams", "%1g").arg(Math.round(total_weight)),
"%1 %2".arg(UM.Preferences.getValue("cura/currency")).arg(total_cost.toFixed(2)),
]);
}
tooltip_html += "</table>";
tooltipText = tooltip_html;
return tooltipText
}
id: costSpec
anchors.left: parent.left
anchors.bottom: parent.bottom
anchors.bottomMargin: UM.Theme.getSize("thick_margin").height
anchors.leftMargin: UM.Theme.getSize("thick_margin").width
font: UM.Theme.getFont("very_small")
renderType: Text.NativeRendering
color: UM.Theme.getColor("text_subtext")
elide: Text.ElideMiddle
width: parent.width
property string tooltipText
text:
{
var lengths = [];
var weights = [];
var costs = [];
var someCostsKnown = false;
if(base.printMaterialLengths)
{
for(var index = 0; index < base.printMaterialLengths.length; index++)
{
if(base.printMaterialLengths[index] > 0)
{
lengths.push(base.printMaterialLengths[index].toFixed(2));
weights.push(String(Math.round(base.printMaterialWeights[index])));
var cost = base.printMaterialCosts[index] == undefined ? 0 : base.printMaterialCosts[index].toFixed(2);
costs.push(cost);
if(cost > 0)
{
someCostsKnown = true;
}
}
}
}
if(lengths.length == 0)
{
lengths = ["0.00"];
weights = ["0"];
costs = ["0.00"];
}
var result = lengths.join(" + ") + "m / ~ " + weights.join(" + ") + "g";
if(someCostsKnown)
{
result += " / ~ " + costs.join(" + ") + " " + UM.Preferences.getValue("cura/currency");
}
return result;
}
MouseArea
{
id: costSpecMouseArea
anchors.fill: parent
hoverEnabled: true
onEntered:
{
if(base.printDuration.valid && !base.printDuration.isTotalDurationZero)
{
var show_data = costSpec.getSpecsData()
base.showTooltip(parent, Qt.point(-UM.Theme.getSize("thick_margin").width, 0), show_data);
}
}
onExited:
{
base.hideTooltip();
}
}
}
SaveButton
{
id: saveButton
width: parent.width
height: 100 * screenScaleFactor
anchors.bottom: parent.bottom
}
}

View File

@ -313,17 +313,8 @@ UM.MainWindow
{
anchors.right: parent.right
anchors.bottom: parent.bottom
width: UM.Theme.getSize("action_panel_widget").width
anchors.rightMargin: UM.Theme.getSize("thick_margin").width
anchors.bottomMargin: UM.Theme.getSize("thick_margin").height
onShowTooltip:
{
base.showTooltip(item, location, text)
}
onHideTooltip:
{
base.hideTooltip()
}
}
Loader

View File

@ -0,0 +1,49 @@
// 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
// This item will show a label with a squared icon in the left
Item
{
id: container
property alias text: label.text
property alias source: icon.source
property alias color: label.color
property alias font: label.font
height: childrenRect.height
UM.RecolorImage
{
id: icon
anchors.left: parent.left
source: UM.Theme.getIcon("dot")
width: UM.Theme.getSize("section_icon").width
height: UM.Theme.getSize("section_icon").height
sourceSize.width: width
sourceSize.height: height
color: label.color
}
Label
{
id: label
anchors.left: icon.right
anchors.leftMargin: UM.Theme.getSize("thin_margin").width
anchors.verticalCenter: icon.verticalCenter
text: "Empty label"
color: UM.Theme.getColor("text")
font: UM.Theme.getFont("very_small")
renderType: Text.NativeRendering
}
}

View File

@ -7,4 +7,6 @@ PrintSetupSelector 1.0 PrintSetupSelector.qml
ActionButton 1.0 ActionButton.qml
MaterialMenu 1.0 MaterialMenu.qml
NozzleMenu 1.0 NozzleMenu.qml
ActionPanelWidget 1.0 ActionPanelWidget.qml
ActionPanelWidget 1.0 ActionPanelWidget.qml
IconLabel 1.0 IconLabel.qml
OutputDevicesActionButton 1.0 OutputDevicesActionButton.qml

View File

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="612px" height="612px" viewBox="0 0 612 612" style="enable-background:new 0 0 612 612;" xml:space="preserve">
<g>
<g>
<path d="M587.572,186.881c-32.266-75.225-87.096-129.934-162.949-162.285C386.711,8.427,346.992,0.168,305.497,0.168
c-41.488,0-80.914,8.181-118.784,24.428C111.488,56.861,56.415,111.535,24.092,186.881C7.895,224.629,0,264.176,0,305.664
c0,41.496,7.895,81.371,24.092,119.127c32.323,75.346,87.403,130.348,162.621,162.621c37.877,16.247,77.295,24.42,118.784,24.42
c41.489,0,81.214-8.259,119.12-24.42c75.853-32.352,130.683-87.403,162.956-162.621C603.819,386.914,612,347.16,612,305.664
C612,264.176,603.826,224.757,587.572,186.881z M538.724,440.853c-24.021,41.195-56.929,73.876-98.375,98.039
c-41.195,24.021-86.332,36.135-134.845,36.135c-36.47,0-71.27-7.024-104.4-21.415c-33.129-14.384-61.733-33.294-85.661-57.215
c-23.928-23.928-42.973-52.811-57.214-85.997c-14.199-33.065-21.08-68.258-21.08-104.735c0-48.52,11.921-93.428,35.807-134.509
c23.971-41.231,56.886-73.947,98.039-98.04c41.146-24.092,85.99-36.142,134.502-36.142c48.52,0,93.649,12.121,134.845,36.142
c41.446,24.164,74.283,56.879,98.375,98.039c24.092,41.153,36.135,85.99,36.135,134.509
C574.852,354.185,562.888,399.399,538.724,440.853z"/>
<path d="M324.906,302.988V129.659c0-10.372-9.037-18.738-19.41-18.738c-9.701,0-18.403,8.366-18.403,18.738v176.005
c0,0.336,0.671,1.678,0.671,2.678c-0.671,6.024,1.007,11.043,5.019,15.062l100.053,100.046c6.695,6.695,19.073,6.695,25.763,0
c7.694-7.695,7.188-18.86,0-26.099L324.906,302.988z"/>
</g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 111.577 111.577" style="enable-background:new 0 0 111.577 111.577;" xml:space="preserve">
<g>
<path d="M78.962,99.536l-1.559,6.373c-4.677,1.846-8.413,3.251-11.195,4.217c-2.785,0.969-6.021,1.451-9.708,1.451
c-5.662,0-10.066-1.387-13.207-4.142c-3.141-2.766-4.712-6.271-4.712-10.523c0-1.646,0.114-3.339,0.351-5.064
c0.239-1.727,0.619-3.672,1.139-5.846l5.845-20.688c0.52-1.981,0.962-3.858,1.316-5.633c0.359-1.764,0.532-3.387,0.532-4.848
c0-2.642-0.547-4.49-1.636-5.529c-1.089-1.036-3.167-1.562-6.252-1.562c-1.511,0-3.064,0.242-4.647,0.71
c-1.59,0.47-2.949,0.924-4.09,1.346l1.563-6.378c3.829-1.559,7.489-2.894,10.99-4.002c3.501-1.111,6.809-1.667,9.938-1.667
c5.623,0,9.962,1.359,13.009,4.077c3.047,2.72,4.57,6.246,4.57,10.591c0,0.899-0.1,2.483-0.315,4.747
c-0.21,2.269-0.601,4.348-1.171,6.239l-5.82,20.605c-0.477,1.655-0.906,3.547-1.279,5.676c-0.385,2.115-0.569,3.731-0.569,4.815
c0,2.736,0.61,4.604,1.833,5.597c1.232,0.993,3.354,1.487,6.368,1.487c1.415,0,3.025-0.251,4.814-0.744
C76.854,100.348,78.155,99.915,78.962,99.536z M80.438,13.03c0,3.59-1.353,6.656-4.072,9.177c-2.712,2.53-5.98,3.796-9.803,3.796
c-3.835,0-7.111-1.266-9.854-3.796c-2.738-2.522-4.11-5.587-4.11-9.177c0-3.583,1.372-6.654,4.11-9.207
C59.447,1.274,62.729,0,66.563,0c3.822,0,7.091,1.277,9.803,3.823C79.087,6.376,80.438,9.448,80.438,13.03z"/>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -0,0 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30">
<switch>
<g>
<path d="M2.995 1H5.67v24H2.995zm21.33 0H27v24h-2.675zM8.992 3.284c-.368 0-.669.224-.669.5v18.433c0 .276.3.5.669.5.369 0 .669-.224.669-.5V3.784c0-.276-.299-.5-.669-.5m4.003 0c-.368 0-.669.224-.669.5v18.433c0 .276.3.5.669.5.371 0 .669-.224.669-.5V3.784c0-.276-.298-.5-.669-.5m4.004 0c-.371 0-.669.224-.669.5v24.451c0 .277.298.5.669.5.368 0 .669-.223.669-.5V3.784c0-.276-.301-.5-.669-.5m4.003 0c-.368 0-.669.224-.669.5v18.433c0 .276.3.5.669.5.37 0 .669-.224.669-.5V3.784c-.001-.276-.3-.5-.669-.5"/>
</g>
</switch>
</svg>

After

Width:  |  Height:  |  Size: 629 B

View File

@ -75,7 +75,7 @@
"lining": [192, 193, 194, 255],
"viewport_overlay": [0, 0, 0, 192],
"primary": [12, 169, 227, 255],
"primary": [50, 130, 255, 255],
"primary_hover": [48, 182, 231, 255],
"primary_text": [255, 255, 255, 255],
"border": [127, 127, 127, 255],
@ -103,12 +103,14 @@
"machine_selector_hover": [68, 72, 75, 255],
"machine_selector_text_active": [255, 255, 255, 255],
"action_panel_secondary": [27, 95, 202, 255],
"text": [0, 0, 0, 255],
"text_detail": [174, 174, 174, 128],
"text_link": [12, 169, 227, 255],
"text_link": [50, 130, 255, 255],
"text_inactive": [174, 174, 174, 255],
"text_hover": [70, 84, 113, 255],
"text_pressed": [12, 169, 227, 255],
"text_pressed": [50, 130, 255, 255],
"text_subtext": [0, 0, 0, 255],
"text_medium": [128, 128, 128, 255],
"text_emphasis": [255, 255, 255, 255],
@ -116,6 +118,7 @@
"text_scene_hover": [70, 84, 113, 255],
"error": [255, 140, 0, 255],
"warning": [255, 190, 35, 255],
"button": [31, 36, 39, 255],
"button_hover": [68, 72, 75, 255],
@ -151,16 +154,16 @@
"action_button_border": [127, 127, 127, 255],
"action_button_hovered": [255, 255, 255, 255],
"action_button_hovered_text": [31, 36, 39, 255],
"action_button_hovered_border": [12, 169, 227, 255],
"action_button_hovered_border": [50, 130, 255, 255],
"action_button_active": [255, 255, 255, 255],
"action_button_active_text": [0, 0, 0, 255],
"action_button_active_border": [12, 169, 227, 255],
"action_button_active_border": [50, 130, 255, 255],
"action_button_disabled": [245, 245, 245, 255],
"action_button_disabled_text": [127, 127, 127, 255],
"action_button_disabled_border": [245, 245, 245, 255],
"print_button_ready": [12, 169, 227, 255],
"print_button_ready_border": [12, 169, 227, 255],
"print_button_ready": [50, 130, 255, 255],
"print_button_ready_border": [50, 130, 255, 255],
"print_button_ready_text": [255, 255, 255, 255],
"print_button_ready_hovered": [30, 186, 245, 243],
"print_button_ready_hovered_border": [30, 186, 245, 243],
@ -192,7 +195,7 @@
"setting_control_selected": [31, 36, 39, 255],
"setting_control_highlight": [255, 255, 255, 255],
"setting_control_border": [127, 127, 127, 255],
"setting_control_border_highlight": [12, 169, 227, 255],
"setting_control_border_highlight": [50, 130, 255, 255],
"setting_control_text": [27, 27, 27, 255],
"setting_control_depth_line": [127, 127, 127, 255],
"setting_control_button": [127, 127, 127, 255],
@ -210,7 +213,7 @@
"material_compatibility_warning": [0, 0, 0, 255],
"progressbar_background": [245, 245, 245, 255],
"progressbar_control": [31, 36, 39, 255],
"progressbar_control": [50, 130, 255, 255],
"slider_groove": [245, 245, 245, 255],
"slider_groove_border": [127, 127, 127, 255],
@ -230,18 +233,18 @@
"checkbox": [255, 255, 255, 255],
"checkbox_hover": [255, 255, 255, 255],
"checkbox_border": [64, 69, 72, 255],
"checkbox_border_hover": [12, 169, 227, 255],
"checkbox_border_hover": [50, 130, 255, 255],
"checkbox_mark": [119, 122, 124, 255],
"checkbox_text": [27, 27, 27, 255],
"mode_switch": [255, 255, 255, 255],
"mode_switch_hover": [255, 255, 255, 255],
"mode_switch_border": [127, 127, 127, 255],
"mode_switch_border_hover": [12, 169, 227, 255],
"mode_switch_border_hover": [50, 130, 255, 255],
"mode_switch_handle": [31, 36, 39, 255],
"mode_switch_text": [31, 36, 39, 255],
"mode_switch_text_hover": [31, 36, 39, 255],
"mode_switch_text_checked": [12, 169, 227, 255],
"mode_switch_text_checked": [50, 130, 255, 255],
"tooltip": [68, 192, 255, 255],
"tooltip_text": [255, 255, 255, 255],
@ -252,9 +255,9 @@
"message_shadow": [0, 0, 0, 120],
"message_border": [127, 127, 127, 255],
"message_text": [0, 0, 0, 255],
"message_button": [12, 169, 227, 255],
"message_button_hover": [12, 169, 227, 255],
"message_button_active": [12, 169, 227, 255],
"message_button": [50, 130, 255, 255],
"message_button_hover": [50, 130, 255, 255],
"message_button_active": [50, 130, 255, 255],
"message_button_text": [255, 255, 255, 255],
"message_button_text_hover": [255, 255, 255, 255],
"message_button_text_active": [255, 255, 255, 255],
@ -265,7 +268,7 @@
"status_offline": [0, 0, 0, 255],
"status_ready": [0, 205, 0, 255],
"status_busy": [12, 169, 227, 255],
"status_busy": [50, 130, 255, 255],
"status_paused": [255, 140, 0, 255],
"status_stopped": [236, 82, 80, 255],
"status_unknown": [127, 127, 127, 255],
@ -277,7 +280,7 @@
"all_axis": [255, 255, 255, 255],
"viewport_background": [245, 245, 245, 255],
"volume_outline": [12, 169, 227, 255],
"volume_outline": [50, 130, 255, 255],
"buildplate": [244, 244, 244, 255],
"buildplate_grid": [129, 131, 134, 255],
"buildplate_grid_minor": [230, 230, 231, 255],
@ -290,7 +293,7 @@
"model_overhang": [255, 0, 0, 255],
"model_unslicable": [122, 122, 122, 255],
"model_unslicable_alt": [172, 172, 127, 255],
"model_selection_outline": [12, 169, 227, 255],
"model_selection_outline": [50, 130, 255, 255],
"model_non_printing": [122, 122, 122, 255],
"xray": [26, 26, 62, 255],
@ -316,12 +319,12 @@
"configuration_item_text_active": [0, 0, 0, 255],
"configuration_item_border": [127, 127, 127, 255],
"configuration_item_border_active": [12, 169, 227, 32],
"configuration_item_border_hover": [12, 169, 227, 255],
"configuration_item_border_hover": [50, 130, 255, 255],
"tab_status_connected": [12, 169, 227, 255],
"tab_status_connected": [50, 130, 255, 255],
"tab_status_disconnected": [200, 200, 200, 255],
"printer_config_matched": [12, 169, 227, 255],
"printer_config_matched": [50, 130, 255, 255],
"printer_config_mismatch": [127, 127, 127, 255],
"toolbox_header_button_text_active": [0, 0, 0, 255],
@ -345,12 +348,12 @@
"monitor_pill_background": [245, 245, 245, 255],
"monitor_placeholder_image": [230, 230, 230, 255],
"monitor_printer_icon_inactive": [154, 154, 154, 255],
"monitor_printer_icon": [12, 169, 227, 255],
"monitor_printer_icon": [50, 130, 255, 255],
"monitor_progress_background_text": [0,0,0,255],
"monitor_progress_background": [245, 245, 245, 255],
"monitor_progress_fill_inactive": [154, 154, 154, 255],
"monitor_progress_fill_text": [255,255,255,255],
"monitor_progress_fill": [12, 169, 227, 255],
"monitor_progress_fill": [50, 130, 255, 255],
"monitor_shadow": [0, 0, 0, 63],
"monitor_skeleton_fill": [245, 245, 245, 255],
"monitor_skeleton_fill_dark": [216, 216, 216, 255],
@ -376,11 +379,16 @@
"configuration_selector_widget": [35.0, 4.5],
"configuration_selector_mode_tabs": [0.0, 3.0],
"action_panel_widget": [35.0, 0.0],
"action_panel_widget": [25.0, 0.0],
"action_panel_information_widget": [20.0, 0.0],
"action_panel_button": [15.0, 3.0],
"machine_selector_widget": [28.0, 4.5],
"views_selector": [0.0, 4.0],
"default_radius": [0.25, 0.25],
"wide_lining": [0.5, 0.5],
"thick_lining": [0.2, 0.2],
"default_lining": [0.08, 0.08],
@ -435,8 +443,8 @@
"tool_button_border": [1.0, 0],
"progressbar": [26.0, 0.4],
"progressbar_radius": [0, 0],
"progressbar": [26.0, 0.75],
"progressbar_radius": [0.15, 0.15],
"progressbar_control": [8.0, 0.4],
"scrollbar": [0.75, 0.5],