1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-31 06:02:27 +02:00

Move menu with the toolbutton if the button's position changes.

This commit is contained in:
Teo Mrnjavac 2012-08-15 18:45:28 +02:00
parent 0542f4f63f
commit 87b7f90ae1
2 changed files with 14 additions and 0 deletions

View File

@ -149,6 +149,19 @@ AccountsToolButton::paintEvent( QPaintEvent* event )
painter.end();
}
void
AccountsToolButton::moveEvent( QMoveEvent* event )
{
if ( m_popup )
{
if ( isDown() )
{
QPoint myPos = mapToGlobal( rect().bottomRight() );
m_popup->anchorAt( myPos );
}
}
}
void
AccountsToolButton::popupHidden() //SLOT
{

View File

@ -42,6 +42,7 @@ signals:
protected:
void mousePressEvent( QMouseEvent* event );
void paintEvent( QPaintEvent* event );
void moveEvent( QMoveEvent* event );
private slots:
void popupHidden();