Fix Ribble in mirrored layouts
This commit is contained in:
parent
84d662979d
commit
4c1f60eb1c
|
@ -29,15 +29,7 @@ QRectF QskRadioBoxSkinlet::subControlRect( const QskSkinnable* skinnable,
|
||||||
auto radio = static_cast<const QskRadioBox*>( skinnable );
|
auto radio = static_cast<const QskRadioBox*>( skinnable );
|
||||||
|
|
||||||
if( subcontrol == Q::Ripple ) {
|
if( subcontrol == Q::Ripple ) {
|
||||||
auto result = contentsRect;
|
return buttonRect(radio, Q::Ripple, contentsRect, radio->focusedIndex());
|
||||||
auto lh = lineHeight( radio );
|
|
||||||
auto spacing = radio->spacingHint(Q::Panel);
|
|
||||||
result.setSize( radio->strutSizeHint( subcontrol ) );
|
|
||||||
result.moveTop( (lh + spacing) * radio->focusedIndex()
|
|
||||||
- (result.size().height() - lh ) / 2);
|
|
||||||
result.moveLeft(( radio->strutSizeHint( Q::Button ).width()
|
|
||||||
- result.width()) /2);
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return contentsRect;
|
return contentsRect;
|
||||||
|
@ -124,11 +116,13 @@ QRectF QskRadioBoxSkinlet::buttonRect( const QskRadioBox* radio,
|
||||||
result.moveTop( ( lineHeight( radio ) + spacing ) * index
|
result.moveTop( ( lineHeight( radio ) + spacing ) * index
|
||||||
+ (lineHeight(radio) - result.size().height()) / 2);
|
+ (lineHeight(radio) - result.size().height()) / 2);
|
||||||
|
|
||||||
|
auto maxWidth = qMax(radio->strutSizeHint( Q::Button ).width(),
|
||||||
|
radio->strutSizeHint( Q::Symbol ).width());
|
||||||
|
|
||||||
if( radio->layoutMirroring() ) {
|
if( radio->layoutMirroring() ) {
|
||||||
result.moveRight( rect.width() );
|
result.moveRight( rect.width() - (maxWidth - result.width())/2);
|
||||||
} else {
|
} else {
|
||||||
result.moveLeft((radio->strutSizeHint( Q::Button ).width()
|
result.moveLeft((maxWidth - result.width()) / 2);
|
||||||
- result.width()) / 2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Reference in New Issue