1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-25 02:09:48 +01:00

* Show / hide the empty-tooltip when sliding.

This commit is contained in:
Christian Muehlhaeuser 2012-06-01 07:46:59 +02:00
parent 83e073fc7c
commit 1da5ea8ae7
2 changed files with 15 additions and 2 deletions

View File

@ -27,6 +27,7 @@
#include "PlaylistView.h"
#include "Source.h"
#include "utils/TomahawkUtilsGui.h"
#include "widgets/OverlayWidget.h"
using namespace Tomahawk;
@ -42,18 +43,20 @@ QueueView::QueueView( AnimatedSplitter* parent )
setHiddenSize( QSize( 0, 22 ) );
ui->queue->setEmptyTip( tr( "The queue is currently empty. Drop something to enqueue it!" ) );
ui->queue->setProxyModel( new QueueProxyModel( ui->queue ) );
ui->queue->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Ignored );
PlaylistModel* queueModel = new PlaylistModel( this );
queueModel->setStyle( PlaylistModel::Short );
queueModel->finishLoading();
ui->queue->setPlaylistModel( queueModel );
queueModel->setReadOnly( false );
queueModel->finishLoading();
ui->queue->setEmptyTip( tr( "The queue is currently empty. Drop something to enqueue it!" ) );
connect( queueModel, SIGNAL( trackCountChanged( unsigned int ) ), SLOT( updateLabel() ) );
connect( ui->toggleButton, SIGNAL( clicked() ), SLOT( show() ) );
connect( this, SIGNAL( animationFinished() ), SLOT( onAnimationFinished() ) );
ui->toggleButton->installEventFilter( this );
ui->toggleButton->setCursor( Qt::PointingHandCursor );
@ -125,6 +128,7 @@ QueueView::hide()
connect( ui->toggleButton, SIGNAL( clicked() ), SLOT( show() ) );
disconnect( ui->toggleButton, SIGNAL( resized( QPoint ) ), this, SIGNAL( resizeBy( QPoint ) ) );
ui->queue->overlay()->setVisible( false );
AnimatedWidget::hide();
updateLabel();
}
@ -137,6 +141,7 @@ QueueView::show()
connect( ui->toggleButton, SIGNAL( clicked() ), SLOT( hide() ) );
connect( ui->toggleButton, SIGNAL( resized( QPoint ) ), SIGNAL( resizeBy( QPoint ) ) );
ui->queue->overlay()->setVisible( false );
AnimatedWidget::show();
updateLabel();
}
@ -162,6 +167,13 @@ QueueView::onHidden( QWidget* widget, bool animated )
}
void
QueueView::onAnimationFinished()
{
ui->queue->overlay()->setVisible( true );
}
void
QueueView::updateLabel()
{

View File

@ -59,6 +59,7 @@ protected:
private slots:
void updateLabel();
void onAnimationFinished();
private:
Ui::QueueView* ui;