mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-29 17:45:45 +08:00
Merge branch 'master' of github.com:Ultimaker/Cura
This commit is contained in:
commit
b365cdfd0f
@ -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();
|
||||||
|
@ -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()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -147,106 +147,111 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Repeater
|
Column
|
||||||
{
|
{
|
||||||
id: contents
|
spacing: UM.Theme.getSize("default_lining").height
|
||||||
height: childrenRect.height;
|
|
||||||
|
|
||||||
model: UM.SettingDefinitionsModel
|
Repeater
|
||||||
{
|
{
|
||||||
id: addedSettingsModel;
|
id: contents
|
||||||
containerId: Cura.MachineManager.activeDefinitionId
|
height: childrenRect.height;
|
||||||
expanded: [ "*" ]
|
|
||||||
|
|
||||||
visibilityHandler: Cura.PerObjectSettingVisibilityHandler
|
model: UM.SettingDefinitionsModel
|
||||||
{
|
{
|
||||||
selectedObjectId: UM.ActiveTool.properties.getValue("SelectedObjectId")
|
id: addedSettingsModel;
|
||||||
}
|
containerId: Cura.MachineManager.activeDefinitionId
|
||||||
}
|
expanded: [ "*" ]
|
||||||
|
|
||||||
delegate: Row
|
visibilityHandler: Cura.PerObjectSettingVisibilityHandler
|
||||||
{
|
|
||||||
Loader
|
|
||||||
{
|
|
||||||
id: settingLoader
|
|
||||||
width: UM.Theme.getSize("setting").width;
|
|
||||||
height: UM.Theme.getSize("section").height;
|
|
||||||
|
|
||||||
property var definition: model
|
|
||||||
property var settingDefinitionsModel: addedSettingsModel
|
|
||||||
property var propertyProvider: provider
|
|
||||||
|
|
||||||
//Qt5.4.2 and earlier has a bug where this causes a crash: https://bugreports.qt.io/browse/QTBUG-35989
|
|
||||||
//In addition, while it works for 5.5 and higher, the ordering of the actual combo box drop down changes,
|
|
||||||
//causing nasty issues when selecting different options. So disable asynchronous loading of enum type completely.
|
|
||||||
asynchronous: model.type != "enum" && model.type != "extruder"
|
|
||||||
|
|
||||||
onLoaded: {
|
|
||||||
settingLoader.item.showRevertButton = false
|
|
||||||
settingLoader.item.showInheritButton = false
|
|
||||||
settingLoader.item.showLinkedSettingIcon = false
|
|
||||||
settingLoader.item.doDepthIndentation = false
|
|
||||||
settingLoader.item.doQualityUserSettingEmphasis = false
|
|
||||||
}
|
|
||||||
|
|
||||||
sourceComponent:
|
|
||||||
{
|
{
|
||||||
switch(model.type)
|
selectedObjectId: UM.ActiveTool.properties.getValue("SelectedObjectId")
|
||||||
{
|
}
|
||||||
case "int":
|
}
|
||||||
return settingTextField
|
|
||||||
case "float":
|
delegate: Row
|
||||||
return settingTextField
|
{
|
||||||
case "enum":
|
Loader
|
||||||
return settingComboBox
|
{
|
||||||
case "extruder":
|
id: settingLoader
|
||||||
return settingExtruder
|
width: UM.Theme.getSize("setting").width
|
||||||
case "bool":
|
height: UM.Theme.getSize("section").height
|
||||||
return settingCheckBox
|
|
||||||
case "str":
|
property var definition: model
|
||||||
return settingTextField
|
property var settingDefinitionsModel: addedSettingsModel
|
||||||
case "category":
|
property var propertyProvider: provider
|
||||||
return settingCategory
|
|
||||||
default:
|
//Qt5.4.2 and earlier has a bug where this causes a crash: https://bugreports.qt.io/browse/QTBUG-35989
|
||||||
return settingUnknown
|
//In addition, while it works for 5.5 and higher, the ordering of the actual combo box drop down changes,
|
||||||
|
//causing nasty issues when selecting different options. So disable asynchronous loading of enum type completely.
|
||||||
|
asynchronous: model.type != "enum" && model.type != "extruder"
|
||||||
|
|
||||||
|
onLoaded: {
|
||||||
|
settingLoader.item.showRevertButton = false
|
||||||
|
settingLoader.item.showInheritButton = false
|
||||||
|
settingLoader.item.showLinkedSettingIcon = false
|
||||||
|
settingLoader.item.doDepthIndentation = false
|
||||||
|
settingLoader.item.doQualityUserSettingEmphasis = false
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Button
|
sourceComponent:
|
||||||
{
|
|
||||||
width: UM.Theme.getSize("setting").height;
|
|
||||||
height: UM.Theme.getSize("setting").height;
|
|
||||||
|
|
||||||
onClicked: addedSettingsModel.setVisible(model.key, false);
|
|
||||||
|
|
||||||
style: ButtonStyle
|
|
||||||
{
|
|
||||||
background: Item
|
|
||||||
{
|
{
|
||||||
UM.RecolorImage
|
switch(model.type)
|
||||||
{
|
{
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
case "int":
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
return settingTextField
|
||||||
width: parent.width/2
|
case "float":
|
||||||
height: parent.height/2
|
return settingTextField
|
||||||
sourceSize.width: width
|
case "enum":
|
||||||
sourceSize.height: width
|
return settingComboBox
|
||||||
color: control.hovered ? UM.Theme.getColor("setting_control_button_hover") : UM.Theme.getColor("setting_control_button")
|
case "extruder":
|
||||||
source: UM.Theme.getIcon("cross1")
|
return settingExtruder
|
||||||
|
case "bool":
|
||||||
|
return settingCheckBox
|
||||||
|
case "str":
|
||||||
|
return settingTextField
|
||||||
|
case "category":
|
||||||
|
return settingCategory
|
||||||
|
default:
|
||||||
|
return settingUnknown
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
UM.SettingPropertyProvider
|
|
||||||
{
|
|
||||||
id: provider
|
|
||||||
|
|
||||||
containerStackId: UM.ActiveTool.properties.getValue("ContainerID")
|
Button
|
||||||
key: model.key
|
{
|
||||||
watchedProperties: [ "value", "enabled", "validationState" ]
|
width: UM.Theme.getSize("setting").height / 2;
|
||||||
storeIndex: 0
|
height: UM.Theme.getSize("setting").height;
|
||||||
removeUnusedValue: false
|
|
||||||
|
onClicked: addedSettingsModel.setVisible(model.key, false);
|
||||||
|
|
||||||
|
style: ButtonStyle
|
||||||
|
{
|
||||||
|
background: Item
|
||||||
|
{
|
||||||
|
UM.RecolorImage
|
||||||
|
{
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
width: parent.width
|
||||||
|
height: parent.height / 2
|
||||||
|
sourceSize.width: width
|
||||||
|
sourceSize.height: width
|
||||||
|
color: control.hovered ? UM.Theme.getColor("setting_control_button_hover") : UM.Theme.getColor("setting_control_button")
|
||||||
|
source: UM.Theme.getIcon("minus")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
UM.SettingPropertyProvider
|
||||||
|
{
|
||||||
|
id: provider
|
||||||
|
|
||||||
|
containerStackId: UM.ActiveTool.properties.getValue("ContainerID")
|
||||||
|
key: model.key
|
||||||
|
watchedProperties: [ "value", "enabled", "validationState" ]
|
||||||
|
storeIndex: 0
|
||||||
|
removeUnusedValue: false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -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;
|
||||||
}
|
}
|
||||||
|
10260
resources/themes/cura/icons/minus.svg
Normal file
10260
resources/themes/cura/icons/minus.svg
Normal file
File diff suppressed because it is too large
Load Diff
After Width: | Height: | Size: 760 KiB |
Loading…
x
Reference in New Issue
Block a user