From 1b6d57263b35cd10e2ab24a9227e6b4b9245394d Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 29 Oct 2018 10:49:18 +0100 Subject: [PATCH] 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 --- src/libs/tracing/qml/RangeMover.qml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libs/tracing/qml/RangeMover.qml b/src/libs/tracing/qml/RangeMover.qml index f11505e3571..7a4e27e01f1 100644 --- a/src/libs/tracing/qml/RangeMover.qml +++ b/src/libs/tracing/qml/RangeMover.qml @@ -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 {