Changeset View
Changeset View
Standalone View
Standalone View
applets/taskmanager/package/contents/ui/Badge.qml
Show All 30 Lines | 24 | Rectangle { | |||
---|---|---|---|---|---|
31 | implicitWidth: Math.max(height, Math.round(label.contentWidth + radius / 2)) // Add some padding around. | 31 | implicitWidth: Math.max(height, Math.round(label.contentWidth + radius / 2)) // Add some padding around. | ||
32 | color: theme.highlightColor | 32 | color: theme.highlightColor | ||
33 | radius: height / 2 | 33 | radius: height / 2 | ||
34 | 34 | | |||
35 | PlasmaComponents.Label { | 35 | PlasmaComponents.Label { | ||
36 | id: label | 36 | id: label | ||
37 | anchors.centerIn: parent | 37 | anchors.centerIn: parent | ||
38 | width: height | 38 | width: height | ||
39 | height: Math.round(parent.height) | 39 | height: Math.min(units.gridUnit * 2, Math.round(parent.height)) | ||
40 | horizontalAlignment: Text.AlignHCenter | 40 | horizontalAlignment: Text.AlignHCenter | ||
41 | verticalAlignment: Text.AlignVCenter | 41 | verticalAlignment: Text.AlignVCenter | ||
42 | fontSizeMode: Text.VerticalFit | 42 | fontSizeMode: Text.VerticalFit | ||
43 | font.pointSize: 1024 | 43 | font.pointSize: 1024 | ||
44 | minimumPointSize: 5 | 44 | minimumPointSize: 5 | ||
45 | color: theme.backgroundColor | 45 | color: theme.backgroundColor | ||
46 | text: { | 46 | text: { | ||
47 | if (badgeRect.number < 0) { | 47 | if (badgeRect.number < 0) { | ||
Show All 9 Lines |