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.
This commit is contained in:
parent
f8983afa17
commit
329531777a
@ -77,23 +77,22 @@ QRectF QskSegmentedBarSkinlet::segmentRect(
|
|||||||
{
|
{
|
||||||
using Q = QskSegmentedBar;
|
using Q = QskSegmentedBar;
|
||||||
|
|
||||||
const auto spacing = bar->spacingHint( Q::Panel );
|
|
||||||
const auto count = bar->count();
|
const auto count = bar->count();
|
||||||
|
|
||||||
auto rect = subControlRect( bar, contentsRect, Q::Panel );
|
auto rect = subControlRect( bar, contentsRect, Q::Panel );
|
||||||
|
|
||||||
if( bar->orientation() == Qt::Horizontal )
|
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 );
|
rect.setWidth( w );
|
||||||
}
|
}
|
||||||
else
|
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 );
|
rect.setHeight( h );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user