Tracing: Force alpha channel of RangeMove into a sane range

We want the range mover to be visible, but not completely opaque and we
don't want to depend on the theme for this. Therefore if the alpha
channel is < 0.3 or or > 0.7 just clamp it.

Change-Id: I4e5ee32bd890dc8db2bc4b9bcd77b4687b23e22d
Fixes: QTCREATORBUG-21402
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Ulf Hermann
2018-10-29 10:49:18 +01:00
parent 8ab9b93b79
commit 1b6d57263b

View File

@@ -48,7 +48,11 @@ Item {
width: rightRange.x - leftRange.x
height: parent.height
color: width > 1 ? (dragArea.pressed ? dragColor : rangeColor) : singleLineColor
function alphaColor(color) {
return Qt.rgba(color.r, color.g, color.b, Math.max(Math.min(color.a, 0.7), 0.3));
}
color: width > 1 ? alphaColor(dragArea.pressed ? dragColor : rangeColor) : singleLineColor
}
Item {