mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-15 15:45:56 +08:00
Add circle with letter inside for non default intents
CURA-8849
This commit is contained in:
parent
074e9a8607
commit
40d473c243
@ -25,8 +25,8 @@ Item
|
|||||||
|
|
||||||
RecommendedQualityProfileSelectorButton
|
RecommendedQualityProfileSelectorButton
|
||||||
{
|
{
|
||||||
text: model.name
|
profileName: model.name
|
||||||
iconSource: UM.Theme.getIcon(model.icon)
|
icon: model.icon
|
||||||
|
|
||||||
|
|
||||||
selected: Cura.MachineManager.activeIntentCategory == model.intent_category
|
selected: Cura.MachineManager.activeIntentCategory == model.intent_category
|
||||||
|
@ -16,9 +16,9 @@ Rectangle
|
|||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
color: mouseArea.containsMouse || selected ? UM.Theme.getColor("um_blue_1") : UM.Theme.getColor("background_1")
|
color: mouseArea.containsMouse || selected ? UM.Theme.getColor("um_blue_1") : UM.Theme.getColor("background_1")
|
||||||
|
|
||||||
property alias iconSource: intentIcon.source
|
|
||||||
property alias text: qualityLabel.text
|
|
||||||
property bool selected: false
|
property bool selected: false
|
||||||
|
property string profileName: ""
|
||||||
|
property string icon: ""
|
||||||
|
|
||||||
signal clicked()
|
signal clicked()
|
||||||
|
|
||||||
@ -38,21 +38,52 @@ Rectangle
|
|||||||
top: parent.top
|
top: parent.top
|
||||||
bottom: qualityLabel.top
|
bottom: qualityLabel.top
|
||||||
horizontalCenter: parent.horizontalCenter
|
horizontalCenter: parent.horizontalCenter
|
||||||
|
topMargin: UM.Theme.getSize("narrow_margin").height
|
||||||
}
|
}
|
||||||
|
|
||||||
UM.ColorImage
|
Item
|
||||||
{
|
{
|
||||||
id: intentIcon
|
id: intentIcon
|
||||||
width: UM.Theme.getSize("recommended_button_icon").width
|
width: UM.Theme.getSize("recommended_button_icon").width
|
||||||
height: width
|
height: UM.Theme.getSize("recommended_button_icon").height
|
||||||
anchors.centerIn: parent
|
UM.ColorImage
|
||||||
color: UM.Theme.getColor("icon")
|
{
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.centerIn: parent
|
||||||
|
visible: icon != ""
|
||||||
|
source: UM.Theme.getIcon(icon)
|
||||||
|
color: UM.Theme.getColor("icon")
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle
|
||||||
|
{
|
||||||
|
id: circle
|
||||||
|
anchors.fill: parent
|
||||||
|
radius: width
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
visible: icon == ""
|
||||||
|
color: transparent
|
||||||
|
border.width: UM.Theme.getSize("thick_lining").width
|
||||||
|
border.color: UM.Theme.getColor("text")
|
||||||
|
|
||||||
|
UM.Label
|
||||||
|
{
|
||||||
|
id: initialLabel
|
||||||
|
anchors.centerIn: parent
|
||||||
|
text: profileName.charAt(0).toUpperCase()
|
||||||
|
font: UM.Theme.getFont("small_bold")
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UM.Label
|
UM.Label
|
||||||
{
|
{
|
||||||
id: qualityLabel
|
id: qualityLabel
|
||||||
|
text: profileName
|
||||||
anchors
|
anchors
|
||||||
{
|
{
|
||||||
bottom: parent.bottom
|
bottom: parent.bottom
|
||||||
|
@ -133,6 +133,11 @@
|
|||||||
"weight": 400,
|
"weight": 400,
|
||||||
"family": "Noto Sans"
|
"family": "Noto Sans"
|
||||||
},
|
},
|
||||||
|
"small_bold": {
|
||||||
|
"size": 0.9,
|
||||||
|
"weight": 700,
|
||||||
|
"family": "Noto Sans"
|
||||||
|
},
|
||||||
"small_ja_JP": {
|
"small_ja_JP": {
|
||||||
"size": 0.9,
|
"size": 0.9,
|
||||||
"weight": 400,
|
"weight": 400,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user