diff --git a/containment/package/contents/ui/applet/ShortcutBadge.qml b/containment/package/contents/ui/applet/ShortcutBadge.qml index 04fc06c2..71e763b3 100644 --- a/containment/package/contents/ui/applet/ShortcutBadge.qml +++ b/containment/package/contents/ui/applet/ShortcutBadge.qml @@ -1,119 +1,119 @@ /* * Copyright 2019 Michail Vourlakos * * This file is part of Latte-Dock * * Latte-Dock is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Latte-Dock is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ import QtQuick 2.1 import QtGraphicalEffects 1.0 import org.kde.latte 0.2 as Latte import org.kde.latte.components 1.0 as LatteComponents Loader{ id: appletNumberLoader active: appletItem.canShowAppletNumberBadge && (root.showLatteShortcutBadges || root.showAppletShortcutBadges || root.showMetaBadge && applet.id===applicationLauncherId) asynchronous: true visible: badgeString!=="" property int fixedIndex: -1 property string badgeString: "" onActiveChanged: { if (active && root.showLatteShortcutBadges && root.unifiedGlobalShortcuts) { fixedIndex = parabolicManager.pseudoAppletIndex(index); } else { fixedIndex = -1; } } Component.onCompleted: { if (active && root.showLatteShortcutBadges && root.unifiedGlobalShortcuts) { fixedIndex = parabolicManager.pseudoAppletIndex(index); } else { fixedIndex = -1; } } Binding{ target: appletNumberLoader property:"badgeString" value: { //! don't change value on hiding/releasing if (!root.showMetaBadge && !root.showAppletShortcutBadges) { return; } if (root.showAppletShortcutBadges) { var plasmaShortcut = applet ? shortcutsEngine.appletShortcutBadge(applet.id) : ""; if (plasmaShortcut !== "") { return plasmaShortcut; } } if (root.showMetaBadge && applet && applet.id === applicationLauncherId) { return '\u2318'; } else if (appletNumberLoader.fixedIndex>=1 && appletNumberLoader.fixedIndex<20) { return root.badgesForActivate[appletNumberLoader.fixedIndex-1]; } else { return ""; } } } sourceComponent: Item{ Loader{ anchors.fill: appletNumber active: root.enableShadows sourceComponent: DropShadow{ color: root.appShadowColor fast: true samples: 2 * radius source: appletNumber radius: root.appShadowSize/2 verticalOffset: 2 } } LatteComponents.BadgeText { id: appletNumber // when iconSize < 48, height is always = 24, height / iconSize > 50% // we prefer center aligned badges to top-left aligned ones property bool centerInParent: root.iconSize < 48 anchors.left: centerInParent? undefined : parent.left anchors.top: centerInParent? undefined : parent.top anchors.centerIn: centerInParent? parent : undefined minimumWidth: 0.4 * (wrapper.zoomScale * root.iconSize) height: Math.max(24, 0.4 * (wrapper.zoomScale * root.iconSize)) - border.color: root.minimizedDotColor + borderColor: colorizerManager.originalLightTextColor proportion: 0 radiusPerCentage: 100 showNumber: false showText: true textValue: appletNumberLoader.badgeString } } } diff --git a/containment/package/contents/ui/colorizer/Manager.qml b/containment/package/contents/ui/colorizer/Manager.qml index df001178..c059bd3b 100644 --- a/containment/package/contents/ui/colorizer/Manager.qml +++ b/containment/package/contents/ui/colorizer/Manager.qml @@ -1,181 +1,184 @@ /* * Copyright 2018 Michail Vourlakos * * This file is part of Latte-Dock * * Latte-Dock is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Latte-Dock is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ import QtQuick 2.7 import org.kde.plasma.plasmoid 2.0 import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.latte 0.2 as Latte import "../../code/ColorizerTools.js" as ColorizerTools Loader{ id: manager //! the loader loads the backgroundTracker component active: root.themeColors === Latte.Types.SmartThemeColors readonly property bool backgroundIsBusy: item ? item.isBusy : false + readonly property real originalThemeTextColorBrightness: ColorizerTools.colorBrightness(theme.textColor) + readonly property color originalLightTextColor: originalThemeTextColorBrightness > 127.5 ? theme.textColor : theme.backgroundColor + readonly property real themeTextColorBrightness: ColorizerTools.colorBrightness(textColor) readonly property real backgroundColorBrightness: ColorizerTools.colorBrightness(backgroundColor) readonly property color minimizedDotColor: themeTextColorBrightness > 127.5 ? Qt.darker(textColor, 1.7) : Qt.lighter(textColor, 8) readonly property color focusGlowColor: Qt.hsva(buttonFocusColor.h, buttonFocusColor.s, 1.0, 1.0) readonly property color outlineColorBase: backgroundColor readonly property real outlineColorBaseBrightness: ColorizerTools.colorBrightness(outlineColorBase) readonly property color outlineColor: { if (!root.panelOutline) { return backgroundColor; } if (outlineColorBaseBrightness > 127.5) { return Qt.darker(outlineColorBase, 1.5); } else { return Qt.lighter(outlineColorBase, 2.2); } } readonly property bool editModeTextColorIsBright: ColorizerTools.colorBrightness(editModeTextColor) > 127.5 readonly property color editModeTextColor: latteView && latteView.managedLayout ? latteView.managedLayout.textColor : "white" readonly property bool mustBeShown: (applyTheme && applyTheme !== theme) || (root.inConfigureAppletsMode && (root.themeColors === Latte.Types.SmartThemeColors)) readonly property real currentBackgroundBrightness: item ? item.currentBrightness : -1000 readonly property bool applyingWindowColors: (root.windowColors === Latte.Types.ActiveWindowColors && latteView && latteView.windowsTracker && latteView.windowsTracker.activeWindowScheme) || (root.windowColors === Latte.Types.TouchingWindowColors && latteView && latteView.windowsTracker && latteView.windowsTracker.touchingWindowScheme) property QtObject applyTheme: { if (latteView && latteView.windowsTracker && !root.hasExpandedApplet) { if (root.windowColors === Latte.Types.ActiveWindowColors && latteView.windowsTracker.activeWindowScheme) { return latteView.windowsTracker.activeWindowScheme; } if (root.windowColors === Latte.Types.TouchingWindowColors && latteView.windowsTracker.touchingWindowScheme) { //! we must track touching windows and when they are not ative //! the active window scheme is used for convenience if (latteView.windowsTracker.existsWindowTouching && !latteView.windowsTracker.activeWindowTouching && latteView.windowsTracker.activeWindowScheme) { return latteView.windowsTracker.activeWindowScheme; } return latteView.windowsTracker.touchingWindowScheme; } } if (themeExtended) { if (root.userShowPanelBackground && root.plasmaBackgroundForPopups && root.hasExpandedApplet /*for expanded popups when it is enabled*/ || (root.themeColors === Latte.Types.SmartThemeColors /*for Smart theming that Windows colors are not used and the user wants solidness at some cases*/ && root.windowColors === Latte.Types.NoneWindowColors && root.forceSolidPanel) ) { /* plasma style*/ return theme; } if (root.themeColors === Latte.Types.ReverseThemeColors) { return themeExtended.isLightTheme ? themeExtended.darkTheme : themeExtended.lightTheme; } if (root.themeColors === Latte.Types.SmartThemeColors) { if (currentBackgroundBrightness > 127.5) { return themeExtended.lightTheme; } else { return themeExtended.darkTheme; } } } return theme; } property color applyColor: textColor readonly property color backgroundColor:applyTheme.backgroundColor readonly property color textColor: { if (latteView && latteView.managedLayout && root.inConfigureAppletsMode && Latte.WindowSystem.compositingActive && root.panelTransparency<40 && (root.themeColors === Latte.Types.SmartThemeColors)) { return latteView.managedLayout.textColor; } return applyTheme.textColor; } readonly property color inactiveBackgroundColor: applyTheme === theme ? theme.backgroundColor : applyTheme.inactiveBackgroundColor readonly property color inactiveTextColor: applyTheme === theme ? theme.textColor : applyTheme.inactiveTextColor readonly property color highlightColor: applyTheme.highlightColor readonly property color highlightedTextColor: applyTheme.highlightedTextColor readonly property color positiveTextColor: applyTheme.positiveTextColor readonly property color neutralTextColor: applyTheme.neutralTextColor readonly property color negativeTextColor: applyTheme.negativeTextColor readonly property color buttonTextColor: applyTheme.buttonTextColor readonly property color buttonBackgroundColor: applyTheme.buttonBackgroundColor readonly property color buttonHoverColor: applyTheme.buttonHoverColor readonly property color buttonFocusColor: applyTheme.buttonFocusColor readonly property string scheme: { if (root.inConfigureAppletsMode && (root.themeColors === Latte.Types.SmartThemeColors)) { if (!Latte.WindowSystem.compositingActive && applyTheme !== theme) { return applyTheme.schemeFile; } //! in edit mode (that is shown the edit visual without opacity) //! take care the applets that need a proper color scheme to paint themselves if ((editModeTextColorIsBright && themeExtended.isLightTheme) || (!editModeTextColorIsBright && !themeExtended.isLightTheme)) { if (themeExtended.darkTheme === themeExtended.defaultTheme) { console.log("light theme..." + themeExtended.isLightTheme); return themeExtended.lightTheme.schemeFile; } else { console.log("dark theme..." + themeExtended.isLightTheme); return themeExtended.darkTheme.schemeFile; } } else { console.log("default theme... : " + themeExtended.isLightTheme); return themeExtended.defaultTheme.schemeFile; } } if (applyTheme===theme || !mustBeShown) { if (themeExtended) { return themeExtended.defaultTheme.schemeFile; } else { return "kdeglobals"; } } return applyTheme.schemeFile; } sourceComponent: Latte.BackgroundTracker { activity: managedLayout ? managedLayout.lastUsedActivity : "" location: plasmoid.location screenName: latteView && latteView.positioner ? latteView.positioner.currentScreenName : "" } } diff --git a/declarativeimports/components/BadgeText.qml b/declarativeimports/components/BadgeText.qml index 15a1d7aa..bf9f12c5 100644 --- a/declarativeimports/components/BadgeText.qml +++ b/declarativeimports/components/BadgeText.qml @@ -1,172 +1,176 @@ /* * Copyright 2019 Michail Vourlakos * * This file is part of Latte-Dock * * Latte-Dock is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Latte-Dock is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ import QtQuick 2.2 import QtGraphicalEffects 1.0 import org.kde.plasma.plasmoid 2.0 Rectangle { property double proportion: 0 property double previousProportion: 0 property int numberValue property string textValue property bool fullCircle: true property bool showNumber: true property bool showText: false property bool textWithBackgroundColor: false property int radiusPerCentage: 100 property int minimumWidth: 0 property int maximumWidth: 9999 property double circleOpacity: 1 property double fontPixelSize: partSize // * 0.55 property double stdThickness: partSize < 0 ? 0 : partSize // "/2.1" property double circleThicknessAttr: fullCircle ? 0 : stdThickness * 0.9 property double partSize: height / 2 property double pi2: Math.PI * 2 width: Math.max(minimumWidth, valueText.width + 4*units.smallSpacing) color: theme.backgroundColor radius: (radiusPerCentage / 100) * (height / 2) - border.width: 1 //Math.max(1,width/64) + border.width: 0 //Math.max(1,width/64) + property int borderWidth: 1 + property real borderOpacity: 1 + property color borderColor: theme.textColor property color textColor: theme.textColor property color highlightedColor: theme.buttonFocusColor onProportionChanged: { // console.log(previousProportion + " - "+proportion); if ((proportion - 0.03 >= previousProportion) || (proportion===1)) { // console.log("request repaint..."); previousProportion = proportion; repaint(); } } function repaint() { canvas.requestPaint() } Canvas { id: canvas property int lineWidth: 1 property bool fill: true property bool stroke: true property real alpha: 1.0 // edge bleeding fix readonly property double filler: 0.01 - width: parent.width - 2 * parent.border.width - height: parent.height - 2 * parent.border.width + width: parent.width - 2 * parent.borderWidth + height: parent.height - 2 * parent.borderWidth opacity: proportion > 0 ? 1 : 0 anchors.centerIn: parent property color drawColor: highlightedColor onDrawColorChanged: requestPaint(); onPaint: { var ctx = getContext('2d'); ctx.clearRect(0, 0, canvas.width, canvas.height); ctx.fillStyle = drawColor; var startRadian = - Math.PI / 2; var radians = pi2 * proportion; ctx.beginPath(); ctx.arc(width/2, height/2, stdThickness, startRadian, startRadian + radians + filler, false); ctx.arc(width/2, height/2, circleThicknessAttr, startRadian + radians + filler, startRadian, true); ctx.closePath(); ctx.fill(); } } Rectangle { id: badgerBackground anchors.fill: canvas color: canvas.drawColor visible: proportion === 100 && showNumber radius: parent.radius } Text { id: valueText anchors.centerIn: canvas width: Math.min(maximumWidth - 4*units.smallSpacing, implicitWidth) horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter elide: Text.ElideRight text: { if (showNumber) { if (numberValue > 9999) { return i18nc("Over 9999 new messages, overlay, keep short", "9,999+"); } else if (numberValue > 0) { return numberValue.toLocaleString(Qt.locale(), 'f', 0); } } if (showText) { return textValue; } return ""; } font.pixelSize: 0.62 * parent.height font.bold: true color: textWithBackgroundColor ? parent.color : parent.textColor visible: showNumber || showText } Rectangle{ anchors.fill: parent - anchors.topMargin: parent.border.width - anchors.bottomMargin: parent.border.width - anchors.leftMargin: parent.border.width - anchors.rightMargin: parent.border.width + anchors.topMargin: parent.borderWidth + anchors.bottomMargin: parent.borderWidth + anchors.leftMargin: parent.borderWidth + anchors.rightMargin: parent.borderWidth color: "transparent" - border.width: parent.border.width+1 + border.width: parent.borderWidth > 0 ? parent.borderWidth+1 : 0 border.color: "black" radius: parent.radius opacity: 0.4 } Rectangle{ anchors.fill: parent - border.width: parent.border.width - border.color: parent.border.color + border.width: parent.borderWidth + border.color: parent.borderColor color: "transparent" radius: parent.radius + opacity: parent.borderOpacity } } diff --git a/plasmoid/package/contents/ui/task/AudioStream.qml b/plasmoid/package/contents/ui/task/AudioStream.qml index 7933b5f2..d701fb4b 100644 --- a/plasmoid/package/contents/ui/task/AudioStream.qml +++ b/plasmoid/package/contents/ui/task/AudioStream.qml @@ -1,136 +1,136 @@ /*************************************************************************** * Copyright (C) 2017 Kai Uwe Broulik * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * ***************************************************************************/ import QtQuick 2.0 import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.latte 0.2 as Latte +import org.kde.latte.components 1.0 as LatteComponents Item { id: background Item { id: subRectangle width: parent.width/ 2 height: width states: [ State { name: "default" when: (root.position !== PlasmaCore.Types.RightPositioned) AnchorChanges { target: subRectangle anchors{ top:parent.top; bottom:undefined; left:parent.left; right:undefined;} } }, State { name: "right" when: (root.position === PlasmaCore.Types.RightPositioned) AnchorChanges { target: subRectangle anchors{ top:parent.top; bottom:undefined; left:undefined; right:parent.right;} } } ] - Rectangle { + LatteComponents.BadgeText { anchors.centerIn: parent width: 0.8 * parent.width height: width - radius: width/2 + minimumWidth: width + maximumWidth: width + + fullCircle: true + showNumber: false + showText: true color: theme.backgroundColor - Rectangle { - anchors.fill: parent - color: "transparent" - border.width: 1 - border.color: root.minimizedDotColor - radius: width/2 - - //opacity: taskItem.playingAudio && !taskItem.muted && taskItem.volume>0 ? 1 : 0.85 - } + borderColor: root.lightTextColor + proportion: 0 + radiusPerCentage: 100 Latte.IconItem{ id: audioStreamIcon anchors.centerIn: parent width: 0.9*parent.width height: width colorGroup: PlasmaCore.Theme.ButtonColorGroup usesPlasmaTheme: true //opacity: taskItem.playingAudio && !taskItem.muted ? 1 : 0.85 source: { if (taskItem.volume <= 0 || taskItem.muted) { return "audio-volume-muted"; } else if (taskItem.volume <= 25) { return "audio-volume-low"; } else if (taskItem.volume <= 75) { return "audio-volume-medium"; } else { return "audio-volume-high" ; } } MouseArea{ id: audioBadgeMouseArea anchors.fill: parent enabled: root.audioBadgeActionsEnabled property bool wheelIsBlocked: false; onClicked: { taskItem.toggleMuted(); } onWheel: { if (wheelIsBlocked) { return; } wheelIsBlocked = true; scrollDelayer.start(); var angle = wheel.angleDelta.y / 8; if (angle > 2) { taskItem.increaseVolume(); } else if (angle < -2) { taskItem.decreaseVolume(); } } //! A timer is needed in order to handle also touchpads that probably //! send too many signals very fast. This way the signals per sec are limited. //! The user needs to have a steady normal scroll in order to not //! notice a annoying delay Timer{ id: scrollDelayer interval: 80 onTriggered: audioBadgeMouseArea.wheelIsBlocked = false; } } } } } } diff --git a/plasmoid/package/contents/ui/task/ProgressOverlay.qml b/plasmoid/package/contents/ui/task/ProgressOverlay.qml index 5b2f5801..f492721d 100644 --- a/plasmoid/package/contents/ui/task/ProgressOverlay.qml +++ b/plasmoid/package/contents/ui/task/ProgressOverlay.qml @@ -1,118 +1,118 @@ /* * Copyright 2016 Smith AR * Michail Vourlakos * * This file is part of Latte-Dock * * Latte-Dock is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Latte-Dock is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ import QtQuick 2.0 import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.latte 0.2 as Latte import org.kde.latte.components 1.0 as LatteComponents Item { id: background readonly property int contentWidth: progressCircle.width + 0.1*height Item { id: subRectangle width: contentWidth height: parent.height / 2 states: [ State { name: "default" when: (root.position !== PlasmaCore.Types.RightPositioned) AnchorChanges { target: subRectangle anchors{ top:parent.top; bottom:undefined; left:undefined; right:parent.right;} } }, State { name: "right" when: (root.position === PlasmaCore.Types.RightPositioned) AnchorChanges { target: subRectangle anchors{ top:parent.top; bottom:undefined; left:parent.left; right:undefined;} } } ] LatteComponents.BadgeText { id: progressCircle anchors.centerIn: parent - border.color: textColor minimumWidth: Math.min(0.8 * parent.height, maximumWidth) maximumWidth: { if (showsAudioBadge) { return height; } else if ( index === parabolicManager.firstRealTaskIndex && !taskItem.containsMouse) { return (wrapper.mScale * (root.iconSize - (root.enableShadows ? shadowSize/2 : 0))); } else { return 999999; } } height: 0.8 * parent.height numberValue: { if (taskIcon.smartLauncherItem && (taskIcon.smartLauncherItem.countVisible || taskIcon.smartLauncherItem.progressVisible)) { return taskIcon.smartLauncherItem.count; } else if (taskItem.badgeIndicator > 0) { return taskItem.badgeIndicator; } return 0; } fullCircle: true showNumber: true color: theme.backgroundColor textColor: showsInfoBadge ? root.lightTextColor : theme.textColor + borderColor: root.lightTextColor highlightedColor: { if (showsInfoBadge) { return theme.negativeTextColor } return theme.buttonFocusColor; } textWithBackgroundColor: false proportion: { if (taskIcon.smartLauncherItem && taskIcon.smartLauncherItem.progressVisible) { return taskIcon.smartLauncherItem.progress / 100; } if (taskItem.badgeIndicator > 0 || (taskIcon.smartLauncherItem && taskIcon.smartLauncherItem.countVisible)) { return 100; } return 0; } readonly property bool showsInfoBadge: ((taskItem.badgeIndicator > 0) || (taskIcon.smartLauncherItem && taskIcon.smartLauncherItem.countVisible && !taskIcon.smartLauncherItem.progressVisible)) readonly property bool showsAudioBadge: root.showAudioBadge && taskItem.hasAudioStream && taskItem.playingAudio && !taskItem.isSeparator } } } diff --git a/plasmoid/package/contents/ui/task/ShortcutBadge.qml b/plasmoid/package/contents/ui/task/ShortcutBadge.qml index 55e96ad6..8aa77708 100644 --- a/plasmoid/package/contents/ui/task/ShortcutBadge.qml +++ b/plasmoid/package/contents/ui/task/ShortcutBadge.qml @@ -1,82 +1,81 @@ /* * Copyright 2019 Michail Vourlakos * * This file is part of Latte-Dock * * Latte-Dock is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * Latte-Dock is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ import QtQuick 2.7 import QtGraphicalEffects 1.0 import org.kde.latte 0.2 as Latte import org.kde.latte.components 1.0 as LatteComponents Loader{ id: shorcutBadge anchors.fill: iconImageBuffer active: root.showTaskShortcutBadges && !taskItem.isSeparator && fixedIndex>=0 && fixedIndex<20 asynchronous: true visible: badgeString !== "" property int fixedIndex:-1 property string badgeString: (shorcutBadge.fixedIndex>=1 && shorcutBadge.fixedIndex<20 && root.badgesForActivate.length===19) ? root.badgesForActivate[shorcutBadge.fixedIndex-1] : "" Connections { target: root onShowTaskShortcutBadgesChanged: shorcutBadge.fixedIndex = parabolicManager.pseudoTaskIndex(index+1); } Component.onCompleted: fixedIndex = parabolicManager.pseudoTaskIndex(index+1); sourceComponent: Item{ Loader{ anchors.fill: taskNumber active: root.enableShadows sourceComponent: DropShadow{ color: root.appShadowColor fast: true samples: 2 * radius source: taskNumber radius: root.appShadowSize/2 verticalOffset: 2 } } LatteComponents.BadgeText { id: taskNumber - // when iconSize < 48, height is always = 24, height / iconSize > 50% // we prefer center aligned badges to top-left aligned ones property bool centerInParent: root.iconSize < 48 anchors.left: centerInParent? undefined : parent.left anchors.top: centerInParent? undefined : parent.top anchors.centerIn: centerInParent? parent : undefined minimumWidth: 0.4 * (wrapper.mScale * root.iconSize) height: Math.max(24, 0.4 * (wrapper.mScale * root.iconSize)) - border.color: root.minimizedDotColor textValue: shorcutBadge.badgeString + borderColor: root.lightTextColor showNumber: false showText: true proportion: 0 radiusPerCentage: 100 } } }