Skip to content

Commit

Permalink
Readd a header widget to station view.
Browse files Browse the repository at this point in the history
  • Loading branch information
muesli committed Oct 17, 2014
1 parent cac806a commit 2f28d4e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/libtomahawk/playlist/dynamic/widgets/DynamicWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "ViewManager.h"
#include "playlist/dynamic/DynamicView.h"
#include "DynamicSetupWidget.h"
#include "widgets/BasicHeader.h"
#include "utils/AnimatedSpinner.h"
#include "utils/TomahawkUtilsGui.h"
#include "utils/Logger.h"
Expand Down Expand Up @@ -64,6 +65,9 @@ DynamicWidget::DynamicWidget( const Tomahawk::dynplaylist_ptr& playlist, QWidget
, m_view( 0 )
, m_model()
{
m_header = new BasicHeader;
m_layout->addWidget( m_header );

m_controls = new CollapsibleControls( this );
m_layout->addWidget( m_controls );
setContentsMargins( 0, 0, 0, 1 ); // to align the bottom with the bottom of the sourcelist
Expand Down Expand Up @@ -163,7 +167,7 @@ DynamicWidget::loadDynamicPlaylist( const Tomahawk::dynplaylist_ptr& playlist )
m_model->loadPlaylist( m_playlist );
m_controlsChanged = false;
m_setup->setPlaylist( m_playlist );

m_header->setCaption( m_playlist->title() );

if ( !m_playlist->author()->isLocal() ) // hide controls, as we show the description in the summary
m_layout->removeWidget( m_controls );
Expand Down Expand Up @@ -551,5 +555,8 @@ DynamicWidget::onChanged()
{
if ( !m_playlist.isNull() &&
ViewManager::instance()->currentPage() == this )
emit nameChanged( m_playlist->title() );
{
m_header->setCaption( m_playlist->title() );
emit nameChanged( m_playlist->title() );
}
}
2 changes: 2 additions & 0 deletions src/libtomahawk/playlist/dynamic/widgets/DynamicWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "playlist/dynamic/DynamicPlaylistRevision.h"

class AnimatedSpinner;
class BasicHeader;
class QShowEvent;
class QHideEvent;
class QVBoxLayout;
Expand Down Expand Up @@ -121,6 +122,7 @@ private slots:
bool m_controlsChanged;
QWidget* m_steering;

BasicHeader* m_header;
CollapsibleControls* m_controls;

DynamicView* m_view;
Expand Down

0 comments on commit 2f28d4e

Please sign in to comment.