From 111de470237ec925a4afb80c44ed73c071703a11 Mon Sep 17 00:00:00 2001 From: Leo Franchi Date: Thu, 26 Jul 2012 17:27:55 -0400 Subject: [PATCH] Fix vertical positioning --- src/libtomahawk/widgets/SourceTreePopupDialog.cpp | 11 +++++++---- src/libtomahawk/widgets/SourceTreePopupDialog.h | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/libtomahawk/widgets/SourceTreePopupDialog.cpp b/src/libtomahawk/widgets/SourceTreePopupDialog.cpp index 062171a72..7427d1559 100644 --- a/src/libtomahawk/widgets/SourceTreePopupDialog.cpp +++ b/src/libtomahawk/widgets/SourceTreePopupDialog.cpp @@ -58,6 +58,7 @@ SourceTreePopupDialog::SourceTreePopupDialog( SourceTreeView* parent ) layout()->addWidget( m_label ); layout()->addWidget( m_buttons ); + /* m_buttons->button( QDialogButtonBox::Ok )->setStyleSheet( "QPushButton { \ @@ -105,8 +106,8 @@ SourceTreePopupDialog::paintEvent( QPaintEvent* event ) QPainterPath outline; // Left triangle top branch - outline.moveTo( brect.left(), brect.height() / 2 ); - outline.lineTo( leftEdgeOffset, brect.height() / 2 - leftTriangleWidth / 2 ); + outline.moveTo( brect.left(), brect.top() + brect.height() / 2 ); + outline.lineTo( leftEdgeOffset, brect.top() + brect.height() / 2 - leftTriangleWidth / 2 ); // main outline outline.lineTo( leftEdgeOffset, cornerRounding ); @@ -119,10 +120,11 @@ SourceTreePopupDialog::paintEvent( QPaintEvent* event ) outline.quadTo( QPoint( leftEdgeOffset, brect.height() ), QPoint( leftEdgeOffset, brect.height() - cornerRounding ) ); // Left triangle bottom branch - outline.lineTo( leftEdgeOffset, brect.height() / 2 + leftTriangleWidth / 2 ); - outline.lineTo( brect.left(), brect.height() / 2 ); + outline.lineTo( leftEdgeOffset, brect.top() + brect.height() / 2 + leftTriangleWidth / 2 ); + outline.lineTo( brect.left(), brect.top() + brect.height() / 2 ); QPainter p( this ); + p.setRenderHint( QPainter::Antialiasing ); QPen pen( QColor( "#3F4247" ) ); @@ -130,6 +132,7 @@ SourceTreePopupDialog::paintEvent( QPaintEvent* event ) p.setPen( pen ); p.drawPath( outline ); + p.setOpacity( 0.93 ); p.fillPath( outline, QColor( "#D6E3F1" ) ); #ifdef QT_MAC_USE_COCOA diff --git a/src/libtomahawk/widgets/SourceTreePopupDialog.h b/src/libtomahawk/widgets/SourceTreePopupDialog.h index f181dfe2a..ac03139b6 100644 --- a/src/libtomahawk/widgets/SourceTreePopupDialog.h +++ b/src/libtomahawk/widgets/SourceTreePopupDialog.h @@ -39,7 +39,7 @@ class DLLEXPORT SourceTreePopupDialog : public QWidget public: explicit SourceTreePopupDialog( SourceTreeView* parent ); - int offset() const { return 14; } + int offset() const { return 16; } void setMainText( const QString& text ); void setOkButtonText( const QString& text );