mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-24 09:49:42 +01:00
Show the SocialWidget in the same place relative to the social button.
This commit is contained in:
parent
72d486ccbb
commit
bb0425e834
@ -656,7 +656,10 @@ AudioControls::onSocialButtonClicked()
|
||||
m_socialWidget.data()->close();
|
||||
|
||||
m_socialWidget = new SocialWidget( m_parent );
|
||||
m_socialWidget.data()->setPosition( m_socialWidget.data()->mapFromGlobal( QCursor::pos() ) );
|
||||
QPoint socialWidgetPos = ui->socialButton->pos();
|
||||
socialWidgetPos.rx() += ui->socialButton->width() / 2;
|
||||
socialWidgetPos.ry() += 6;
|
||||
m_socialWidget.data()->setPosition( m_socialWidget.data()->mapFromGlobal( ui->socialButton->parentWidget()->mapToGlobal( socialWidgetPos ) ) );
|
||||
m_socialWidget.data()->setQuery( m_currentTrack->toQuery() );
|
||||
m_socialWidget.data()->show();
|
||||
}
|
||||
|
@ -243,7 +243,7 @@ SocialWidget::onGeometryUpdate()
|
||||
m_parentRect = m_parent->rect();
|
||||
|
||||
QPoint position( m_position - QPoint( size().width(), size().height() )
|
||||
+ QPoint( ARROW_HEIGHT * 3, -ARROW_HEIGHT/2 ) );
|
||||
+ QPoint( 2 + ARROW_HEIGHT * 3, 0 ) );
|
||||
if ( position != pos() )
|
||||
{
|
||||
move( position );
|
||||
|
Loading…
x
Reference in New Issue
Block a user