Changeset View
Changeset View
Standalone View
Standalone View
plasmoid/package/contents/ui/task/ShortcutBadge.qml
Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Line(s) | 49 | sourceComponent: DropShadow{ | |||
---|---|---|---|---|---|
53 | source: taskNumber | 53 | source: taskNumber | ||
54 | radius: root.appShadowSize/2 | 54 | radius: root.appShadowSize/2 | ||
55 | verticalOffset: 2 | 55 | verticalOffset: 2 | ||
56 | } | 56 | } | ||
57 | } | 57 | } | ||
58 | 58 | | |||
59 | LatteComponents.BadgeText { | 59 | LatteComponents.BadgeText { | ||
60 | id: taskNumber | 60 | id: taskNumber | ||
61 | anchors.left: parent.left | 61 | | ||
62 | anchors.top: parent.top | 62 | // when iconSize < 48, height is always = 24, height / iconSize > 50% | ||
63 | //anchors.centerIn: parent | 63 | // we prefer center aligned badges to top-left aligned ones | ||
64 | property bool centerInParent: root.iconSize < 48 | ||||
65 | | ||||
66 | anchors.left: centerInParent? undefined : parent.left | ||||
67 | anchors.top: centerInParent? undefined : parent.top | ||||
68 | anchors.centerIn: centerInParent? parent : undefined | ||||
64 | minimumWidth: 0.4 * (wrapper.mScale * root.iconSize) | 69 | minimumWidth: 0.4 * (wrapper.mScale * root.iconSize) | ||
65 | height: Math.max(24, 0.4 * (wrapper.mScale * root.iconSize)) | 70 | height: Math.max(24, 0.4 * (wrapper.mScale * root.iconSize)) | ||
66 | 71 | | |||
67 | border.color: root.minimizedDotColor | 72 | border.color: root.minimizedDotColor | ||
68 | textValue: shorcutBadge.badgeString | 73 | textValue: shorcutBadge.badgeString | ||
69 | 74 | | |||
70 | showNumber: false | 75 | showNumber: false | ||
71 | showText: true | 76 | showText: true | ||
72 | 77 | | |||
73 | proportion: 0 | 78 | proportion: 0 | ||
74 | radiusPerCentage: 100 | 79 | radiusPerCentage: 100 | ||
75 | } | 80 | } | ||
76 | } | 81 | } | ||
77 | } | 82 | } |