Merge branch 'master' into feature_setting_visibility_profiles

This commit is contained in:
fieldOfView 2018-02-08 16:06:48 +01:00
commit 69d7bf4130
414 changed files with 40051 additions and 22967 deletions

View file

@ -1,7 +1,7 @@
// Copyright (c) 2017 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2
import QtQuick 2.7
import QtQuick.Controls 2.0
import UM 1.1 as UM
@ -9,24 +9,24 @@ import Cura 1.0 as Cura
Button
{
id: base;
id: base
anchors.left: parent.left
anchors.right: parent.right
anchors.leftMargin: UM.Theme.getSize("sidebar_margin").width
anchors.rightMargin: UM.Theme.getSize("sidebar_margin").width
background: Rectangle
{
implicitHeight: UM.Theme.getSize("section").height;
implicitHeight: UM.Theme.getSize("section").height
color: {
if(base.color) {
if (base.color) {
return base.color;
} else if(!base.enabled) {
} else if (!base.enabled) {
return UM.Theme.getColor("setting_category_disabled");
} else if(base.hovered && base.checkable && base.checked) {
} else if (base.hovered && base.checkable && base.checked) {
return UM.Theme.getColor("setting_category_active_hover");
} else if(base.pressed || (base.checkable && base.checked)) {
} else if (base.pressed || (base.checkable && base.checked)) {
return UM.Theme.getColor("setting_category_active");
} else if(base.hovered) {
} else if (base.hovered) {
return UM.Theme.getColor("setting_category_hover");
} else {
return UM.Theme.getColor("setting_category");
@ -39,13 +39,13 @@ Button
width: parent.width
anchors.bottom: parent.bottom
color: {
if(!base.enabled) {
if (!base.enabled) {
return UM.Theme.getColor("setting_category_disabled_border");
} else if((base.hovered || base.activeFocus) && base.checkable && base.checked) {
} else if ((base.hovered || base.activeFocus) && base.checkable && base.checked) {
return UM.Theme.getColor("setting_category_active_hover_border");
} else if(base.pressed || (base.checkable && base.checked)) {
} else if (base.pressed || (base.checkable && base.checked)) {
return UM.Theme.getColor("setting_category_active_border");
} else if(base.hovered || base.activeFocus) {
} else if (base.hovered || base.activeFocus) {
return UM.Theme.getColor("setting_category_hover_border");
} else {
return UM.Theme.getColor("setting_category_border");
@ -66,7 +66,7 @@ Button
//text: definition.label
contentItem: Item {
anchors.fill: parent;
anchors.fill: parent
anchors.left: parent.left
Label {
@ -78,31 +78,22 @@ Button
verticalCenter: parent.verticalCenter;
}
text: definition.label
font: UM.Theme.getFont("setting_category");
font: UM.Theme.getFont("setting_category")
color:
{
if(!base.enabled)
{
if (!base.enabled) {
return UM.Theme.getColor("setting_category_disabled_text");
}
else if((base.hovered || base.activeFocus) && base.checkable && base.checked)
{
} else if ((base.hovered || base.activeFocus) && base.checkable && base.checked) {
return UM.Theme.getColor("setting_category_active_hover_text");
}
else if(base.pressed || (base.checkable && base.checked))
{
} else if (base.pressed || (base.checkable && base.checked)) {
return UM.Theme.getColor("setting_category_active_text");
}
else if(base.hovered || base.activeFocus)
{
} else if (base.hovered || base.activeFocus) {
return UM.Theme.getColor("setting_category_hover_text");
}
else
{
} else {
return UM.Theme.getColor("setting_category_text");
}
}
fontSizeMode: Text.HorizontalFit;
fontSizeMode: Text.HorizontalFit
minimumPointSize: 8
}
UM.RecolorImage
@ -110,31 +101,22 @@ Button
id: category_arrow
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.rightMargin: UM.Theme.getSize("default_margin").width * 3 - width / 2
anchors.rightMargin: UM.Theme.getSize("default_margin").width
width: UM.Theme.getSize("standard_arrow").width
height: UM.Theme.getSize("standard_arrow").height
sourceSize.width: width
sourceSize.height: width
color:
{
if(!base.enabled)
{
if (!base.enabled) {
return UM.Theme.getColor("setting_category_disabled_text");
}
else if((base.hovered || base.activeFocus) && base.checkable && base.checked)
{
} else if ((base.hovered || base.activeFocus) && base.checkable && base.checked) {
return UM.Theme.getColor("setting_category_active_hover_text");
}
else if(base.pressed || (base.checkable && base.checked))
{
} else if (base.pressed || (base.checkable && base.checked)) {
return UM.Theme.getColor("setting_category_active_text");
}
else if(base.hovered || base.activeFocus)
{
} else if (base.hovered || base.activeFocus) {
return UM.Theme.getColor("setting_category_hover_text");
}
else
{
} else {
return UM.Theme.getColor("setting_category_text");
}
}
@ -150,24 +132,15 @@ Button
anchors.leftMargin: UM.Theme.getSize("default_margin").width
color:
{
if(!base.enabled)
{
if (!base.enabled) {
return UM.Theme.getColor("setting_category_disabled_text");
}
else if((base.hovered || base.activeFocus) && base.checkable && base.checked)
{
} else if((base.hovered || base.activeFocus) && base.checkable && base.checked) {
return UM.Theme.getColor("setting_category_active_hover_text");
}
else if(base.pressed || (base.checkable && base.checked))
{
} else if(base.pressed || (base.checkable && base.checked)) {
return UM.Theme.getColor("setting_category_active_text");
}
else if(base.hovered || base.activeFocus)
{
} else if(base.hovered || base.activeFocus) {
return UM.Theme.getColor("setting_category_hover_text");
}
else
{
} else {
return UM.Theme.getColor("setting_category_text");
}
}
@ -178,18 +151,14 @@ Button
sourceSize.height: width + 15 * screenScaleFactor
}
checkable: true
checked: definition.expanded
onClicked:
{
if(definition.expanded)
{
if (definition.expanded) {
settingDefinitionsModel.collapse(definition.key);
}
else
{
} else {
settingDefinitionsModel.expandAll(definition.key);
}
//Set focus so that tab navigation continues from this point on.
@ -223,13 +192,14 @@ Button
anchors {
right: inheritButton.visible ? inheritButton.left : parent.right
rightMargin: inheritButton.visible? UM.Theme.getSize("default_margin").width / 2 : UM.Theme.getSize("setting_preferences_button_margin").width
verticalCenter: parent.verticalCenter;
// use 1.9 as the factor because there is a 0.1 difference between the settings and inheritance warning icons
rightMargin: inheritButton.visible ? UM.Theme.getSize("default_margin").width / 2 : category_arrow.width + UM.Theme.getSize("default_margin").width * 1.9
verticalCenter: parent.verticalCenter
}
color: UM.Theme.getColor("setting_control_button");
color: UM.Theme.getColor("setting_control_button")
hoverColor: UM.Theme.getColor("setting_control_button_hover")
iconSource: UM.Theme.getIcon("settings");
iconSource: UM.Theme.getIcon("settings")
onClicked: {
Cura.Actions.configureSettingVisibility.trigger(definition)
@ -238,20 +208,20 @@ Button
UM.SimpleButton
{
id: inheritButton;
id: inheritButton
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.rightMargin: UM.Theme.getSize("setting_preferences_button_margin").width
anchors.rightMargin: category_arrow.width + UM.Theme.getSize("default_margin").width * 2
visible:
{
if(Cura.SettingInheritanceManager.settingsWithInheritanceWarning.indexOf(definition.key) >= 0)
if (Cura.SettingInheritanceManager.settingsWithInheritanceWarning.indexOf(definition.key) >= 0)
{
var children_with_override = Cura.SettingInheritanceManager.getChildrenKeysWithOverride(definition.key)
for(var i = 0; i < children_with_override.length; i++)
for (var i = 0; i < children_with_override.length; i++)
{
if(!settingDefinitionsModel.getVisible(children_with_override[i]))
if (!settingDefinitionsModel.getVisible(children_with_override[i]))
{
return true
}

View file

@ -1,7 +1,7 @@
// Copyright (c) 2015 Ultimaker B.V.
// Uranium is released under the terms of the LGPLv3 or higher.
import QtQuick 2.1
import QtQuick 2.7
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.0

View file

@ -1,7 +1,7 @@
// Copyright (c) 2015 Ultimaker B.V.
// Uranium is released under the terms of the LGPLv3 or higher.
import QtQuick 2.1
import QtQuick 2.7
import QtQuick.Controls 2.0
import UM 1.1 as UM
@ -77,7 +77,7 @@ SettingItem
anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("setting_unit_margin").width
anchors.verticalCenter: parent.verticalCenter
anchors.right: indicator.left
anchors.right: downArrow.left
text: control.currentText
font: UM.Theme.getFont("default")
@ -86,13 +86,34 @@ SettingItem
verticalAlignment: Text.AlignVCenter
}
popup: Popup {
y: control.height - UM.Theme.getSize("default_lining").height
width: control.width
implicitHeight: contentItem.implicitHeight
padding: UM.Theme.getSize("default_lining").width
contentItem: ListView {
clip: true
implicitHeight: contentHeight
model: control.popup.visible ? control.delegateModel : null
currentIndex: control.highlightedIndex
ScrollIndicator.vertical: ScrollIndicator { }
}
background: Rectangle {
color: UM.Theme.getColor("setting_control")
border.color: UM.Theme.getColor("setting_control_border")
}
}
delegate: ItemDelegate
{
width: control.width
width: control.width - 2 * UM.Theme.getSize("default_lining").width
height: control.height
highlighted: control.highlightedIndex == index
contentItem: Text
contentItem: Label
{
text: modelData.value
color: control.contentItem.color
@ -100,6 +121,12 @@ SettingItem
elide: Text.ElideRight
verticalAlignment: Text.AlignVCenter
}
background: Rectangle
{
color: parent.highlighted ? UM.Theme.getColor("setting_control_highlight") : "transparent"
border.color: parent.highlighted ? UM.Theme.getColor("setting_control_border_highlight") : "transparent"
}
}
onActivated:

View file

@ -1,7 +1,7 @@
// Copyright (c) 2016 Ultimaker B.V.
// Uranium is released under the terms of the LGPLv3 or higher.
import QtQuick 2.1
import QtQuick 2.7
import QtQuick.Controls 2.0
import UM 1.1 as UM
@ -83,11 +83,11 @@ SettingItem
{
color:
{
if(!enabled)
if (!enabled)
{
return UM.Theme.getColor("setting_control_disabled");
}
if(control.hovered || base.activeFocus)
if (control.hovered || base.activeFocus)
{
return UM.Theme.getColor("setting_control_highlight");
}
@ -96,11 +96,11 @@ SettingItem
border.width: UM.Theme.getSize("default_lining").width
border.color:
{
if(!enabled)
if (!enabled)
{
return UM.Theme.getColor("setting_control_disabled_border")
}
if(control.hovered || control.activeFocus)
if (control.hovered || control.activeFocus)
{
return UM.Theme.getColor("setting_control_border_highlight")
}
@ -108,33 +108,28 @@ SettingItem
}
}
contentItem: Item
contentItem: Label
{
Label
{
id: extruderText
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("setting_unit_margin").width
anchors.right: downArrow.left
rightPadding: swatch.width + UM.Theme.getSize("setting_unit_margin").width
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("setting_unit_margin").width
anchors.right: swatch.left
text: control.currentText
font: UM.Theme.getFont("default")
color: enabled ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text")
text: control.currentText
font: UM.Theme.getFont("default")
color: enabled ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text")
elide: Text.ElideLeft
verticalAlignment: Text.AlignVCenter
elide: Text.ElideLeft
verticalAlignment: Text.AlignVCenter
}
Rectangle
background: Rectangle
{
id: swatch
height: UM.Theme.getSize("setting_control").height / 2
width: height
anchors.right: parent.right
anchors.rightMargin: control.indicator.width + UM.Theme.getSize("setting_unit_margin").width
anchors.verticalCenter: parent.verticalCenter
anchors.margins: UM.Theme.getSize("default_margin").width / 4
@ -146,19 +141,64 @@ SettingItem
}
}
popup: Popup {
y: control.height - UM.Theme.getSize("default_lining").height
width: control.width
implicitHeight: contentItem.implicitHeight
padding: UM.Theme.getSize("default_lining").width
contentItem: ListView {
clip: true
implicitHeight: contentHeight
model: control.popup.visible ? control.delegateModel : null
currentIndex: control.highlightedIndex
ScrollIndicator.vertical: ScrollIndicator { }
}
background: Rectangle {
color: UM.Theme.getColor("setting_control")
border.color: UM.Theme.getColor("setting_control_border")
}
}
delegate: ItemDelegate
{
width: control.width
width: control.width - 2 * UM.Theme.getSize("default_lining").width
height: control.height
highlighted: control.highlightedIndex == index
contentItem: Text
contentItem: Label
{
text: model.name
color: UM.Theme.getColor("setting_control_text")
font: UM.Theme.getFont("default")
elide: Text.ElideRight
verticalAlignment: Text.AlignVCenter
rightPadding: swatch.width + UM.Theme.getSize("setting_unit_margin").width
background: Rectangle
{
id: swatch
height: UM.Theme.getSize("setting_control").height / 2
width: height
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
anchors.margins: UM.Theme.getSize("default_margin").width / 4
border.width: UM.Theme.getSize("default_lining").width
border.color: enabled ? UM.Theme.getColor("setting_control_border") : UM.Theme.getColor("setting_control_disabled_border")
radius: width / 2
color: control.model.getItem(index).color
}
}
background: Rectangle
{
color: parent.highlighted ? UM.Theme.getColor("setting_control_highlight") : "transparent"
border.color: parent.highlighted ? UM.Theme.getColor("setting_control_border_highlight") : "transparent"
}
}
}

View file

@ -1,7 +1,7 @@
// Copyright (c) 2017 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.1
import QtQuick 2.7
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.0

View file

@ -1,7 +1,7 @@
// Copyright (c) 2016 Ultimaker B.V.
// Uranium is released under the terms of the LGPLv3 or higher.
import QtQuick 2.1
import QtQuick 2.7
import QtQuick.Controls 2.0
import UM 1.1 as UM
@ -102,11 +102,11 @@ SettingItem
{
color:
{
if(!enabled)
if (!enabled)
{
return UM.Theme.getColor("setting_control_disabled");
}
if(control.hovered || control.activeFocus)
if (control.hovered || control.activeFocus)
{
return UM.Theme.getColor("setting_control_highlight");
}
@ -115,11 +115,11 @@ SettingItem
border.width: UM.Theme.getSize("default_lining").width
border.color:
{
if(!enabled)
if (!enabled)
{
return UM.Theme.getColor("setting_control_disabled_border")
}
if(control.hovered || control.activeFocus)
if (control.hovered || control.activeFocus)
{
return UM.Theme.getColor("setting_control_border_highlight")
}
@ -127,33 +127,28 @@ SettingItem
}
}
contentItem: Item
contentItem: Label
{
Label
{
id: extruderText
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("setting_unit_margin").width
anchors.right: downArrow.left
rightPadding: swatch.width + UM.Theme.getSize("setting_unit_margin").width
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("setting_unit_margin").width
anchors.right: swatch.left
text: control.currentText
font: UM.Theme.getFont("default")
color: enabled ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text")
text: control.currentText
font: UM.Theme.getFont("default")
color: enabled ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text")
elide: Text.ElideRight
verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight
verticalAlignment: Text.AlignVCenter
}
Rectangle
background: Rectangle
{
id: swatch
height: UM.Theme.getSize("setting_control").height / 2
width: height
anchors.right: parent.right
anchors.rightMargin: control.indicator.width + UM.Theme.getSize("setting_unit_margin").width
anchors.verticalCenter: parent.verticalCenter
anchors.margins: UM.Theme.getSize("default_margin").width / 4
@ -165,19 +160,64 @@ SettingItem
}
}
popup: Popup {
y: control.height - UM.Theme.getSize("default_lining").height
width: control.width
implicitHeight: contentItem.implicitHeight
padding: UM.Theme.getSize("default_lining").width
contentItem: ListView {
clip: true
implicitHeight: contentHeight
model: control.popup.visible ? control.delegateModel : null
currentIndex: control.highlightedIndex
ScrollIndicator.vertical: ScrollIndicator { }
}
background: Rectangle {
color: UM.Theme.getColor("setting_control")
border.color: UM.Theme.getColor("setting_control_border")
}
}
delegate: ItemDelegate
{
width: control.width
width: control.width - 2 * UM.Theme.getSize("default_lining").width
height: control.height
highlighted: control.highlightedIndex == index
contentItem: Text
contentItem: Label
{
text: model.name
color: UM.Theme.getColor("setting_control_text")
font: UM.Theme.getFont("default")
elide: Text.ElideRight
verticalAlignment: Text.AlignVCenter
rightPadding: swatch.width + UM.Theme.getSize("setting_unit_margin").width
background: Rectangle
{
id: swatch
height: UM.Theme.getSize("setting_control").height / 2
width: height
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
anchors.margins: UM.Theme.getSize("default_margin").width / 4
border.width: UM.Theme.getSize("default_lining").width
border.color: enabled ? UM.Theme.getColor("setting_control_border") : UM.Theme.getColor("setting_control_disabled_border")
radius: width / 2
color: control.model.getItem(index).color
}
}
background: Rectangle
{
color: parent.highlighted ? UM.Theme.getColor("setting_control_highlight") : "transparent"
border.color: parent.highlighted ? UM.Theme.getColor("setting_control_border_highlight") : "transparent"
}
}
}

View file

@ -1,7 +1,7 @@
// Copyright (c) 2017 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2
import QtQuick 2.7
import QtQuick.Controls 2.0
import UM 1.1 as UM
@ -17,6 +17,7 @@ SettingItem
{
textHasChanged = false;
textBeforeEdit = focusItem.text;
focusItem.selectAll();
}
contents: Rectangle
@ -134,14 +135,6 @@ SettingItem
}
}
onEditingFinished:
{
if (textHasChanged)
{
propertyProvider.setPropertyValue("value", text)
}
}
onActiveFocusChanged:
{
if(activeFocus)

View file

@ -1,7 +1,7 @@
// Copyright (c) 2015 Ultimaker B.V.
// Uranium is released under the terms of the LGPLv3 or higher.
import QtQuick 2.1
import QtQuick 2.7
import QtQuick.Controls 2.0
import UM 1.2 as UM

View file

@ -1,7 +1,7 @@
// Copyright (c) 2017 Ultimaker B.V.
// Uranium is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2
import QtQuick 2.7
import QtQuick.Controls 1.1
import QtQuick.Controls.Styles 1.1
import QtQuick.Layouts 1.1
@ -64,11 +64,9 @@ Item
menu: ProfileMenu { }
function generateActiveQualityText () {
var result = catalog.i18nc("@", "No Profile Available") // default text
if (Cura.MachineManager.isActiveQualitySupported ) {
result = Cura.MachineManager.activeQualityName
var result = Cura.MachineManager.activeQualityName;
if (Cura.MachineManager.isActiveQualitySupported) {
if (Cura.MachineManager.activeQualityLayerHeight > 0) {
result += " <font color=\"" + UM.Theme.getColor("text_detail") + "\">"
result += " - "