From b7584239a270e7576f89987d3ae0b5287d43048f Mon Sep 17 00:00:00 2001 From: KhalilSelyan Date: Fri, 17 May 2024 19:33:56 +0300 Subject: [PATCH] thicker track and longer handle slider Signed-off-by: KhalilSelyan --- common/tier4_state_rviz_plugin/src/custom_slider.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/common/tier4_state_rviz_plugin/src/custom_slider.cpp b/common/tier4_state_rviz_plugin/src/custom_slider.cpp index 3465b0e8835e1..04c45c0e49a63 100644 --- a/common/tier4_state_rviz_plugin/src/custom_slider.cpp +++ b/common/tier4_state_rviz_plugin/src/custom_slider.cpp @@ -22,7 +22,7 @@ void CustomSlider::paintEvent(QPaintEvent *) QRect handleRect = style()->subControlRect(QStyle::CC_Slider, &opt, QStyle::SC_SliderHandle, this); - int trackThickness = 10; + int trackThickness = 14; int gap = 8; QRect beforeRect( @@ -46,12 +46,12 @@ void CustomSlider::paintEvent(QPaintEvent *) centerY - trackThickness / 2); // Straight line to right side start - beforePath.lineTo(beforeRect.right() - trackThickness * 0.2, centerY - trackThickness / 2); + beforePath.lineTo(beforeRect.right() - trackThickness * 0.1, centerY - trackThickness / 2); // Right side with 20% roundedness beforePath.quadTo(beforeRect.right(), centerY - trackThickness / 2, beforeRect.right(), centerY); beforePath.quadTo( - beforeRect.right(), centerY + trackThickness / 2, beforeRect.right() - trackThickness * 0.2, + beforeRect.right(), centerY + trackThickness / 2, beforeRect.right() - trackThickness * 0.1, centerY + trackThickness / 2); // Close the path to the left side @@ -64,19 +64,19 @@ void CustomSlider::paintEvent(QPaintEvent *) QPainterPath afterPath; afterPath.moveTo(afterRect.left(), centerY + trackThickness / 2); afterPath.quadTo( - afterRect.left(), centerY - trackThickness / 2, afterRect.left() + trackThickness * 0.2, + afterRect.left(), centerY - trackThickness / 2, afterRect.left() + trackThickness * 0.1, centerY - trackThickness / 2); afterPath.lineTo(afterRect.right() - trackThickness * 0.5, centerY - trackThickness / 2); afterPath.quadTo(afterRect.right(), centerY - trackThickness / 2, afterRect.right(), centerY); afterPath.quadTo( afterRect.right(), centerY + trackThickness / 2, afterRect.right() - trackThickness * 0.5, centerY + trackThickness / 2); - afterPath.lineTo(afterRect.left() + trackThickness * 0.2, centerY + trackThickness / 2); + afterPath.lineTo(afterRect.left() + trackThickness * 0.1, centerY + trackThickness / 2); afterPath.quadTo(afterRect.left(), centerY + trackThickness / 2, afterRect.left(), centerY); painter.fillPath(afterPath, inactiveTrackColor); painter.setBrush(QColor("#8bd0f0")); - int handleLineHeight = 25; + int handleLineHeight = 30; int handleLineWidth = 4; int handleLineRadius = 2; QRect handleLineRect(