Merge branch 'master' of github.com:Ultimaker/Cura

This commit is contained in:
Tim Kuipers 2016-08-08 17:13:44 +02:00
commit 68798a0c81
5 changed files with 10472 additions and 103 deletions

View File

@ -13,7 +13,40 @@ import ".."
Button { Button {
id: base; id: base;
style: UM.Theme.styles.sidebar_category; style: ButtonStyle {
background: Item { }
label: Row
{
spacing: UM.Theme.getSize("default_lining").width
UM.RecolorImage
{
anchors.verticalCenter: parent.verticalCenter
height: label.height / 2
width: height
source: control.checked ? UM.Theme.getIcon("arrow_bottom") : UM.Theme.getIcon("arrow_right");
color: control.hovered ? palette.highlight : palette.buttonText
}
UM.RecolorImage
{
anchors.verticalCenter: parent.verticalCenter
height: label.height
width: height
source: control.iconSource
color: control.hovered ? palette.highlight : palette.buttonText
}
Label
{
id: label
anchors.verticalCenter: parent.verticalCenter
text: control.text
color: control.hovered ? palette.highlight : palette.buttonText
font.bold: true
}
SystemPalette { id: palette }
}
}
signal showTooltip(string text); signal showTooltip(string text);
signal hideTooltip(); signal hideTooltip();

View File

@ -16,17 +16,17 @@ UM.TooltipArea
width: childrenRect.width; width: childrenRect.width;
height: childrenRect.height; height: childrenRect.height;
Button CheckBox
{ {
id: check id: check
text: definition.label text: definition.label
checked: addedSettingsModel.getVisible(model.key)
onClicked: onClicked:
{ {
addedSettingsModel.setVisible(model.key, true); addedSettingsModel.setVisible(model.key, checked);
settingPickDialog.visible = false UM.ActiveTool.forceUpdate();
UM.ActiveTool.forceUpdate()
} }
} }
} }

View File

@ -147,6 +147,10 @@ Item {
} }
} }
Column
{
spacing: UM.Theme.getSize("default_lining").height
Repeater Repeater
{ {
id: contents id: contents
@ -169,8 +173,8 @@ Item {
Loader Loader
{ {
id: settingLoader id: settingLoader
width: UM.Theme.getSize("setting").width; width: UM.Theme.getSize("setting").width
height: UM.Theme.getSize("section").height; height: UM.Theme.getSize("section").height
property var definition: model property var definition: model
property var settingDefinitionsModel: addedSettingsModel property var settingDefinitionsModel: addedSettingsModel
@ -215,7 +219,7 @@ Item {
Button Button
{ {
width: UM.Theme.getSize("setting").height; width: UM.Theme.getSize("setting").height / 2;
height: UM.Theme.getSize("setting").height; height: UM.Theme.getSize("setting").height;
onClicked: addedSettingsModel.setVisible(model.key, false); onClicked: addedSettingsModel.setVisible(model.key, false);
@ -227,17 +231,17 @@ Item {
UM.RecolorImage UM.RecolorImage
{ {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter width: parent.width
width: parent.width/2 height: parent.height / 2
height: parent.height/2
sourceSize.width: width sourceSize.width: width
sourceSize.height: width sourceSize.height: width
color: control.hovered ? UM.Theme.getColor("setting_control_button_hover") : UM.Theme.getColor("setting_control_button") color: control.hovered ? UM.Theme.getColor("setting_control_button_hover") : UM.Theme.getColor("setting_control_button")
source: UM.Theme.getIcon("cross1") source: UM.Theme.getIcon("minus")
} }
} }
} }
} }
UM.SettingPropertyProvider UM.SettingPropertyProvider
{ {
id: provider id: provider
@ -250,6 +254,7 @@ Item {
} }
} }
} }
}
Button Button
{ {
@ -257,7 +262,7 @@ Item {
height: UM.Theme.getSize("setting").height; height: UM.Theme.getSize("setting").height;
visible: parseInt(UM.Preferences.getValue("cura/active_mode")) == 1 visible: parseInt(UM.Preferences.getValue("cura/active_mode")) == 1
text: catalog.i18nc("@action:button", "Add Setting"); text: catalog.i18nc("@action:button", "Select settings");
style: ButtonStyle style: ButtonStyle
{ {
@ -297,16 +302,19 @@ Item {
UM.Dialog { UM.Dialog {
id: settingPickDialog id: settingPickDialog
title: catalog.i18nc("@title:window", "Pick a Setting to Customize") title: catalog.i18nc("@title:window", "Select Settings to Customize for this object")
width: screenScaleFactor * 360;
property string labelFilter: "" property string labelFilter: ""
TextField { TextField {
id: filter; id: filter
anchors { anchors {
top: parent.top; top: parent.top
left: parent.left; left: parent.left
right: parent.right; right: toggleShowAll.left
rightMargin: UM.Theme.getSize("default_margin").width
} }
placeholderText: catalog.i18nc("@label:textbox", "Filter..."); placeholderText: catalog.i18nc("@label:textbox", "Filter...");
@ -324,6 +332,23 @@ Item {
} }
} }
CheckBox
{
id: toggleShowAll
anchors {
top: parent.top
right: parent.right
}
text: catalog.i18nc("@label:checkbox", "Show all")
checked: listview.model.showAll
onClicked:
{
listview.model.showAll = checked;
}
}
ScrollView ScrollView
{ {
id: scrollView id: scrollView
@ -377,7 +402,7 @@ Item {
rightButtons: [ rightButtons: [
Button { Button {
text: catalog.i18nc("@action:button", "Cancel"); text: catalog.i18nc("@action:button", "Close");
onClicked: { onClicked: {
settingPickDialog.visible = false; settingPickDialog.visible = false;
} }

View File

@ -19,6 +19,29 @@ Rectangle
property real progress: printerConnected ? Cura.MachineManager.printerOutputDevices[0].progress : 0 property real progress: printerConnected ? Cura.MachineManager.printerOutputDevices[0].progress : 0
property int backendState: UM.Backend.state property int backendState: UM.Backend.state
property bool showProgress: {
// determine if we need to show the progress bar + percentage
if(!printerConnected || !printerAcceptsCommands)
return false;
switch(Cura.MachineManager.printerOutputDevices[0].jobState)
{
case "printing":
case "pre_print": // heating, etc.
case "paused":
return true;
case "wait_cleanup":
case "ready": // nut sure if this occurs, "" seems to be the ready state.
case "offline":
case "abort": // note sure if this jobState actually occurs in the wild
case "error": // after clicking abort you apparently get "error"
case "": // ready to print
default:
return false;
}
}
property variant statusColor: property variant statusColor:
{ {
if(!printerConnected || !printerAcceptsCommands) if(!printerConnected || !printerAcceptsCommands)
@ -96,7 +119,7 @@ Rectangle
color: base.statusColor color: base.statusColor
font: UM.Theme.getFont("large") font: UM.Theme.getFont("large")
text: Math.round(progress) + "%" text: Math.round(progress) + "%"
visible: printerConnected visible: showProgress
} }
Rectangle Rectangle
@ -110,6 +133,7 @@ Rectangle
anchors.leftMargin: UM.Theme.getSize("default_margin").width anchors.leftMargin: UM.Theme.getSize("default_margin").width
radius: UM.Theme.getSize("progressbar_radius").width radius: UM.Theme.getSize("progressbar_radius").width
color: UM.Theme.getColor("progressbar_background") color: UM.Theme.getColor("progressbar_background")
visible: showProgress
Rectangle Rectangle
{ {
@ -134,9 +158,8 @@ Rectangle
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: UM.Theme.getSize("default_margin").width anchors.rightMargin: UM.Theme.getSize("default_margin").width
text: catalog.i18nc("@label:", "Abort Print") text: catalog.i18nc("@label:", "Abort Print");
onClicked: Cura.MachineManager.printerOutputDevices[0].setJobState("abort") onClicked: Cura.MachineManager.printerOutputDevices[0].setJobState("abort");
style: ButtonStyle style: ButtonStyle
{ {
@ -206,8 +229,36 @@ Rectangle
enabled: printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands && enabled: printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands &&
(Cura.MachineManager.printerOutputDevices[0].jobState == "paused" || Cura.MachineManager.printerOutputDevices[0].jobState == "printing") (Cura.MachineManager.printerOutputDevices[0].jobState == "paused" || Cura.MachineManager.printerOutputDevices[0].jobState == "printing")
text: printerConnected ? Cura.MachineManager.printerOutputDevices[0].jobState == "paused" ? catalog.i18nc("@label:", "Resume") : catalog.i18nc("@label:", "Pause") : "" property bool userClicked: false
onClicked: Cura.MachineManager.printerOutputDevices[0].setJobState(Cura.MachineManager.printerOutputDevices[0].jobState == "paused" ? "print" : "pause")
text: {
var result = "";
if (!printerConnected) {
return "";
}
if (Cura.MachineManager.printerOutputDevices[0].jobState == "paused")
{
if (userClicked) {
result = catalog.i18nc("@label:", "Resuming...");
} else {
result = catalog.i18nc("@label:", "Resume");
}
} else {
if (userClicked) {
result = catalog.i18nc("@label:", "Pausing...");
} else {
result = catalog.i18nc("@label:", "Pause");
}
}
userClicked = false;
return result;
}
onClicked: {
var newJobState = Cura.MachineManager.printerOutputDevices[0].jobState == "paused" ? "print" : "pause";
Cura.MachineManager.printerOutputDevices[0].setJobState(newJobState);
userClicked = true;
}
style: ButtonStyle style: ButtonStyle
{ {

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 760 KiB