From 3ea01dfafca45907deb35cffbf97e9a1bca2dc3f Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Mon, 23 Jul 2018 19:35:09 +0300 Subject: [PATCH] fix badge text warning and border.color --- .../package/contents/ui/applet/AppletItemWrapper.qml | 1 + containment/package/contents/ui/main.qml | 3 +++ liblattedock/qml/BadgeText.qml | 5 ++--- plasmoid/package/contents/ui/main.qml | 8 +++++++- plasmoid/package/contents/ui/task/TaskIconItem.qml | 1 + plasmoid/package/contents/ui/task/TaskProgressOverlay.qml | 1 + 6 files changed, 15 insertions(+), 4 deletions(-) diff --git a/containment/package/contents/ui/applet/AppletItemWrapper.qml b/containment/package/contents/ui/applet/AppletItemWrapper.qml index 081ce9d63..36c2065cc 100644 --- a/containment/package/contents/ui/applet/AppletItemWrapper.qml +++ b/containment/package/contents/ui/applet/AppletItemWrapper.qml @@ -636,6 +636,7 @@ Item{ minimumWidth: 0.4 * root.iconSize height: width + border.color: root.minimizedDotColor numberValue: appletNumberLoader.fixedIndex < 10 ? appletNumberLoader.fixedIndex : 0 Binding{ diff --git a/containment/package/contents/ui/main.qml b/containment/package/contents/ui/main.qml index 20c39336a..6d756d32f 100644 --- a/containment/package/contents/ui/main.qml +++ b/containment/package/contents/ui/main.qml @@ -376,6 +376,8 @@ DragDrop.DropArea { } property rect screenGeometry: dock ? dock.screenGeometry : plasmoid.screenGeometry + + readonly property color minimizedDotColor: colorizerLoader.minimizedDotColor ///END properties from latteApplet /* Layout.preferredWidth: plasmoid.immutable ? @@ -1772,6 +1774,7 @@ DragDrop.DropArea { readonly property real themeBackgroundColorLuma: 0.2126*backColorRs + 0.7152*backColorGs + 0.0722*backColorBs readonly property real themeTextColorLuma: 0.2126*textColorRs + 0.7152*textColorGs + 0.0722*textColorBs + readonly property color minimizedDotColor: themeTextColorLuma > 0.6 ? Qt.darker(theme.textColor, 1.7) : Qt.lighter(theme.textColor, 7) property bool isShown: active && !forceSolidPanel //! when forceSemiTransparentPanel is enabled because of snapped or maximized etc. windows diff --git a/liblattedock/qml/BadgeText.qml b/liblattedock/qml/BadgeText.qml index 099879d10..7f4f347cc 100644 --- a/liblattedock/qml/BadgeText.qml +++ b/liblattedock/qml/BadgeText.qml @@ -56,7 +56,6 @@ Rectangle { color: theme.backgroundColor //mainItemContainer.badgeIndicator > 0 ? alphaBackColor2 : alphaBackColor radius: (radiusPerCentage / 100) * (height / 2) border.width: Math.max(1,width/64) - border.color: root.minimizedDotColor //alphaBackColor2 onProportionChanged: { // console.log(previousProportion + " - "+proportion); @@ -128,14 +127,14 @@ Rectangle { return i18nc("Over 9999 new messages, overlay, keep short", "9,999+"); } else if (numberValue > 0) { return numberValue.toLocaleString(Qt.locale(), 'f', 0); - } else { - return ""; } } if (showText) { return textValue; } + + return ""; } font.pixelSize: 0.55 * parent.height font.bold: true diff --git a/plasmoid/package/contents/ui/main.qml b/plasmoid/package/contents/ui/main.qml index d8298fe2e..6e2c8c1e7 100644 --- a/plasmoid/package/contents/ui/main.qml +++ b/plasmoid/package/contents/ui/main.qml @@ -124,7 +124,13 @@ Item { } property real textColorLuma: 0.2126*textColorRs + 0.7152*textColorGs + 0.0722*textColorBs - property color minimizedDotColor: textColorLuma > 0.6 ? Qt.darker(theme.textColor, 1.7) : Qt.lighter(theme.textColor, 7) + property color minimizedDotColor: { + if (latteDock) { + return latteDock.minimizedDotColor; + } + + return textColorLuma > 0.6 ? Qt.darker(theme.textColor, 1.7) : Qt.lighter(theme.textColor, 7) + } //a small badgers record (id,value) //in order to track badgers when there are changes diff --git a/plasmoid/package/contents/ui/task/TaskIconItem.qml b/plasmoid/package/contents/ui/task/TaskIconItem.qml index 03d6c7529..3e57804b8 100644 --- a/plasmoid/package/contents/ui/task/TaskIconItem.qml +++ b/plasmoid/package/contents/ui/task/TaskIconItem.qml @@ -495,6 +495,7 @@ Item{ Latte.BadgeText { id: taskNumber anchors.centerIn: parent + border.color: root.minimizedDotColor //opacity: taskNumberLoader.opacityN && !root.enableShadows ? 1 : 0 minimumWidth: 0.4 * root.iconSize diff --git a/plasmoid/package/contents/ui/task/TaskProgressOverlay.qml b/plasmoid/package/contents/ui/task/TaskProgressOverlay.qml index 8ab330184..359481c22 100644 --- a/plasmoid/package/contents/ui/task/TaskProgressOverlay.qml +++ b/plasmoid/package/contents/ui/task/TaskProgressOverlay.qml @@ -58,6 +58,7 @@ Item { Latte.BadgeText { id: progressCircle anchors.centerIn: parent + border.color: root.minimizedDotColor minimumWidth: 0.8 * parent.height height: 0.8 * parent.height numberValue: mainItemContainer.badgeIndicator > 0 ? mainItemContainer.badgeIndicator : centralItem.smartLauncherItem.count