Skip to content

Commit 2f28d4e

Browse files
committed
Readd a header widget to station view.
1 parent cac806a commit 2f28d4e

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/libtomahawk/playlist/dynamic/widgets/DynamicWidget.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include "ViewManager.h"
3535
#include "playlist/dynamic/DynamicView.h"
3636
#include "DynamicSetupWidget.h"
37+
#include "widgets/BasicHeader.h"
3738
#include "utils/AnimatedSpinner.h"
3839
#include "utils/TomahawkUtilsGui.h"
3940
#include "utils/Logger.h"
@@ -64,6 +65,9 @@ DynamicWidget::DynamicWidget( const Tomahawk::dynplaylist_ptr& playlist, QWidget
6465
, m_view( 0 )
6566
, m_model()
6667
{
68+
m_header = new BasicHeader;
69+
m_layout->addWidget( m_header );
70+
6771
m_controls = new CollapsibleControls( this );
6872
m_layout->addWidget( m_controls );
6973
setContentsMargins( 0, 0, 0, 1 ); // to align the bottom with the bottom of the sourcelist
@@ -163,7 +167,7 @@ DynamicWidget::loadDynamicPlaylist( const Tomahawk::dynplaylist_ptr& playlist )
163167
m_model->loadPlaylist( m_playlist );
164168
m_controlsChanged = false;
165169
m_setup->setPlaylist( m_playlist );
166-
170+
m_header->setCaption( m_playlist->title() );
167171

168172
if ( !m_playlist->author()->isLocal() ) // hide controls, as we show the description in the summary
169173
m_layout->removeWidget( m_controls );
@@ -551,5 +555,8 @@ DynamicWidget::onChanged()
551555
{
552556
if ( !m_playlist.isNull() &&
553557
ViewManager::instance()->currentPage() == this )
554-
emit nameChanged( m_playlist->title() );
558+
{
559+
m_header->setCaption( m_playlist->title() );
560+
emit nameChanged( m_playlist->title() );
561+
}
555562
}

src/libtomahawk/playlist/dynamic/widgets/DynamicWidget.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "playlist/dynamic/DynamicPlaylistRevision.h"
2828

2929
class AnimatedSpinner;
30+
class BasicHeader;
3031
class QShowEvent;
3132
class QHideEvent;
3233
class QVBoxLayout;
@@ -121,6 +122,7 @@ private slots:
121122
bool m_controlsChanged;
122123
QWidget* m_steering;
123124

125+
BasicHeader* m_header;
124126
CollapsibleControls* m_controls;
125127

126128
DynamicView* m_view;

0 commit comments

Comments
 (0)