52 lines
1.3 KiB
QML
52 lines
1.3 KiB
QML
import QtQuick
|
|
import qs.config
|
|
|
|
// The sun, drawn: a disc and eight rays. Same reason as the other glyphs —
|
|
// symbolic icons come out black on the dark panel, and a drawn one recolours.
|
|
Item {
|
|
id: root
|
|
|
|
property color color: Theme.text
|
|
property int size: Theme.iconSize
|
|
|
|
implicitWidth: root.size
|
|
implicitHeight: root.size
|
|
|
|
readonly property real stroke: Math.max(1.5, Math.round(root.size * 0.09))
|
|
|
|
Rectangle {
|
|
anchors.centerIn: parent
|
|
width: Math.round(root.size * 0.42)
|
|
height: width
|
|
radius: width / 2
|
|
color: root.color
|
|
}
|
|
|
|
// One ray, drawn at twelve o'clock and rotated about the centre of the
|
|
// glyph into each of the eight positions.
|
|
Repeater {
|
|
model: 8
|
|
|
|
Rectangle {
|
|
id: ray
|
|
|
|
required property int index
|
|
|
|
readonly property real inset: root.size * 0.04
|
|
|
|
x: (root.size - width) / 2
|
|
y: ray.inset
|
|
width: root.stroke
|
|
height: Math.round(root.size * 0.16)
|
|
radius: width / 2
|
|
color: root.color
|
|
|
|
transform: Rotation {
|
|
origin.x: ray.width / 2
|
|
origin.y: root.size / 2 - ray.inset
|
|
angle: ray.index * 45
|
|
}
|
|
}
|
|
}
|
|
}
|