Fix text position in mirrored layouts
This commit is contained in:
parent
4c1f60eb1c
commit
ffa150a5fd
|
@ -135,17 +135,15 @@ QRectF QskRadioBoxSkinlet::textRect( const QskRadioBox* radio,
|
||||||
auto lh = lineHeight( radio );
|
auto lh = lineHeight( radio );
|
||||||
const auto textMargins = radio->marginHint( Q::Text );
|
const auto textMargins = radio->marginHint( Q::Text );
|
||||||
|
|
||||||
result.setSize( { radio->strutSizeHint( Q::Text ).width(), lh } );
|
|
||||||
|
|
||||||
|
|
||||||
result.moveTop( index * ( lh + spacing )
|
result.moveTop( index * ( lh + spacing )
|
||||||
+ lh - radio->effectiveFontHeight(Q::Text)
|
+ lh - radio->effectiveFontHeight(Q::Text)
|
||||||
+ textMargins.top());
|
+ textMargins.top());
|
||||||
|
|
||||||
if( !radio->layoutMirroring() ) {
|
if( !radio->layoutMirroring() ) {
|
||||||
auto symbolWidth = buttonRect( radio, Q::Symbol, rect, index ).width();
|
auto maxWidth = qMax( buttonRect( radio, Q::Symbol, rect, index ).width(),
|
||||||
auto radioWidth = buttonRect( radio, Q::Button, rect, index ).width();
|
buttonRect( radio, Q::Button, rect, index ).width());
|
||||||
result.moveLeft( qMax(symbolWidth, radioWidth) + textMargins.left());
|
|
||||||
|
result.moveLeft( maxWidth + textMargins.left());
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Reference in New Issue