diff --git a/src/SocialWidget.cpp b/src/SocialWidget.cpp index f2fe6e9fd..5b5cf7001 100644 --- a/src/SocialWidget.cpp +++ b/src/SocialWidget.cpp @@ -251,7 +251,7 @@ SocialWidget::onGeometryUpdate() QPoint position( m_position - QPoint( size().width(), size().height() ) + QPoint( 2 + ARROW_HEIGHT * 3, 0 ) ); #ifdef Q_OS_WIN - position.ry() -= 2 * ARROW_HEIGHT; + position.ry() -= 12 + ARROW_HEIGHT; #endif if ( position != pos() ) { diff --git a/src/libtomahawk/widgets/SourceTreePopupDialog.cpp b/src/libtomahawk/widgets/SourceTreePopupDialog.cpp index 3ee74de6b..3a9cb9fe2 100644 --- a/src/libtomahawk/widgets/SourceTreePopupDialog.cpp +++ b/src/libtomahawk/widgets/SourceTreePopupDialog.cpp @@ -21,6 +21,7 @@ #include "utils/TomahawkUtilsGui.h" +#include #include #include #include @@ -44,6 +45,9 @@ SourceTreePopupDialog::SourceTreePopupDialog() , m_label( 0 ) , m_buttons( 0 ) { +#ifndef ENABLE_HEADLESS + setParent( QApplication::activeWindow() ); +#endif #ifndef Q_OS_WIN setWindowFlags( Qt::FramelessWindowHint ); setWindowFlags( Qt::Popup ); @@ -54,7 +58,6 @@ SourceTreePopupDialog::SourceTreePopupDialog() //setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ); - m_title = new QLabel( this ); QFont titleFont = m_title->font(); titleFont.setBold( true ); @@ -114,6 +117,7 @@ SourceTreePopupDialog::SourceTreePopupDialog() background-color: #D35052; \ border-style: flat; \ }" );*/ + setFixedHeight( 80 ); } void @@ -137,6 +141,8 @@ void SourceTreePopupDialog::setMainText( const QString& text ) { m_label->setText( text ); + QFontMetrics fm = m_label->fontMetrics(); + setFixedWidth( fm.width( text ) + 20 ); } @@ -153,6 +159,7 @@ SourceTreePopupDialog::setExtraQuestions( const Tomahawk::PlaylistDeleteQuestion { m_questions = questions; + int baseHeight = 80; int idx = m_layout->indexOf( m_label ) + 1; foreach ( const Tomahawk::PlaylistDeleteQuestion& question, m_questions ) { @@ -168,7 +175,9 @@ SourceTreePopupDialog::setExtraQuestions( const Tomahawk::PlaylistDeleteQuestion m_questionCheckboxes << cb; idx++; + baseHeight += cb->height() + m_layout->spacing(); } + setFixedHeight( baseHeight ); } diff --git a/src/sourcetree/SourceTreeView.cpp b/src/sourcetree/SourceTreeView.cpp index 61cf7ed42..8708ab222 100644 --- a/src/sourcetree/SourceTreeView.cpp +++ b/src/sourcetree/SourceTreeView.cpp @@ -372,8 +372,11 @@ SourceTreeView::deletePlaylist( const QModelIndex& idxIn ) PlaylistItem* item = itemFromIndex< PlaylistItem >( idx ); playlist_ptr playlist = item->playlist(); + QPoint rightCenter = viewport()->mapToGlobal( visualRect( idx ).topRight() + QPoint( 0, visualRect( idx ).height() / 2 ) ); +#ifdef Q_OS_WIN + rightCenter = QApplication::activeWindow()->mapFromGlobal( rightCenter ); +#endif - const QPoint rightCenter = viewport()->mapToGlobal( visualRect( idx ).topRight() + QPoint( 0, visualRect( idx ).height() / 2 ) ); if ( playlist->hasCustomDeleter() ) { playlist->customDelete( rightCenter );