1
0
mirror of https://github.com/KDE/latte-dock.git synced 2024-12-24 05:33:50 +03:00

improve 3d contrast for GlowPoint

This commit is contained in:
Michail Vourlakos 2018-01-03 18:49:02 +02:00
parent 4692b87bb5
commit 0a6e00c9e7
2 changed files with 23 additions and 1 deletions

View File

@ -31,6 +31,7 @@ Item{
property bool glow3D: true
property bool roundCorners: true
property bool showBorder: false
property bool showAttention: false
property bool showGlow: false
@ -46,7 +47,8 @@ Item{
property color animationColor: "red" // it is used only internally for the animation
readonly property color basicColorAlpha: Qt.rgba(basicColor.r, basicColor.g, basicColor.b, glowOpacity)
readonly property color animationColorAlpha: Qt.rgba(animationColor.r, animationColor.g, animationColor.b, glowOpacity)
readonly property color contrastColorAlpha: Qt.rgba(contrastColor.r, contrastColor.g, contrastColor.b, Math.min(glowOpacity+0.4,1))
readonly property color contrastColorAlpha: Qt.rgba(contrastColor.r, contrastColor.g, contrastColor.b, Math.min(glowOpacity+0.25,1))
readonly property color contrastColorAlpha2: Qt.rgba(contrastColor.r, contrastColor.g, contrastColor.b, 0.3)
readonly property bool isVertical: (location === PlasmaCore.Types.LeftEdge) || (location === PlasmaCore.Types.RightEdge)
readonly property bool isHorizontal: !isVertical
@ -176,6 +178,24 @@ Item{
}
}
//! add border around indicator without reducing its size
Loader{
anchors.centerIn: mainElement
active: glowItem.showBorder && !glowItem.showGlow
sourceComponent:Rectangle {
width: size
height: size
anchors.centerIn: parent
color: contrastColorAlpha2
radius: glowItem.roundCorners ? Math.min(width,height) / 2 : 0
property int size: Math.min(mainElement.width + 2*Math.max(1,mainElement.width/5 ),
mainElement.height + 2*Math.max(1,mainElement.height/5 ))
}
}
Item{
id:mainElement
anchors.fill: parent

View File

@ -83,6 +83,7 @@ Item{
else
return false;
}
showBorder: root.showGlow && root.glow3D
// opacity: (!mainItemContainer.hasActive && root.showPreviews
// && windowsPreviewDlg.activeItem && (windowsPreviewDlg.activeItem === mainItemContainer)) ? 0.4 : 1
@ -186,6 +187,7 @@ Item{
location: plasmoid.location
glowOpacity: root.glowOpacity
contrastColor: root.appShadowColorSolid
showBorder: root.showGlow && root.glow3D
basicColor: state2Color //mainItemContainer.hasActive ? state2Color : state1Color
roundCorners: true