Return empty Rect if item is empty
This commit is contained in:
parent
4d0a26d762
commit
6beabfcbb1
|
@ -69,6 +69,10 @@ QRectF QskRadioBox::focusIndicatorRect() const {
|
||||||
auto buttonRect = effectiveSkinlet()->sampleRect( this,
|
auto buttonRect = effectiveSkinlet()->sampleRect( this,
|
||||||
contentsRect(), QskRadioBox::Button, m_data->focusedIndex );
|
contentsRect(), QskRadioBox::Button, m_data->focusedIndex );
|
||||||
|
|
||||||
|
if( textRect == QRectF() ) {
|
||||||
|
return buttonRect;
|
||||||
|
}
|
||||||
|
|
||||||
auto result = QRectF(
|
auto result = QRectF(
|
||||||
qMin( textRect.x(), buttonRect.x() ),
|
qMin( textRect.x(), buttonRect.x() ),
|
||||||
qMin( textRect.y(), buttonRect.y() ),
|
qMin( textRect.y(), buttonRect.y() ),
|
||||||
|
|
|
@ -158,6 +158,12 @@ QRectF QskRadioBoxSkinlet::buttonRect( const QskRadioBox* radio,
|
||||||
|
|
||||||
QRectF QskRadioBoxSkinlet::textRect( const QskRadioBox* radio,
|
QRectF QskRadioBoxSkinlet::textRect( const QskRadioBox* radio,
|
||||||
const QRectF& rect, int index ) const {
|
const QRectF& rect, int index ) const {
|
||||||
|
auto text = radio->items()[index];
|
||||||
|
|
||||||
|
if(text.isEmpty()) {
|
||||||
|
return QRectF();
|
||||||
|
}
|
||||||
|
|
||||||
QRectF result = rect;
|
QRectF result = rect;
|
||||||
auto spacing = radio->spacingHint(Q::Panel);
|
auto spacing = radio->spacingHint(Q::Panel);
|
||||||
auto lh = lineHeight( radio );
|
auto lh = lineHeight( radio );
|
||||||
|
|
Loading…
Reference in New Issue