From 18087b716bf0cff7a710d14f5be8cf498742cca3 Mon Sep 17 00:00:00 2001 From: KhalilSelyan Date: Sun, 19 May 2024 19:16:50 +0300 Subject: [PATCH] correcting borders for segmented button item Signed-off-by: KhalilSelyan --- .../src/custom_segmented_button_item.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/common/tier4_state_rviz_plugin/src/custom_segmented_button_item.cpp b/common/tier4_state_rviz_plugin/src/custom_segmented_button_item.cpp index 101cde7f6b427..6f3929d1f94cf 100644 --- a/common/tier4_state_rviz_plugin/src/custom_segmented_button_item.cpp +++ b/common/tier4_state_rviz_plugin/src/custom_segmented_button_item.cpp @@ -1,7 +1,5 @@ #include "include/custom_segmented_button_item.hpp" -#include - CustomSegmentedButtonItem::CustomSegmentedButtonItem(const QString & text, QWidget * parent) : QPushButton(text, parent), bgColor("#0F1417"), @@ -106,7 +104,7 @@ void CustomSegmentedButtonItem::paintEvent(QPaintEvent *) // Draw button background - QRect buttonRect = rect(); + QRect buttonRect = rect().adjusted(0, 1, 0, -1); if (isFirstButton) { buttonRect.setLeft(buttonRect.left() + 1); @@ -141,7 +139,10 @@ void CustomSegmentedButtonItem::paintEvent(QPaintEvent *) painter.fillPath(path, buttonColor); // Draw button border - painter.setPen(QPen(QColor("#8a9297"), 2)); // Color for the borders + QPen pen(QColor("#8a9297"), 1); + pen.setJoinStyle(Qt::RoundJoin); + pen.setCapStyle(Qt::RoundCap); + painter.setPen(pen); painter.drawPath(path.simplified()); // Draw button text