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

This commit is contained in:
Jaime van Kessel 2018-01-08 10:56:12 +01:00
commit ed9634ebe0
77 changed files with 2675 additions and 791 deletions

View file

@ -1,9 +1,8 @@
// Copyright (c) 2016 Ultimaker B.V.
// Uranium is released under the terms of the LGPLv3 or higher.
import QtQuick 2.1
import QtQuick.Controls 1.1
import QtQuick.Controls.Styles 1.1
import QtQuick 2.7
import QtQuick.Controls 2.0
import UM 1.1 as UM
import Cura 1.0 as Cura
@ -65,83 +64,101 @@ SettingItem
value: control.currentText != "" ? control.model.getItem(control.currentIndex).color : ""
}
style: ComboBoxStyle
indicator: UM.RecolorImage
{
background: Rectangle
id: downArrow
x: control.width - width - control.rightPadding
y: control.topPadding + (control.availableHeight - height) / 2
source: UM.Theme.getIcon("arrow_bottom")
width: UM.Theme.getSize("standard_arrow").width
height: UM.Theme.getSize("standard_arrow").height
sourceSize.width: width + 5 * screenScaleFactor
sourceSize.height: width + 5 * screenScaleFactor
color: UM.Theme.getColor("setting_control_text");
}
background: Rectangle
{
color:
{
color:
if (!enabled)
{
if(!enabled)
{
return UM.Theme.getColor("setting_control_disabled");
}
if(control.hovered || base.activeFocus)
{
return UM.Theme.getColor("setting_control_highlight");
}
return UM.Theme.getColor("setting_control");
return UM.Theme.getColor("setting_control_disabled");
}
border.width: UM.Theme.getSize("default_lining").width
border.color:
if (control.hovered || base.activeFocus)
{
if(!enabled)
{
return UM.Theme.getColor("setting_control_disabled_border")
}
if(control.hovered || control.activeFocus)
{
return UM.Theme.getColor("setting_control_border_highlight")
}
return UM.Theme.getColor("setting_control_border")
return UM.Theme.getColor("setting_control_highlight");
}
return UM.Theme.getColor("setting_control");
}
label: Item
border.width: UM.Theme.getSize("default_lining").width
border.color:
{
Label
if (!enabled)
{
id: extruderText
anchors.verticalCenter: parent.verticalCenter
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
return UM.Theme.getColor("setting_control_disabled_border")
}
Rectangle
if (control.hovered || control.activeFocus)
{
id: swatch
height: UM.Theme.getSize("setting_control").height / 2
width: height
anchors
{
right: arrow.left
verticalCenter: parent.verticalCenter
margins: UM.Theme.getSize("default_margin").width / 4
}
border.width: UM.Theme.getSize("default_lining").width * 2
border.color: enabled ? UM.Theme.getColor("setting_control_border") : UM.Theme.getColor("setting_control_disabled_border")
radius: width / 2
color: control.color
return UM.Theme.getColor("setting_control_border_highlight")
}
UM.RecolorImage
{
id: arrow
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
return UM.Theme.getColor("setting_control_border")
}
}
source: UM.Theme.getIcon("arrow_bottom")
width: UM.Theme.getSize("standard_arrow").width
height: UM.Theme.getSize("standard_arrow").height
sourceSize.width: width + 5 * screenScaleFactor
sourceSize.height: width + 5 * screenScaleFactor
contentItem: Item
{
Label
{
id: extruderText
color: UM.Theme.getColor("setting_control_text")
}
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")
elide: Text.ElideLeft
verticalAlignment: Text.AlignVCenter
}
Rectangle
{
id: swatch
height: UM.Theme.getSize("setting_control").height / 2
width: height
anchors.right: parent.right
anchors.rightMargin: downArrow.width + UM.Theme.getSize("setting_unit_margin").width
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.color
}
}
delegate: ItemDelegate
{
width: control.width
height: control.height
highlighted: control.highlightedIndex == index
contentItem: Text
{
text: model.name
color: UM.Theme.getColor("setting_control_text")
font: UM.Theme.getFont("default")
elide: Text.ElideRight
verticalAlignment: Text.AlignVCenter
}
}
}