Cura/resources/qml/ExtruderIcon.qml
Ghostkeeper 289399825b
Merge branch 'ui_rework_4_0' into CURA-5876-Configuration_dropdown
Conflicts:
	plugins/PrepareStage/PrepareMenu.qml: Git was wrong, this was not really a conflict.
	resources/qml/ActionButton.qml: With iconSource being modified on ui_rework_4_0 and me modifying the icon to be able to display it on the left hand side.
	resources/qml/ActionPanel/OutputProcessWidget.qml: Git was wrong, not really a conflict.
	resources/qml/ActionPanel/SliceProcessWidget.qml: Git was wrong, not really a conflict.
	resources/qml/ExpandableComponent.qml: Both ui_rework_4_0 and me implemented a border around popups.
	resources/qml/MainWindow/MainWindowHeader.qml: Git was wrong, not really a conflict.
	resources/themes/cura-light/theme.json: Theme item was added in a place where I added whitespace.
2018-11-27 15:01:48 +01:00

74 lines
2.0 KiB
QML

// Copyright (c) 2018 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.7
import QtQuick.Controls 1.1
import UM 1.2 as UM
Item
{
id: extruderIconItem
implicitWidth: UM.Theme.getSize("extruder_icon").width
implicitHeight: UM.Theme.getSize("extruder_icon").height
property bool checked: true
property color materialColor
property alias textColor: extruderNumberText.color
property bool extruderEnabled: true
UM.RecolorImage
{
id: mainIcon
anchors.fill: parent
sourceSize.width: parent.width
sourceSize.height: parent.height
source: UM.Theme.getIcon("extruder_button")
color: extruderEnabled ? materialColor: "gray"
}
Rectangle
{
id: extruderNumberCircle
width: height
height: Math.round(parent.height / 2)
radius: Math.round(width / 2)
color: UM.Theme.getColor("toolbar_background")
anchors
{
horizontalCenter: parent.horizontalCenter
top: parent.top
// The circle needs to be slightly off center (so it sits in the middle of the square bit of the icon)
topMargin: (parent.height - height) / 2 - 0.1 * parent.height
}
Label
{
id: extruderNumberText
anchors.centerIn: parent
text: index + 1
font: UM.Theme.getFont("very_small")
width: contentWidth
height: contentHeight
visible: extruderEnabled
renderType: Text.NativeRendering
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
UM.RecolorImage
{
id: disabledIcon
anchors.fill: parent
anchors.margins: UM.Theme.getSize("thick_lining").width
sourceSize.width: width
sourceSize.height: width
source: UM.Theme.getIcon("cross1")
visible: !extruderEnabled
color: "black"
}
}
}