mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-09 07:19:01 +08:00
Center extruder numbers on Ubuntu
This one is for you @christerbeke
This commit is contained in:
parent
c602c1cf15
commit
1369c98ea6
@ -19,7 +19,7 @@ Item
|
|||||||
property int position: 0
|
property int position: 0
|
||||||
|
|
||||||
// The extruder icon size; NOTE: This shouldn't need to be changed
|
// The extruder icon size; NOTE: This shouldn't need to be changed
|
||||||
property int size: 32 // TODO: Theme!
|
property int size: 32 * screenScaleFactor // TODO: Theme!
|
||||||
|
|
||||||
// THe extruder icon source; NOTE: This shouldn't need to be changed
|
// THe extruder icon source; NOTE: This shouldn't need to be changed
|
||||||
property string iconSource: "../svg/icons/extruder.svg"
|
property string iconSource: "../svg/icons/extruder.svg"
|
||||||
@ -35,27 +35,17 @@ Item
|
|||||||
width: size
|
width: size
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* The label uses some "fancy" math to ensure that if you change the overall
|
|
||||||
* icon size, the number scales with it. That is to say, the font properties
|
|
||||||
* are linked to the icon size, NOT the theme. And that's intentional.
|
|
||||||
*/
|
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
id: positionLabel
|
id: positionLabel
|
||||||
font
|
font: UM.Theme.getFont("small")
|
||||||
{
|
height: Math.round(size / 2)
|
||||||
pointSize: Math.round(size * 0.3125)
|
|
||||||
weight: Font.Bold
|
|
||||||
}
|
|
||||||
height: Math.round(size / 2) * screenScaleFactor
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
text: position + 1
|
text: position + 1
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
width: Math.round(size / 2) * screenScaleFactor
|
width: Math.round(size / 2)
|
||||||
x: Math.round(size * 0.25) * screenScaleFactor
|
x: Math.round(size * 0.25)
|
||||||
y: Math.round(size * 0.15625) * screenScaleFactor
|
y: Math.round(size * 0.15625)
|
||||||
// TODO: Once 'size' is themed, screenScaleFactor won't be needed
|
|
||||||
visible: position >= 0
|
visible: position >= 0
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user