12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- // 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("button").width
- implicitHeight: implicitWidth
- property bool checked: true
- property alias material_color: materialColorCircle.color
- property alias text_color: extruderNumberText.color
- UM.RecolorImage
- {
- id: mainCircle
- anchors.fill: parent
- sourceSize.width: parent.width
- sourceSize.height: parent.width
- source: UM.Theme.getIcon("extruder_button")
- color: extruderNumberText.color
- }
- Label
- {
- id: extruderNumberText
- anchors.centerIn: parent
- text: index + 1;
- font: UM.Theme.getFont("default_bold")
- }
- // Material colour circle
- // Only draw the filling colour of the material inside the SVG border.
- Rectangle
- {
- id: materialColorCircle
- anchors
- {
- right: parent.right
- }
- width: Math.round(parent.width * 0.35)
- height: Math.round(parent.height * 0.35)
- radius: Math.round(width / 2)
- border.width: UM.Theme.getSize("default_lining").width
- border.color: UM.Theme.getColor("extruder_button_material_border")
- opacity: !extruderIconItem.checked ? 0.6 : 1.0
- }
- }
|