From 529c6f0bab64ee33890efabbbb83399b930f7a96 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Fri, 22 Feb 2019 18:49:06 +0200 Subject: [PATCH] adjust applet to new LatteIndicator --- .../package/contents/ui/applet/AppletItem.qml | 40 ++++++++++++++++--- liblatte2/qml/indicators/LatteIndicator.qml | 10 ++++- 2 files changed, 44 insertions(+), 6 deletions(-) diff --git a/containment/package/contents/ui/applet/AppletItem.qml b/containment/package/contents/ui/applet/AppletItem.qml index 0e7635e78..bff952bd4 100644 --- a/containment/package/contents/ui/applet/AppletItem.qml +++ b/containment/package/contents/ui/applet/AppletItem.qml @@ -497,6 +497,7 @@ Item { //! Active Indicator loader Loader{ anchors.fill: parent + active: (root.activeIndicator === Latte.Types.AllIndicator || (root.activeIndicator === Latte.Types.InternalsIndicator && communicator.overlayLatteIconIsActive)) && communicator.activeIndicatorEnabled @@ -506,13 +507,42 @@ Item { sourceComponent: root.indicatorStyle===Latte.Types.LatteIndicator ? latteStyleIndicator : (root.indicatorStyle===Latte.Types.PlasmaIndicator ? plasmaStyleIndicator : unityStyleIndicator) + /* Indicators Properties in order use them*/ + readonly property bool isTask: false + readonly property bool isApplet: true + + readonly property bool isLauncher: false + readonly property bool isStartup: false + readonly property bool isWindow: false + + readonly property alias isActive: appletItem.isActive + readonly property bool isGroup: false + readonly property bool isMinimized: false + readonly property bool inAttention: false + + readonly property bool hasActive: false + readonly property bool hasMinimized: false + readonly property bool hasShown: false + + readonly property int iconSize: root.iconSize + readonly property int durationTime: root.durationTime + readonly property real scaleFactor: wrapper.zoomScale + readonly property color shadowColor: root.appShadowColorSolid + + readonly property bool dotsOnActive: root.dotsOnActive + readonly property bool multiColorEnabled: root.threeColorsWindows + readonly property bool reversedEnabled: root.reverseLinesPosition + readonly property int activeIndicatorType: root.activeIndicatorType + + //!glow options + readonly property bool glowEnabled: root.showGlow + readonly property int glowOption: root.glowOption + readonly property real glowOpacity: root.glowOpacity + readonly property bool glow3D: root.glow3D + Component { id: latteStyleIndicator - - Item{ - anchors.fill: parent - Indicators.LatteIndicator{} - } + Latte.LatteIndicator{} } Component { diff --git a/liblatte2/qml/indicators/LatteIndicator.qml b/liblatte2/qml/indicators/LatteIndicator.qml index 95f992249..8cfa06976 100644 --- a/liblatte2/qml/indicators/LatteIndicator.qml +++ b/liblatte2/qml/indicators/LatteIndicator.qml @@ -69,7 +69,15 @@ Item{ Latte.GlowPoint{ id:firstPoint - visible: ( !IsLauncher ) ? true: false + opacity: { + if (rootItem.isTask) { + return rootItem.isLauncher ? 0 : 1 + } + + if (rootItem.isApplet) { + return (rootItem.isActive || activeAndReverseAnimation.running) ? 1 : 0 + } + } basicColor: rootItem.isActive || (rootItem.isGroup && rootItem.hasShown) ? indicatorRoot.isActiveColor : indicatorRoot.notActiveColor