From 329531777ab51a908b8e282f7600783be11d4ae7 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Fri, 27 Jan 2023 15:17:17 +0100 Subject: [PATCH] segmented bar: Always assume 0 spacing between elements ... as is in the nature of this control. Rather think of the spacing as the space between the icon and the text, like we do with QskPushButton. --- src/controls/QskSegmentedBarSkinlet.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/controls/QskSegmentedBarSkinlet.cpp b/src/controls/QskSegmentedBarSkinlet.cpp index 33590124..54f40dd8 100644 --- a/src/controls/QskSegmentedBarSkinlet.cpp +++ b/src/controls/QskSegmentedBarSkinlet.cpp @@ -77,23 +77,22 @@ QRectF QskSegmentedBarSkinlet::segmentRect( { using Q = QskSegmentedBar; - const auto spacing = bar->spacingHint( Q::Panel ); const auto count = bar->count(); auto rect = subControlRect( bar, contentsRect, Q::Panel ); if( bar->orientation() == Qt::Horizontal ) { - const qreal w = ( rect.width() - ( count - 1 ) * spacing ) / count; + const qreal w = rect.width() / count; - rect.setLeft( index * ( w + spacing ) ); + rect.setLeft( index * w ); rect.setWidth( w ); } else { - const qreal h = ( rect.height() - ( count - 1 ) * spacing ) / count; + const qreal h = rect.height() / count; - rect.setTop( index * ( h + spacing ) ); + rect.setTop( index * h ); rect.setHeight( h ); }