From 45d999c8d658d314cf88f98dd5f03204063a16a0 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Wed, 12 Jun 2013 12:58:49 +0200 Subject: [PATCH] * Draw divider below BasicHeader. --- src/libtomahawk/playlist/FlexibleTreeView.cpp | 10 ------- src/libtomahawk/playlist/FlexibleView.cpp | 10 ------- src/libtomahawk/widgets/BasicHeader.cpp | 26 +++++++++++++++---- 3 files changed, 21 insertions(+), 25 deletions(-) diff --git a/src/libtomahawk/playlist/FlexibleTreeView.cpp b/src/libtomahawk/playlist/FlexibleTreeView.cpp index f5e32a3de..58163ea4f 100644 --- a/src/libtomahawk/playlist/FlexibleTreeView.cpp +++ b/src/libtomahawk/playlist/FlexibleTreeView.cpp @@ -69,14 +69,6 @@ FlexibleTreeView::FlexibleTreeView( QWidget* parent, QWidget* extraHeader ) setLayout( new QVBoxLayout() ); TomahawkUtils::unmarginLayout( layout() ); - QFrame* lineAbove = new QFrame( this ); - lineAbove->setStyleSheet( QString( "QFrame { border: 1px solid %1; }" ).arg( TomahawkStyle::HEADER_UPPER.name() ) ); - lineAbove->setFrameShape( QFrame::HLine ); - lineAbove->setMaximumHeight( 1 ); - QFrame* lineAbove2 = new QFrame( this ); - lineAbove2->setStyleSheet( QString( "QFrame { border: 1px solid black; }" ) ); - lineAbove2->setFrameShape( QFrame::HLine ); - lineAbove2->setMaximumHeight( 1 ); QFrame* lineBelow = new QFrame( this ); lineBelow->setStyleSheet( QString( "QFrame { border: 1px solid %1; }" ).arg( TomahawkStyle::HEADER_UPPER.name() ) ); lineBelow->setFrameShape( QFrame::HLine ); @@ -87,8 +79,6 @@ FlexibleTreeView::FlexibleTreeView( QWidget* parent, QWidget* extraHeader ) lineBelow2->setMaximumHeight( 1 ); layout()->addWidget( m_header ); - layout()->addWidget( lineAbove ); - layout()->addWidget( lineAbove2 ); layout()->addWidget( m_modeHeader ); if ( extraHeader ) layout()->addWidget( extraHeader ); diff --git a/src/libtomahawk/playlist/FlexibleView.cpp b/src/libtomahawk/playlist/FlexibleView.cpp index ad91c5d96..0be8861bd 100644 --- a/src/libtomahawk/playlist/FlexibleView.cpp +++ b/src/libtomahawk/playlist/FlexibleView.cpp @@ -66,14 +66,6 @@ FlexibleView::FlexibleView( QWidget* parent, QWidget* extraHeader ) setLayout( new QVBoxLayout() ); TomahawkUtils::unmarginLayout( layout() ); - QFrame* lineAbove = new QFrame( this ); - lineAbove->setStyleSheet( QString( "QFrame { border: 1px solid %1; }" ).arg( TomahawkStyle::HEADER_UPPER.name() ) ); - lineAbove->setFrameShape( QFrame::HLine ); - lineAbove->setMaximumHeight( 1 ); - QFrame* lineAbove2 = new QFrame( this ); - lineAbove2->setStyleSheet( QString( "QFrame { border: 1px solid black; }" ) ); - lineAbove2->setFrameShape( QFrame::HLine ); - lineAbove2->setMaximumHeight( 1 ); QFrame* lineBelow = new QFrame( this ); lineBelow->setStyleSheet( QString( "QFrame { border: 1px solid %1; }" ).arg( TomahawkStyle::HEADER_UPPER.name() ) ); lineBelow->setFrameShape( QFrame::HLine ); @@ -84,8 +76,6 @@ FlexibleView::FlexibleView( QWidget* parent, QWidget* extraHeader ) lineBelow2->setMaximumHeight( 1 ); layout()->addWidget( m_header ); - layout()->addWidget( lineAbove ); - layout()->addWidget( lineAbove2 ); layout()->addWidget( m_modeHeader ); if ( extraHeader ) layout()->addWidget( extraHeader ); diff --git a/src/libtomahawk/widgets/BasicHeader.cpp b/src/libtomahawk/widgets/BasicHeader.cpp index 00933f5f3..3868306d3 100644 --- a/src/libtomahawk/widgets/BasicHeader.cpp +++ b/src/libtomahawk/widgets/BasicHeader.cpp @@ -36,8 +36,11 @@ using namespace Tomahawk; BasicHeader::BasicHeader( QWidget* parent ) : QWidget( parent ) { + QLayout* l = new QVBoxLayout; + TomahawkUtils::unmarginLayout( l ); + setLayout( l ); + m_mainLayout = new QHBoxLayout; - setLayout( m_mainLayout ); m_imageLabel = new QLabel( this ); m_imageLabel->setFixedSize( 48, 48 ); @@ -58,7 +61,7 @@ BasicHeader::BasicHeader( QWidget* parent ) QPalette pal = palette(); pal.setColor( QPalette::Foreground, Qt::white ); - pal.setBrush( backgroundRole(), TomahawkStyle::PAGE_BACKGROUND ); + pal.setBrush( backgroundRole(), TomahawkStyle::HEADER_LOWER ); m_captionLabel->setPalette( pal ); m_descriptionLabel->setPalette( pal ); @@ -86,10 +89,23 @@ BasicHeader::BasicHeader( QWidget* parent ) m_captionLabel->setGraphicsEffect( effect );*/ // m_descriptionLabel->setGraphicsEffect( effect ); - TomahawkUtils::unmarginLayout( layout() ); - layout()->setContentsMargins( 8, 4, 8, 4 ); + QFrame* lineAbove = new QFrame( this ); + lineAbove->setStyleSheet( QString( "QFrame { border: 1px solid %1; }" ).arg( TomahawkStyle::HEADER_UPPER.name() ) ); + lineAbove->setFrameShape( QFrame::HLine ); + lineAbove->setMaximumHeight( 1 ); + QFrame* lineAbove2 = new QFrame( this ); + lineAbove2->setStyleSheet( QString( "QFrame { border: 1px solid black; }" ) ); + lineAbove2->setFrameShape( QFrame::HLine ); + lineAbove2->setMaximumHeight( 1 ); + + l->addItem( m_mainLayout ); + l->addWidget( lineAbove ); + l->addWidget( lineAbove2 ); + + TomahawkUtils::unmarginLayout( m_mainLayout ); + m_mainLayout->setContentsMargins( 8, 4, 8, 4 ); setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); - setFixedHeight( 56 ); + setFixedHeight( 58 ); setAutoFillBackground( true ); setPalette( pal );