mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 06:07:37 +02:00
Fix vertical positioning
This commit is contained in:
@@ -58,6 +58,7 @@ SourceTreePopupDialog::SourceTreePopupDialog( SourceTreeView* parent )
|
|||||||
|
|
||||||
layout()->addWidget( m_label );
|
layout()->addWidget( m_label );
|
||||||
layout()->addWidget( m_buttons );
|
layout()->addWidget( m_buttons );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
m_buttons->button( QDialogButtonBox::Ok )->setStyleSheet(
|
m_buttons->button( QDialogButtonBox::Ok )->setStyleSheet(
|
||||||
"QPushButton { \
|
"QPushButton { \
|
||||||
@@ -105,8 +106,8 @@ SourceTreePopupDialog::paintEvent( QPaintEvent* event )
|
|||||||
|
|
||||||
QPainterPath outline;
|
QPainterPath outline;
|
||||||
// Left triangle top branch
|
// Left triangle top branch
|
||||||
outline.moveTo( brect.left(), brect.height() / 2 );
|
outline.moveTo( brect.left(), brect.top() + brect.height() / 2 );
|
||||||
outline.lineTo( leftEdgeOffset, brect.height() / 2 - leftTriangleWidth / 2 );
|
outline.lineTo( leftEdgeOffset, brect.top() + brect.height() / 2 - leftTriangleWidth / 2 );
|
||||||
|
|
||||||
// main outline
|
// main outline
|
||||||
outline.lineTo( leftEdgeOffset, cornerRounding );
|
outline.lineTo( leftEdgeOffset, cornerRounding );
|
||||||
@@ -119,10 +120,11 @@ SourceTreePopupDialog::paintEvent( QPaintEvent* event )
|
|||||||
outline.quadTo( QPoint( leftEdgeOffset, brect.height() ), QPoint( leftEdgeOffset, brect.height() - cornerRounding ) );
|
outline.quadTo( QPoint( leftEdgeOffset, brect.height() ), QPoint( leftEdgeOffset, brect.height() - cornerRounding ) );
|
||||||
|
|
||||||
// Left triangle bottom branch
|
// Left triangle bottom branch
|
||||||
outline.lineTo( leftEdgeOffset, brect.height() / 2 + leftTriangleWidth / 2 );
|
outline.lineTo( leftEdgeOffset, brect.top() + brect.height() / 2 + leftTriangleWidth / 2 );
|
||||||
outline.lineTo( brect.left(), brect.height() / 2 );
|
outline.lineTo( brect.left(), brect.top() + brect.height() / 2 );
|
||||||
|
|
||||||
QPainter p( this );
|
QPainter p( this );
|
||||||
|
|
||||||
p.setRenderHint( QPainter::Antialiasing );
|
p.setRenderHint( QPainter::Antialiasing );
|
||||||
|
|
||||||
QPen pen( QColor( "#3F4247" ) );
|
QPen pen( QColor( "#3F4247" ) );
|
||||||
@@ -130,6 +132,7 @@ SourceTreePopupDialog::paintEvent( QPaintEvent* event )
|
|||||||
p.setPen( pen );
|
p.setPen( pen );
|
||||||
p.drawPath( outline );
|
p.drawPath( outline );
|
||||||
|
|
||||||
|
p.setOpacity( 0.93 );
|
||||||
p.fillPath( outline, QColor( "#D6E3F1" ) );
|
p.fillPath( outline, QColor( "#D6E3F1" ) );
|
||||||
|
|
||||||
#ifdef QT_MAC_USE_COCOA
|
#ifdef QT_MAC_USE_COCOA
|
||||||
|
@@ -39,7 +39,7 @@ class DLLEXPORT SourceTreePopupDialog : public QWidget
|
|||||||
public:
|
public:
|
||||||
explicit SourceTreePopupDialog( SourceTreeView* parent );
|
explicit SourceTreePopupDialog( SourceTreeView* parent );
|
||||||
|
|
||||||
int offset() const { return 14; }
|
int offset() const { return 16; }
|
||||||
|
|
||||||
void setMainText( const QString& text );
|
void setMainText( const QString& text );
|
||||||
void setOkButtonText( const QString& text );
|
void setOkButtonText( const QString& text );
|
||||||
|
Reference in New Issue
Block a user