using subControlRect
This commit is contained in:
parent
0a0acb5e27
commit
6f4a0045d5
@ -64,7 +64,7 @@ public Q_SLOTS:
|
||||
void setText( const QString& text );
|
||||
void setGraphicSource( const QUrl& url );
|
||||
void setGraphic( const QskGraphic& );
|
||||
|
||||
|
||||
Q_SIGNALS:
|
||||
void cornerChanged();
|
||||
void borderWidthChanged();
|
||||
|
@ -70,12 +70,14 @@ QSGNode* QskPushButtonSkinlet::updateSubNode(
|
||||
QRectF QskPushButtonSkinlet::textRect( const QskPushButton* button ) const
|
||||
{
|
||||
// buttonShift -> TODO
|
||||
QRectF r = button->innerBox( QskPushButton::Panel, button->contentsRect() );
|
||||
|
||||
QRectF r = button->innerBox( QskPushButton::Panel,
|
||||
subControlRect( button, QskPushButton::Panel ) );
|
||||
|
||||
if ( button->hasGraphic() )
|
||||
{
|
||||
// in case of having text + graphic we put the text at the bottom
|
||||
|
||||
|
||||
qreal h = QFontMetrics( button->effectiveFont( QskPushButton::Text ) ).height();
|
||||
if ( h < r.height() )
|
||||
r.setTop( r.bottom() - h );
|
||||
|
Loading…
x
Reference in New Issue
Block a user