1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-08-21 13:49:29 +03:00

improvements for Unity indicator

This commit is contained in:
Michail Vourlakos
2019-02-23 15:02:48 +02:00
parent f1eb8becfc
commit ab0604b149

View File

@ -20,36 +20,99 @@
import QtQuick 2.0
import QtGraphicalEffects 1.0
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.latte 0.2 as Latte
Rectangle {
id: unityRect
anchors.bottom: parent.bottom
anchors.bottomMargin: 2
anchors.horizontalCenter: parent.horizontalCenter
width: parent.width - 4
height: parent.height - 4
radius: 4
//height: (root.iconSize + root.thickMargin)/6 - 4
//radius: height/2
color: rootItem.backgroundColor
clip: true
Item{
property Item rootItem: parent
property Item rootItem: parent
RadialGradient{
anchors.verticalCenter: parent.top
anchors.horizontalCenter: parent.horizontalCenter
width: parent.width
Item{
width: Math.min(parent.width, parent.height)
height: width
anchors.centerIn: parent
gradient: Gradient {
GradientStop { position: 0.0; color: rootItem.glowColor }
GradientStop { position: 0.6; color: "transparent" }
Rectangle {
id: unityRect
anchors.fill: parent
anchors.margins: 4
visible: rootItem.isActive || (rootItem.isWindow && rootItem.hasShown)
radius: 8
//height: (root.iconSize + root.thickMargin)/6 - 4
//radius: height/2
color: {
if (rootItem.inAttention) {
return theme.negativeTextColor;
}
if (isActive) {
return theme.buttonFocusColor;
}
return rootItem.backgroundColor;
}
clip: true
property bool isActive: rootItem.isActive || (rootItem.isWindow && rootItem.hasActive)
RadialGradient{
anchors.verticalCenter: parent.top
anchors.horizontalCenter: parent.horizontalCenter
width: parent.width
height: width * 0.85
gradient: Gradient {
GradientStop { position: 0.0;
color: {
if (rootItem.inAttention) {
return Qt.lighter(theme.negativeTextColor, 1.5)
}
if (isActive) {
return Qt.lighter(theme.buttonFocusColor, 1.5)
}
return rootItem.glowColor;
}
}
GradientStop { position: 0.6; color: "transparent" }
}
}
}
Rectangle {
anchors.fill: parent
anchors.margins: 4
visible: (rootItem.isTask && rootItem.isWindow) || (rootItem.isApplet && rootItem.isActive)
color: "transparent"
border.width: Math.max(1, rootItem.iconSize / 64)
border.color: "#606060"
radius: 8
clip: true
RadialGradient{
anchors.verticalCenter: parent.top
anchors.horizontalCenter: parent.horizontalCenter
width: parent.width
height: width * 0.85
visible: !unityRect.visible
gradient: Gradient {
GradientStop { position: 0.0; color: "#aafcfcfc" }
GradientStop { position: 0.6; color: "transparent" }
}
}
Rectangle {
anchors.fill: parent
anchors.margins: parent.border.width
radius: 8
color: "transparent"
border.width: parent.border.width
border.color: "#25dedede"
}
}
}
visible: rootItem.isWindow && (rootItem.isActive || rootItem.hasShown)
}