segmented bar: Don't constrain segment and cursor to inner box
In case we want to fill e.g. the cursor completely, we want to access the contents rect. This means that it is our responsibility to not draw beyond the panel.
This commit is contained in:
parent
e17ed9ee3e
commit
c4b1fd7916
|
@ -49,7 +49,6 @@ QRectF QskSegmentedBarSkinlet::cursorRect(
|
||||||
return QRectF();
|
return QRectF();
|
||||||
|
|
||||||
auto rect = subControlRect( bar, contentsRect, Q::Panel );
|
auto rect = subControlRect( bar, contentsRect, Q::Panel );
|
||||||
rect = bar->innerBox( Q::Panel, rect );
|
|
||||||
|
|
||||||
if( rect.isEmpty() )
|
if( rect.isEmpty() )
|
||||||
return QRectF();
|
return QRectF();
|
||||||
|
@ -81,7 +80,6 @@ QRectF QskSegmentedBarSkinlet::segmentRect(
|
||||||
const auto count = bar->count();
|
const auto count = bar->count();
|
||||||
|
|
||||||
auto rect = subControlRect( bar, contentsRect, Q::Panel );
|
auto rect = subControlRect( bar, contentsRect, Q::Panel );
|
||||||
rect = bar->innerBox( Q::Panel, rect );
|
|
||||||
|
|
||||||
if( bar->orientation() == Qt::Horizontal )
|
if( bar->orientation() == Qt::Horizontal )
|
||||||
{
|
{
|
||||||
|
@ -238,7 +236,7 @@ QRectF QskSegmentedBarSkinlet::sampleRect( const QskSkinnable* skinnable,
|
||||||
if ( subControl == Q::Text || subControl == Q::Graphic )
|
if ( subControl == Q::Text || subControl == Q::Graphic )
|
||||||
{
|
{
|
||||||
const auto rect = sampleRect( skinnable, contentsRect, Q::Segment, index );
|
const auto rect = sampleRect( skinnable, contentsRect, Q::Segment, index );
|
||||||
return skinnable->innerBox( Q::Segment, rect );
|
return rect;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Inherited::sampleRect( skinnable, contentsRect, subControl, index );
|
return Inherited::sampleRect( skinnable, contentsRect, subControl, index );
|
||||||
|
|
Loading…
Reference in New Issue