diff options
author | Alessandro Portale <[email protected]> | 2025-07-01 16:52:09 +0200 |
---|---|---|
committer | Alessandro Portale <[email protected]> | 2025-07-01 15:37:12 +0000 |
commit | 8c80e67b75acd85fe088eac07466aeee298094a2 (patch) | |
tree | f25cde5372d325f52ad6bf8a844c36c174e2ca74 | |
parent | 4d9d215070c1a5e669c570503a3748de9b28b451 (diff) |
- Keep a small gap between active/hover highlights
- Draw a continuous thin line on the bottom
Change-Id: I373a074fea3784b2cda33c03bee2293fcbfc621a
Reviewed-by: Cristian Adam <[email protected]>
-rw-r--r-- | src/libs/utils/qtcwidgets.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libs/utils/qtcwidgets.cpp b/src/libs/utils/qtcwidgets.cpp index 0c388c5a364..705f565bd49 100644 --- a/src/libs/utils/qtcwidgets.cpp +++ b/src/libs/utils/qtcwidgets.cpp @@ -843,6 +843,11 @@ QtcTabBar::QtcTabBar(QWidget *parent) void QtcTabBar::paintEvent([[maybe_unused]] QPaintEvent *event) { QPainter p(this); + const int padding = PaddingHXxs; + const QRectF borderR = rect().toRectF().adjusted(padding + 0.5, 0.5, -(padding + 0.5), -0.5); + p.setPen(creatorColor(isEnabled() ? Theme::Token_Stroke_Subtle + : Theme::Token_Foreground_Subtle)); + p.drawLine(borderR.bottomLeft(), borderR.bottomRight()); p.setFont(TabBarTf.font()); for (int tabIndex = 0; tabIndex < count(); tabIndex++) { QStyleOptionTab opt; @@ -851,7 +856,7 @@ void QtcTabBar::paintEvent([[maybe_unused]] QPaintEvent *event) const bool enabled = isEnabled(); const bool hovered = !selected && opt.rect.contains(mapFromGlobal(QCursor::pos())); if (selected || (hovered && enabled)) { - QRect highLightRect = opt.rect; + QRect highLightRect = opt.rect.adjusted(padding, 0, -padding, 0); highLightRect.moveTop(highLightRect.height() - StyleHelper::HighlightThickness); const QColor color = creatorColor(enabled ? hovered ? Theme::Token_Text_Subtle : Theme::Token_Accent_Default |