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