Changeset View
Changeset View
Standalone View
Standalone View
containment/package/contents/ui/applet/ShortcutBadge.qml
Show First 20 Lines • Show All 91 Lines • ▼ Show 20 Line(s) | 88 | sourceComponent: DropShadow{ | |||
---|---|---|---|---|---|
92 | source: appletNumber | 92 | source: appletNumber | ||
93 | radius: root.appShadowSize/2 | 93 | radius: root.appShadowSize/2 | ||
94 | verticalOffset: 2 | 94 | verticalOffset: 2 | ||
95 | } | 95 | } | ||
96 | } | 96 | } | ||
97 | 97 | | |||
98 | LatteComponents.BadgeText { | 98 | LatteComponents.BadgeText { | ||
99 | id: appletNumber | 99 | id: appletNumber | ||
100 | anchors.top: parent.top | | |||
101 | anchors.left: parent.left | | |||
102 | //anchors.centerIn: parent | | |||
103 | 100 | | |||
101 | // when iconSize < 48, height is always = 24, height / iconSize > 50% | ||||
102 | // we prefer center aligned badges to top-left aligned ones | ||||
103 | property bool centerInParent: root.iconSize < 48 | ||||
104 | | ||||
105 | anchors.left: centerInParent? undefined : parent.left | ||||
106 | anchors.top: centerInParent? undefined : parent.top | ||||
107 | anchors.centerIn: centerInParent? parent : undefined | ||||
104 | minimumWidth: 0.4 * (wrapper.zoomScale * root.iconSize) | 108 | minimumWidth: 0.4 * (wrapper.zoomScale * root.iconSize) | ||
105 | height: Math.max(24, 0.4 * (wrapper.zoomScale * root.iconSize)) | 109 | height: Math.max(24, 0.4 * (wrapper.zoomScale * root.iconSize)) | ||
106 | 110 | | |||
107 | border.color: root.minimizedDotColor | 111 | border.color: root.minimizedDotColor | ||
108 | proportion: 0 | 112 | proportion: 0 | ||
109 | radiusPerCentage: 100 | 113 | radiusPerCentage: 100 | ||
110 | showNumber: false | 114 | showNumber: false | ||
111 | showText: true | 115 | showText: true | ||
112 | textValue: appletNumberLoader.badgeString | 116 | textValue: appletNumberLoader.badgeString | ||
113 | } | 117 | } | ||
114 | } | 118 | } | ||
115 | } | 119 | } |