mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-09 06:45:09 -06:00
Merge branch 'master' into fix_material_uniqueness
This commit is contained in:
commit
e45f04f391
207 changed files with 5283 additions and 1264 deletions
|
@ -205,6 +205,7 @@ Item
|
|||
text: catalog.i18ncp("@action:inmenu menubar:edit", "Multiply Selected Model", "Multiply Selected Models", UM.Selection.selectionCount);
|
||||
enabled: UM.Controller.toolsEnabled && UM.Selection.hasSelection;
|
||||
iconName: "edit-duplicate";
|
||||
shortcut: "Ctrl+M"
|
||||
}
|
||||
|
||||
Action
|
||||
|
|
|
@ -180,7 +180,7 @@ UM.Dialog
|
|||
anchors.bottom:parent.bottom
|
||||
spacing: UM.Theme.getSize("default_margin").width
|
||||
|
||||
Text
|
||||
Label
|
||||
{
|
||||
text: catalog.i18nc("@label", "Printer Name:")
|
||||
anchors.verticalCenter: machineName.verticalCenter
|
||||
|
|
|
@ -14,8 +14,8 @@ UM.Dialog
|
|||
id: base
|
||||
title: catalog.i18nc("@title:window", "Discard or Keep changes")
|
||||
|
||||
width: 800 * Screen.devicePixelRatio
|
||||
height: 400 * Screen.devicePixelRatio
|
||||
width: 800
|
||||
height: 400
|
||||
property var changesModel: Cura.UserChangesModel{ id: userChangesModel}
|
||||
onVisibilityChanged:
|
||||
{
|
||||
|
@ -36,9 +36,14 @@ UM.Dialog
|
|||
}
|
||||
}
|
||||
|
||||
Column
|
||||
Row
|
||||
{
|
||||
anchors.fill: parent
|
||||
id: infoTextRow
|
||||
height: childrenRect.height
|
||||
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
spacing: UM.Theme.getSize("default_margin").width
|
||||
|
||||
UM.I18nCatalog
|
||||
|
@ -47,29 +52,26 @@ UM.Dialog
|
|||
name: "cura"
|
||||
}
|
||||
|
||||
Row
|
||||
Label
|
||||
{
|
||||
height: childrenRect.height
|
||||
text: catalog.i18nc("@text:window", "You have customized some profile settings.\nWould you like to keep or discard those settings?")
|
||||
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
spacing: UM.Theme.getSize("default_margin").width
|
||||
|
||||
Label
|
||||
{
|
||||
text: catalog.i18nc("@text:window", "You have customized some profile settings.\nWould you like to keep or discard those settings?")
|
||||
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||
font: UM.Theme.getFont("default")
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
font: UM.Theme.getFont("default")
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
}
|
||||
|
||||
Item
|
||||
{
|
||||
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||
anchors.top: infoTextRow.bottom
|
||||
anchors.bottom: optionRow.top
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
TableView
|
||||
{
|
||||
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
height: base.height - 150 * Screen.devicePixelRatio
|
||||
anchors.fill: parent
|
||||
height: base.height - 150
|
||||
id: tableView
|
||||
Component
|
||||
{
|
||||
|
@ -132,92 +134,96 @@ UM.Dialog
|
|||
|
||||
model: base.changesModel
|
||||
}
|
||||
}
|
||||
|
||||
Item
|
||||
Item
|
||||
{
|
||||
id: optionRow
|
||||
anchors.bottom: buttonsRow.top
|
||||
anchors.right: parent.right
|
||||
anchors.left: parent.left
|
||||
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||
height: childrenRect.height
|
||||
|
||||
ComboBox
|
||||
{
|
||||
anchors.right: parent.right
|
||||
anchors.left: parent.left
|
||||
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||
height:childrenRect.height
|
||||
id: discardOrKeepProfileChangesDropDownButton
|
||||
width: 300
|
||||
|
||||
ComboBox
|
||||
model: ListModel
|
||||
{
|
||||
id: discardOrKeepProfileChangesDropDownButton
|
||||
width: 300
|
||||
id: discardOrKeepProfileListModel
|
||||
|
||||
model: ListModel
|
||||
{
|
||||
id: discardOrKeepProfileListModel
|
||||
|
||||
Component.onCompleted: {
|
||||
append({ text: catalog.i18nc("@option:discardOrKeep", "Always ask me this"), code: "always_ask" })
|
||||
append({ text: catalog.i18nc("@option:discardOrKeep", "Discard and never ask again"), code: "always_discard" })
|
||||
append({ text: catalog.i18nc("@option:discardOrKeep", "Keep and never ask again"), code: "always_keep" })
|
||||
}
|
||||
}
|
||||
|
||||
onActivated:
|
||||
{
|
||||
var code = model.get(index).code;
|
||||
UM.Preferences.setValue("cura/choice_on_profile_override", code);
|
||||
|
||||
if (code == "always_keep") {
|
||||
keepButton.enabled = true;
|
||||
discardButton.enabled = false;
|
||||
}
|
||||
else if (code == "always_discard") {
|
||||
keepButton.enabled = false;
|
||||
discardButton.enabled = true;
|
||||
}
|
||||
else {
|
||||
keepButton.enabled = true;
|
||||
discardButton.enabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Item
|
||||
{
|
||||
anchors.right: parent.right
|
||||
anchors.left: parent.left
|
||||
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||
height: childrenRect.height
|
||||
|
||||
Button
|
||||
{
|
||||
id: discardButton
|
||||
text: catalog.i18nc("@action:button", "Discard");
|
||||
anchors.right: parent.right
|
||||
onClicked:
|
||||
{
|
||||
CuraApplication.discardOrKeepProfileChangesClosed("discard")
|
||||
base.hide()
|
||||
}
|
||||
isDefault: true
|
||||
}
|
||||
|
||||
Button
|
||||
{
|
||||
id: keepButton
|
||||
text: catalog.i18nc("@action:button", "Keep");
|
||||
anchors.right: discardButton.left
|
||||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||
onClicked:
|
||||
{
|
||||
CuraApplication.discardOrKeepProfileChangesClosed("keep")
|
||||
base.hide()
|
||||
Component.onCompleted: {
|
||||
append({ text: catalog.i18nc("@option:discardOrKeep", "Always ask me this"), code: "always_ask" })
|
||||
append({ text: catalog.i18nc("@option:discardOrKeep", "Discard and never ask again"), code: "always_discard" })
|
||||
append({ text: catalog.i18nc("@option:discardOrKeep", "Keep and never ask again"), code: "always_keep" })
|
||||
}
|
||||
}
|
||||
|
||||
Button
|
||||
onActivated:
|
||||
{
|
||||
id: createNewProfileButton
|
||||
text: catalog.i18nc("@action:button", "Create New Profile");
|
||||
anchors.left: parent.left
|
||||
action: Cura.Actions.addProfile
|
||||
onClicked: base.hide()
|
||||
var code = model.get(index).code;
|
||||
UM.Preferences.setValue("cura/choice_on_profile_override", code);
|
||||
|
||||
if (code == "always_keep") {
|
||||
keepButton.enabled = true;
|
||||
discardButton.enabled = false;
|
||||
}
|
||||
else if (code == "always_discard") {
|
||||
keepButton.enabled = false;
|
||||
discardButton.enabled = true;
|
||||
}
|
||||
else {
|
||||
keepButton.enabled = true;
|
||||
discardButton.enabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Item
|
||||
{
|
||||
id: buttonsRow
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.right: parent.right
|
||||
anchors.left: parent.left
|
||||
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||
height: childrenRect.height
|
||||
|
||||
Button
|
||||
{
|
||||
id: discardButton
|
||||
text: catalog.i18nc("@action:button", "Discard");
|
||||
anchors.right: parent.right
|
||||
onClicked:
|
||||
{
|
||||
CuraApplication.discardOrKeepProfileChangesClosed("discard")
|
||||
base.hide()
|
||||
}
|
||||
isDefault: true
|
||||
}
|
||||
|
||||
Button
|
||||
{
|
||||
id: keepButton
|
||||
text: catalog.i18nc("@action:button", "Keep");
|
||||
anchors.right: discardButton.left
|
||||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||
onClicked:
|
||||
{
|
||||
CuraApplication.discardOrKeepProfileChangesClosed("keep")
|
||||
base.hide()
|
||||
}
|
||||
}
|
||||
|
||||
Button
|
||||
{
|
||||
id: createNewProfileButton
|
||||
text: catalog.i18nc("@action:button", "Create New Profile");
|
||||
anchors.left: parent.left
|
||||
action: Cura.Actions.addProfile
|
||||
onClicked: base.hide()
|
||||
}
|
||||
}
|
||||
}
|
80
resources/qml/ExtruderButton.qml
Normal file
80
resources/qml/ExtruderButton.qml
Normal file
|
@ -0,0 +1,80 @@
|
|||
// Copyright (c) 2017 Ultimaker B.V.
|
||||
// Cura is released under the terms of the AGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.1
|
||||
|
||||
import UM 1.2 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Button
|
||||
{
|
||||
id: base
|
||||
|
||||
property var extruder;
|
||||
|
||||
text: catalog.i18ncp("@label", "Print Selected Model with %1", "Print Selected Models With %1", UM.Selection.selectionCount).arg(extruder.name)
|
||||
|
||||
style: UM.Theme.styles.tool_button;
|
||||
iconSource: checked ? UM.Theme.getIcon("material_selected") : UM.Theme.getIcon("material_not_selected");
|
||||
|
||||
checked: ExtruderManager.selectedObjectExtruders.indexOf(extruder.id) != -1
|
||||
enabled: UM.Selection.hasSelection
|
||||
|
||||
property color customColor: base.hovered ? UM.Theme.getColor("button_hover") : UM.Theme.getColor("button");
|
||||
|
||||
Rectangle
|
||||
{
|
||||
anchors.fill: parent
|
||||
anchors.margins: UM.Theme.getSize("default_lining").width;
|
||||
|
||||
color: "transparent"
|
||||
|
||||
border.width: base.checked ? UM.Theme.getSize("default_lining").width : 0;
|
||||
border.color: UM.Theme.getColor("button_text")
|
||||
}
|
||||
|
||||
Item
|
||||
{
|
||||
anchors
|
||||
{
|
||||
right: parent.right;
|
||||
top: parent.top;
|
||||
margins: UM.Theme.getSize("default_lining").width * 3
|
||||
}
|
||||
width: UM.Theme.getSize("default_margin").width
|
||||
height: UM.Theme.getSize("default_margin").height
|
||||
|
||||
Text
|
||||
{
|
||||
anchors.centerIn: parent;
|
||||
text: index + 1;
|
||||
color: parent.enabled ? UM.Theme.getColor("button_text") : UM.Theme.getColor("button_disabled_text")
|
||||
font: UM.Theme.getFont("default_bold");
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle
|
||||
{
|
||||
anchors
|
||||
{
|
||||
left: parent.left;
|
||||
top: parent.top;
|
||||
margins: UM.Theme.getSize("default_lining").width * 3
|
||||
}
|
||||
|
||||
color: model.color
|
||||
|
||||
width: UM.Theme.getSize("default_margin").width
|
||||
height: UM.Theme.getSize("default_margin").height
|
||||
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color: UM.Theme.getColor("lining");
|
||||
}
|
||||
|
||||
onClicked:
|
||||
{
|
||||
forceActiveFocus() //First grab focus, so all the text fields are updated
|
||||
CuraActions.setExtruderForSelection(extruder.id);
|
||||
}
|
||||
}
|
|
@ -24,6 +24,7 @@ Item {
|
|||
UM.I18nCatalog { id: catalog; name:"cura"}
|
||||
|
||||
property variant printDuration: PrintInformation.currentPrintTime
|
||||
property variant printDurationPerFeature: PrintInformation.printTimesPerFeature
|
||||
property variant printMaterialLengths: PrintInformation.materialLengths
|
||||
property variant printMaterialWeights: PrintInformation.materialWeights
|
||||
property variant printMaterialCosts: PrintInformation.materialCosts
|
||||
|
@ -159,7 +160,7 @@ Item {
|
|||
UM.RecolorImage
|
||||
{
|
||||
id: timeIcon
|
||||
anchors.right: timeSpec.left
|
||||
anchors.right: timeSpecPerFeatureTooltipArea.left
|
||||
anchors.rightMargin: UM.Theme.getSize("default_margin").width/2
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
width: UM.Theme.getSize("save_button_specs_icons").width
|
||||
|
@ -169,15 +170,50 @@ Item {
|
|||
color: UM.Theme.getColor("text_subtext")
|
||||
source: UM.Theme.getIcon("print_time")
|
||||
}
|
||||
Text
|
||||
UM.TooltipArea
|
||||
{
|
||||
id: timeSpec
|
||||
id: timeSpecPerFeatureTooltipArea
|
||||
text: {
|
||||
var order = ["inset_0", "inset_x", "skin", "infill", "support_infill", "support_interface", "support", "travel", "retract", "none"];
|
||||
var visible_names = {
|
||||
"inset_0": catalog.i18nc("@tooltip", "Outer Wall"),
|
||||
"inset_x": catalog.i18nc("@tooltip", "Inner Walls"),
|
||||
"skin": catalog.i18nc("@tooltip", "Skin"),
|
||||
"infill": catalog.i18nc("@tooltip", "Infill"),
|
||||
"support_infill": catalog.i18nc("@tooltip", "Support Infill"),
|
||||
"support_interface": catalog.i18nc("@tooltip", "Support Interface"),
|
||||
"support": catalog.i18nc("@tooltip", "Support"),
|
||||
"travel": catalog.i18nc("@tooltip", "Travel"),
|
||||
"retract": catalog.i18nc("@tooltip", "Retractions"),
|
||||
"none": catalog.i18nc("@tooltip", "Other")
|
||||
};
|
||||
var result = "";
|
||||
for(var feature in order)
|
||||
{
|
||||
feature = order[feature];
|
||||
if(base.printDurationPerFeature[feature] && base.printDurationPerFeature[feature].totalSeconds > 0)
|
||||
{
|
||||
result += "<br/>" + visible_names[feature] + ": " + base.printDurationPerFeature[feature].getDisplayString(UM.DurationFormat.Short);
|
||||
}
|
||||
}
|
||||
result = result.replace(/^\<br\/\>/, ""); // remove newline before first item
|
||||
return result;
|
||||
}
|
||||
width: childrenRect.width
|
||||
height: childrenRect.height
|
||||
anchors.right: lengthIcon.left
|
||||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
font: UM.Theme.getFont("small")
|
||||
color: UM.Theme.getColor("text_subtext")
|
||||
text: (!base.printDuration || !base.printDuration.valid) ? catalog.i18nc("@label", "00h 00min") : base.printDuration.getDisplayString(UM.DurationFormat.Short)
|
||||
|
||||
Text
|
||||
{
|
||||
id: timeSpec
|
||||
anchors.left: parent.left
|
||||
anchors.top: parent.top
|
||||
font: UM.Theme.getFont("small")
|
||||
color: UM.Theme.getColor("text_subtext")
|
||||
text: (!base.printDuration || !base.printDuration.valid) ? catalog.i18nc("@label", "00h 00min") : base.printDuration.getDisplayString(UM.DurationFormat.Short)
|
||||
}
|
||||
}
|
||||
UM.RecolorImage
|
||||
{
|
||||
|
@ -212,8 +248,9 @@ Item {
|
|||
{
|
||||
lengths.push(base.printMaterialLengths[index].toFixed(2));
|
||||
weights.push(String(Math.floor(base.printMaterialWeights[index])));
|
||||
costs.push(base.printMaterialCosts[index].toFixed(2));
|
||||
if(base.printMaterialCosts[index] > 0)
|
||||
var cost = base.printMaterialCosts[index] == undefined ? 0 : base.printMaterialCosts[index].toFixed(2);
|
||||
costs.push(cost);
|
||||
if(cost > 0)
|
||||
{
|
||||
someCostsKnown = true;
|
||||
}
|
||||
|
|
6
resources/qml/Menus/ContextMenu.qml
Normal file → Executable file
6
resources/qml/Menus/ContextMenu.qml
Normal file → Executable file
|
@ -93,6 +93,11 @@ Menu
|
|||
copiesField.focus = true;
|
||||
}
|
||||
|
||||
onVisibleChanged:
|
||||
{
|
||||
copiesField.forceActiveFocus();
|
||||
}
|
||||
|
||||
standardButtons: StandardButton.Ok | StandardButton.Cancel
|
||||
|
||||
Row
|
||||
|
@ -108,6 +113,7 @@ Menu
|
|||
SpinBox
|
||||
{
|
||||
id: copiesField
|
||||
focus: true
|
||||
minimumValue: 1
|
||||
maximumValue: 99
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ Menu
|
|||
{
|
||||
text: model.name + " - " + model.layer_height
|
||||
checkable: true
|
||||
checked: Cura.MachineManager.activeQualityChangesId == "empty_quality_changes" && Cura.MachineManager.activeQualityType == model.metadata.quality_type
|
||||
checked: Cura.MachineManager.activeQualityChangesId == "" && Cura.MachineManager.activeQualityType == model.metadata.quality_type
|
||||
exclusiveGroup: group
|
||||
onTriggered: Cura.MachineManager.setActiveQuality(model.id)
|
||||
}
|
||||
|
|
|
@ -25,6 +25,17 @@ UM.PreferencesPage
|
|||
}
|
||||
}
|
||||
|
||||
function setDefaultTheme(defaultThemeCode)
|
||||
{
|
||||
for(var i = 0; i < themeList.count; i++)
|
||||
{
|
||||
if (themeComboBox.model.get(i).code == defaultThemeCode)
|
||||
{
|
||||
themeComboBox.currentIndex = i
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function setDefaultDiscardOrKeepProfile(code)
|
||||
{
|
||||
for (var i = 0; i < choiceOnProfileOverrideDropDownButton.model.count; i++)
|
||||
|
@ -55,6 +66,10 @@ UM.PreferencesPage
|
|||
var defaultLanguage = UM.Preferences.getValue("general/language")
|
||||
setDefaultLanguage(defaultLanguage)
|
||||
|
||||
UM.Preferences.resetPreference("general/theme")
|
||||
var defaultTheme = UM.Preferences.getValue("general/theme")
|
||||
setDefaultTheme(defaultTheme)
|
||||
|
||||
UM.Preferences.resetPreference("physics/automatic_push_free")
|
||||
pushFreeCheckbox.checked = boolCheck(UM.Preferences.getValue("physics/automatic_push_free"))
|
||||
UM.Preferences.resetPreference("physics/automatic_drop_down")
|
||||
|
@ -111,9 +126,11 @@ UM.PreferencesPage
|
|||
text: catalog.i18nc("@label","Interface")
|
||||
}
|
||||
|
||||
Row
|
||||
GridLayout
|
||||
{
|
||||
spacing: UM.Theme.getSize("default_margin").width
|
||||
id: interfaceGrid
|
||||
columns: 4
|
||||
|
||||
Label
|
||||
{
|
||||
id: languageLabel
|
||||
|
@ -174,22 +191,75 @@ UM.PreferencesPage
|
|||
{
|
||||
id: currencyLabel
|
||||
text: catalog.i18nc("@label","Currency:")
|
||||
anchors.verticalCenter: languageComboBox.verticalCenter
|
||||
anchors.verticalCenter: currencyField.verticalCenter
|
||||
}
|
||||
|
||||
TextField
|
||||
{
|
||||
id: currencyField
|
||||
text: UM.Preferences.getValue("cura/currency")
|
||||
onTextChanged: UM.Preferences.setValue("cura/currency", text)
|
||||
}
|
||||
|
||||
Label
|
||||
{
|
||||
id: themeLabel
|
||||
text: catalog.i18nc("@label","Theme:")
|
||||
anchors.verticalCenter: themeComboBox.verticalCenter
|
||||
}
|
||||
|
||||
ComboBox
|
||||
{
|
||||
id: themeComboBox
|
||||
|
||||
model: ListModel
|
||||
{
|
||||
id: themeList
|
||||
|
||||
Component.onCompleted: {
|
||||
append({ text: catalog.i18nc("@item:inlistbox", "Ultimaker"), code: "cura" })
|
||||
}
|
||||
}
|
||||
|
||||
currentIndex:
|
||||
{
|
||||
var code = UM.Preferences.getValue("general/theme");
|
||||
for(var i = 0; i < themeList.count; ++i)
|
||||
{
|
||||
if(model.get(i).code == code)
|
||||
{
|
||||
return i
|
||||
}
|
||||
}
|
||||
}
|
||||
onActivated: UM.Preferences.setValue("general/theme", model.get(index).code)
|
||||
|
||||
Component.onCompleted:
|
||||
{
|
||||
// Because ListModel is stupid and does not allow using qsTr() for values.
|
||||
for(var i = 0; i < themeList.count; ++i)
|
||||
{
|
||||
themeList.setProperty(i, "text", catalog.i18n(themeList.get(i).text));
|
||||
}
|
||||
|
||||
// Glorious hack time. ComboBox does not update the text properly after changing the
|
||||
// model. So change the indices around to force it to update.
|
||||
currentIndex += 1;
|
||||
currentIndex -= 1;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Label
|
||||
|
||||
|
||||
|
||||
Label
|
||||
{
|
||||
id: languageCaption
|
||||
|
||||
//: Language change warning
|
||||
text: catalog.i18nc("@label", "You will need to restart the application for language changes to have effect.")
|
||||
text: catalog.i18nc("@label", "You will need to restart the application for these changes to have effect.")
|
||||
wrapMode: Text.WordWrap
|
||||
font.italic: true
|
||||
}
|
||||
|
@ -211,14 +281,13 @@ UM.PreferencesPage
|
|||
CheckBox
|
||||
{
|
||||
id: autoSliceCheckbox
|
||||
|
||||
checked: boolCheck(UM.Preferences.getValue("general/auto_slice"))
|
||||
onClicked: UM.Preferences.setValue("general/auto_slice", checked)
|
||||
|
||||
text: catalog.i18nc("@option:check","Slice automatically");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Item
|
||||
{
|
||||
//: Spacer
|
||||
|
@ -253,7 +322,7 @@ UM.PreferencesPage
|
|||
UM.TooltipArea {
|
||||
width: childrenRect.width;
|
||||
height: childrenRect.height;
|
||||
text: catalog.i18nc("@info:tooltip","Moves the camera so the model is in the center of the view when an model is selected")
|
||||
text: catalog.i18nc("@info:tooltip","Moves the camera so the model is in the center of the view when a model is selected")
|
||||
|
||||
CheckBox
|
||||
{
|
||||
|
|
|
@ -154,7 +154,7 @@ Item
|
|||
id: definitionsModel;
|
||||
containerId: Cura.MachineManager.activeDefinitionId
|
||||
visibilityHandler: UM.SettingPreferenceVisibilityHandler { }
|
||||
exclude: ["machine_settings", "command_line_settings", "infill_mesh", "infill_mesh_order", "support_mesh", "anti_overhang_mesh"] // TODO: infill_mesh settigns are excluded hardcoded, but should be based on the fact that settable_globally, settable_per_meshgroup and settable_per_extruder are false.
|
||||
exclude: ["machine_settings", "command_line_settings", "infill_mesh", "infill_mesh_order", "cutting_mesh", "support_mesh", "anti_overhang_mesh"] // TODO: infill_mesh settigns are excluded hardcoded, but should be based on the fact that settable_globally, settable_per_meshgroup and settable_per_extruder are false.
|
||||
expanded: CuraApplication.expandedCategories
|
||||
onExpandedChanged:
|
||||
{
|
||||
|
@ -179,7 +179,7 @@ Item
|
|||
Behavior on opacity { NumberAnimation { duration: 100 } }
|
||||
enabled:
|
||||
{
|
||||
if(!ExtruderManager.activeExtruderStackId && ExtruderManager.extruderCount > 0)
|
||||
if(!ExtruderManager.activeExtruderStackId && machineExtruderCount.properties.value > 1)
|
||||
{
|
||||
// disable all controls on the global tab, except categories
|
||||
return model.type == "category"
|
||||
|
|
|
@ -348,6 +348,7 @@ Rectangle
|
|||
|
||||
Rectangle {
|
||||
id: settingsModeSelection
|
||||
color: "transparent"
|
||||
width: parent.width * 0.55
|
||||
height: UM.Theme.getSize("sidebar_header_mode_toggle").height
|
||||
anchors.right: parent.right
|
||||
|
@ -408,18 +409,34 @@ Rectangle
|
|||
}
|
||||
ExclusiveGroup { id: modeMenuGroup; }
|
||||
|
||||
Text
|
||||
Label
|
||||
{
|
||||
id: toggleLeftText
|
||||
anchors.right: modeToggleSwitch.left
|
||||
anchors.rightMargin: UM.Theme.getSize("toggle_button_text_anchoring_margin").width
|
||||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: ""
|
||||
color: UM.Theme.getColor("toggle_active_text")
|
||||
color:
|
||||
{
|
||||
if(toggleLeftTextMouseArea.containsMouse)
|
||||
{
|
||||
return UM.Theme.getColor("mode_switch_text_hover");
|
||||
}
|
||||
else if(!modeToggleSwitch.checked)
|
||||
{
|
||||
return UM.Theme.getColor("mode_switch_text_checked");
|
||||
}
|
||||
else
|
||||
{
|
||||
return UM.Theme.getColor("mode_switch_text");
|
||||
}
|
||||
}
|
||||
font: UM.Theme.getFont("default")
|
||||
|
||||
MouseArea
|
||||
{
|
||||
id: toggleLeftTextMouseArea
|
||||
hoverEnabled: true
|
||||
anchors.fill: parent
|
||||
onClicked:
|
||||
{
|
||||
|
@ -438,10 +455,20 @@ Rectangle
|
|||
id: modeToggleSwitch
|
||||
checked: false
|
||||
anchors.right: toggleRightText.left
|
||||
anchors.rightMargin: UM.Theme.getSize("toggle_button_text_anchoring_margin").width
|
||||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
onClicked:
|
||||
property bool _hovered: modeToggleSwitchMouseArea.containsMouse || toggleLeftTextMouseArea.containsMouse || toggleRightTextMouseArea.containsMouse
|
||||
|
||||
MouseArea
|
||||
{
|
||||
id: modeToggleSwitchMouseArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
acceptedButtons: Qt.NoButton
|
||||
}
|
||||
|
||||
onCheckedChanged:
|
||||
{
|
||||
var index = 0;
|
||||
if (checked)
|
||||
|
@ -457,20 +484,36 @@ Rectangle
|
|||
UM.Preferences.setValue("cura/active_mode", index);
|
||||
}
|
||||
|
||||
style: UM.Theme.styles.toggle_button
|
||||
style: UM.Theme.styles.mode_switch
|
||||
}
|
||||
|
||||
Text
|
||||
Label
|
||||
{
|
||||
id: toggleRightText
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: ""
|
||||
color: UM.Theme.getColor("toggle_active_text")
|
||||
color:
|
||||
{
|
||||
if(toggleRightTextMouseArea.containsMouse)
|
||||
{
|
||||
return UM.Theme.getColor("mode_switch_text_hover");
|
||||
}
|
||||
else if(modeToggleSwitch.checked)
|
||||
{
|
||||
return UM.Theme.getColor("mode_switch_text_checked");
|
||||
}
|
||||
else
|
||||
{
|
||||
return UM.Theme.getColor("mode_switch_text");
|
||||
}
|
||||
}
|
||||
font: UM.Theme.getFont("default")
|
||||
|
||||
MouseArea
|
||||
{
|
||||
id: toggleRightTextMouseArea
|
||||
hoverEnabled: true
|
||||
anchors.fill: parent
|
||||
onClicked:
|
||||
{
|
||||
|
|
|
@ -19,7 +19,7 @@ Item
|
|||
property Action configureSettings;
|
||||
property variant minimumPrintTime: PrintInformation.minimumPrintTime;
|
||||
property variant maximumPrintTime: PrintInformation.maximumPrintTime;
|
||||
property bool settingsEnabled: ExtruderManager.activeExtruderStackId || ExtruderManager.extruderCount == 0
|
||||
property bool settingsEnabled: ExtruderManager.activeExtruderStackId || machineExtruderCount.properties.value == 1
|
||||
|
||||
Component.onCompleted: PrintInformation.enabled = true
|
||||
Component.onDestruction: PrintInformation.enabled = false
|
||||
|
@ -30,6 +30,7 @@ Item
|
|||
id: infillCellLeft
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
||||
width: base.width * .45 - UM.Theme.getSize("default_margin").width
|
||||
height: childrenRect.height
|
||||
|
||||
|
@ -47,12 +48,13 @@ Item
|
|||
}
|
||||
}
|
||||
|
||||
Flow
|
||||
Row
|
||||
{
|
||||
id: infillCellRight
|
||||
|
||||
height: childrenRect.height;
|
||||
width: base.width * .55
|
||||
width: base.width * .5
|
||||
|
||||
spacing: UM.Theme.getSize("default_margin").width
|
||||
|
||||
anchors.left: infillCellLeft.right
|
||||
|
@ -63,10 +65,11 @@ Item
|
|||
id: infillListView
|
||||
property int activeIndex:
|
||||
{
|
||||
var density = parseInt(infillDensity.properties.value)
|
||||
var density = parseInt(infillDensity.properties.value);
|
||||
var steps = parseInt(infillSteps.properties.value);
|
||||
for(var i = 0; i < infillModel.count; ++i)
|
||||
{
|
||||
if(density > infillModel.get(i).percentageMin && density <= infillModel.get(i).percentageMax )
|
||||
if(density > infillModel.get(i).percentageMin && density <= infillModel.get(i).percentageMax && steps > infillModel.get(i).stepsMin && steps <= infillModel.get(i).stepsMax)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
|
@ -85,7 +88,7 @@ Item
|
|||
{
|
||||
id: infillIconLining
|
||||
|
||||
width: (infillCellRight.width - 3 * UM.Theme.getSize("default_margin").width) / 4;
|
||||
width: (infillCellRight.width - ((infillModel.count - 1) * UM.Theme.getSize("default_margin").width)) / (infillModel.count);
|
||||
height: width
|
||||
|
||||
border.color:
|
||||
|
@ -150,6 +153,7 @@ Item
|
|||
if (infillListView.activeIndex != index)
|
||||
{
|
||||
infillDensity.setPropertyValue("value", model.percentage)
|
||||
infillSteps.setPropertyValue("value", model.steps)
|
||||
}
|
||||
}
|
||||
onEntered:
|
||||
|
@ -181,37 +185,61 @@ Item
|
|||
Component.onCompleted:
|
||||
{
|
||||
infillModel.append({
|
||||
name: catalog.i18nc("@label", "Hollow"),
|
||||
name: catalog.i18nc("@label", "Empty"),
|
||||
percentage: 0,
|
||||
steps: 0,
|
||||
percentageMin: -1,
|
||||
percentageMax: 0,
|
||||
text: catalog.i18nc("@label", "No (0%) infill will leave your model hollow at the cost of low strength"),
|
||||
stepsMin: -1,
|
||||
stepsMax: 0,
|
||||
text: catalog.i18nc("@label", "Empty infill will leave your model hollow with low strength."),
|
||||
icon: "hollow"
|
||||
})
|
||||
infillModel.append({
|
||||
name: catalog.i18nc("@label", "Light"),
|
||||
percentage: 20,
|
||||
steps: 0,
|
||||
percentageMin: 0,
|
||||
percentageMax: 30,
|
||||
text: catalog.i18nc("@label", "Light (20%) infill will give your model an average strength"),
|
||||
stepsMin: -1,
|
||||
stepsMax: 0,
|
||||
text: catalog.i18nc("@label", "Light (20%) infill will give your model an average strength."),
|
||||
icon: "sparse"
|
||||
})
|
||||
infillModel.append({
|
||||
name: catalog.i18nc("@label", "Dense"),
|
||||
percentage: 50,
|
||||
steps: 0,
|
||||
percentageMin: 30,
|
||||
percentageMax: 70,
|
||||
text: catalog.i18nc("@label", "Dense (50%) infill will give your model an above average strength"),
|
||||
stepsMin: -1,
|
||||
stepsMax: 0,
|
||||
text: catalog.i18nc("@label", "Dense (50%) infill will give your model an above average strength."),
|
||||
icon: "dense"
|
||||
})
|
||||
infillModel.append({
|
||||
name: catalog.i18nc("@label", "Solid"),
|
||||
percentage: 100,
|
||||
steps: 0,
|
||||
percentageMin: 70,
|
||||
percentageMax: 100,
|
||||
text: catalog.i18nc("@label", "Solid (100%) infill will make your model completely solid"),
|
||||
percentageMax: 9999999999,
|
||||
stepsMin: -1,
|
||||
stepsMax: 0,
|
||||
text: catalog.i18nc("@label", "Solid (100%) infill will make your model completely solid."),
|
||||
icon: "solid"
|
||||
})
|
||||
infillModel.append({
|
||||
name: catalog.i18nc("@label", "Gradual"),
|
||||
percentage: 90,
|
||||
steps: 5,
|
||||
percentageMin: 0,
|
||||
percentageMax: 9999999999,
|
||||
stepsMin: 0,
|
||||
stepsMax: 9999999999,
|
||||
infill_layer_height: 1.5,
|
||||
text: catalog.i18nc("@label", "Gradual infill will gradually increase the amount of infill towards the top."),
|
||||
icon: "gradual"
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -220,7 +248,7 @@ Item
|
|||
{
|
||||
id: helpersCell
|
||||
anchors.top: infillCellRight.bottom
|
||||
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
||||
anchors.topMargin: UM.Theme.getSize("default_margin").height * 2
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
height: childrenRect.height
|
||||
|
@ -240,6 +268,8 @@ Item
|
|||
CheckBox
|
||||
{
|
||||
id: enableSupportCheckBox
|
||||
property alias _hovered: enableSupportMouseArea.containsMouse
|
||||
|
||||
anchors.top: parent.top
|
||||
anchors.left: enableSupportLabel.right
|
||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||
|
@ -390,7 +420,7 @@ Item
|
|||
property alias _hovered: adhesionMouseArea.containsMouse
|
||||
|
||||
anchors.top: supportExtruderCombobox.bottom
|
||||
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
||||
anchors.topMargin: UM.Theme.getSize("default_margin").height * 2
|
||||
anchors.left: adhesionHelperLabel.right
|
||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||
|
||||
|
@ -465,7 +495,7 @@ Item
|
|||
{
|
||||
id: tipsCell
|
||||
anchors.top: helpersCell.bottom
|
||||
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
||||
anchors.topMargin: UM.Theme.getSize("default_margin").height * 2
|
||||
anchors.left: parent.left
|
||||
width: parent.width
|
||||
height: childrenRect.height
|
||||
|
@ -478,7 +508,7 @@ Item
|
|||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||
wrapMode: Text.WordWrap
|
||||
//: Tips label
|
||||
text: catalog.i18nc("@label", "Need help improving your prints? Read the <a href='%1'>Ultimaker Troubleshooting Guides</a>").arg("https://ultimaker.com/en/troubleshooting");
|
||||
text: catalog.i18nc("@label", "Need help improving your prints?<br>Read the <a href='%1'>Ultimaker Troubleshooting Guides</a>").arg("https://ultimaker.com/en/troubleshooting");
|
||||
font: UM.Theme.getFont("default");
|
||||
color: UM.Theme.getColor("text");
|
||||
linkColor: UM.Theme.getColor("text_link")
|
||||
|
@ -496,6 +526,16 @@ Item
|
|||
storeIndex: 0
|
||||
}
|
||||
|
||||
UM.SettingPropertyProvider
|
||||
{
|
||||
id: infillSteps
|
||||
|
||||
containerStackId: Cura.MachineManager.activeStackId
|
||||
key: "gradual_infill_steps"
|
||||
watchedProperties: [ "value" ]
|
||||
storeIndex: 0
|
||||
}
|
||||
|
||||
UM.SettingPropertyProvider
|
||||
{
|
||||
id: platformAdhesionType
|
||||
|
|
|
@ -6,28 +6,33 @@ import QtQuick.Controls 1.1
|
|||
import QtQuick.Controls.Styles 1.1
|
||||
import QtQuick.Layouts 1.1
|
||||
|
||||
import UM 1.0 as UM
|
||||
import UM 1.2 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Item {
|
||||
Item
|
||||
{
|
||||
id: base;
|
||||
|
||||
width: buttons.width;
|
||||
height: buttons.height
|
||||
property int activeY
|
||||
|
||||
ColumnLayout {
|
||||
Column
|
||||
{
|
||||
id: buttons;
|
||||
|
||||
anchors.bottom: parent.bottom;
|
||||
anchors.left: parent.left;
|
||||
spacing: UM.Theme.getSize("button_lining").width
|
||||
|
||||
Repeater {
|
||||
Repeater
|
||||
{
|
||||
id: repeat
|
||||
|
||||
model: UM.ToolModel { }
|
||||
|
||||
Button {
|
||||
Button
|
||||
{
|
||||
text: model.name
|
||||
iconSource: UM.Theme.getIcon(model.icon);
|
||||
|
||||
|
@ -45,9 +50,11 @@ Item {
|
|||
}
|
||||
//Workaround since using ToolButton"s onClicked would break the binding of the checked property, instead
|
||||
//just catch the click so we do not trigger that behaviour.
|
||||
MouseArea {
|
||||
MouseArea
|
||||
{
|
||||
anchors.fill: parent;
|
||||
onClicked: {
|
||||
onClicked:
|
||||
{
|
||||
forceActiveFocus() //First grab focus, so all the text fields are updated
|
||||
if(parent.checked)
|
||||
{
|
||||
|
@ -61,9 +68,19 @@ Item {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
Item { height: UM.Theme.getSize("default_margin").height; width: 1; visible: extruders.count > 0 }
|
||||
|
||||
Repeater
|
||||
{
|
||||
id: extruders
|
||||
model: Cura.ExtrudersModel { id: extrudersModel }
|
||||
ExtruderButton { extruder: model }
|
||||
}
|
||||
}
|
||||
|
||||
UM.PointingRectangle {
|
||||
UM.PointingRectangle
|
||||
{
|
||||
id: panelBorder;
|
||||
|
||||
anchors.left: parent.right;
|
||||
|
@ -75,7 +92,8 @@ Item {
|
|||
target: Qt.point(parent.right, base.activeY + UM.Theme.getSize("button").height/2)
|
||||
arrowSize: UM.Theme.getSize("default_arrow").width
|
||||
|
||||
width: {
|
||||
width:
|
||||
{
|
||||
if (panel.item && panel.width > 0){
|
||||
return Math.max(panel.width + 2 * UM.Theme.getSize("default_margin").width)
|
||||
}
|
||||
|
@ -90,7 +108,8 @@ Item {
|
|||
|
||||
color: UM.Theme.getColor("lining");
|
||||
|
||||
UM.PointingRectangle {
|
||||
UM.PointingRectangle
|
||||
{
|
||||
id: panelBackground;
|
||||
|
||||
color: UM.Theme.getColor("tool_panel_background");
|
||||
|
@ -105,7 +124,8 @@ Item {
|
|||
}
|
||||
}
|
||||
|
||||
Loader {
|
||||
Loader
|
||||
{
|
||||
id: panel
|
||||
|
||||
x: UM.Theme.getSize("default_margin").width;
|
||||
|
@ -116,6 +136,8 @@ Item {
|
|||
}
|
||||
}
|
||||
|
||||
// This rectangle displays the information about the current angle etc. when
|
||||
// dragging a tool handle.
|
||||
Rectangle
|
||||
{
|
||||
x: -base.x + base.mouseX + UM.Theme.getSize("default_margin").width
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue