mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-05 13:47:26 +02:00
* Removed ugly queue button for good.
This commit is contained in:
@@ -431,6 +431,7 @@ set( libUI ${libUI}
|
|||||||
widgets/infowidgets/AlbumInfoWidget.ui
|
widgets/infowidgets/AlbumInfoWidget.ui
|
||||||
playlist/topbar/topbar.ui
|
playlist/topbar/topbar.ui
|
||||||
playlist/infobar/infobar.ui
|
playlist/infobar/infobar.ui
|
||||||
|
playlist/queueview.ui
|
||||||
context/ContextWidget.ui
|
context/ContextWidget.ui
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@@ -41,8 +41,9 @@ using namespace Tomahawk;
|
|||||||
ContextWidget::ContextWidget( QWidget* parent )
|
ContextWidget::ContextWidget( QWidget* parent )
|
||||||
: QWidget( parent )
|
: QWidget( parent )
|
||||||
, ui( new Ui::ContextWidget )
|
, ui( new Ui::ContextWidget )
|
||||||
, m_minHeight( 24 )
|
, m_minHeight( 22 )
|
||||||
, m_currentView( 0 )
|
, m_currentView( 0 )
|
||||||
|
, m_visible( false )
|
||||||
{
|
{
|
||||||
ui->setupUi( this );
|
ui->setupUi( this );
|
||||||
TomahawkUtils::unmarginLayout( layout() );
|
TomahawkUtils::unmarginLayout( layout() );
|
||||||
@@ -78,10 +79,6 @@ ContextWidget::ContextWidget( QWidget* parent )
|
|||||||
|
|
||||||
ui->contextView->hide();
|
ui->contextView->hide();
|
||||||
|
|
||||||
QPalette p = palette();
|
|
||||||
p.setBrush( QPalette::Window, QColor( 0x70, 0x70, 0x70 ) );
|
|
||||||
setPalette( p );
|
|
||||||
|
|
||||||
QPalette whitePal = ui->toggleButton->palette();
|
QPalette whitePal = ui->toggleButton->palette();
|
||||||
whitePal.setColor( QPalette::Foreground, Qt::white );
|
whitePal.setColor( QPalette::Foreground, Qt::white );
|
||||||
ui->toggleButton->setPalette( whitePal );
|
ui->toggleButton->setPalette( whitePal );
|
||||||
@@ -95,6 +92,10 @@ ContextWidget::ContextWidget( QWidget* parent )
|
|||||||
setAutoFillBackground( true );
|
setAutoFillBackground( true );
|
||||||
setFixedHeight( m_minHeight );
|
setFixedHeight( m_minHeight );
|
||||||
|
|
||||||
|
QPalette pal = palette();
|
||||||
|
pal.setBrush( QPalette::Window, QColor( 0x70, 0x70, 0x70 ) );
|
||||||
|
setPalette( pal );
|
||||||
|
|
||||||
connect( ui->toggleButton, SIGNAL( clicked() ), SLOT( toggleSize() ) );
|
connect( ui->toggleButton, SIGNAL( clicked() ), SLOT( toggleSize() ) );
|
||||||
|
|
||||||
m_timeLine = new QTimeLine( ANIMATION_TIME, this );
|
m_timeLine = new QTimeLine( ANIMATION_TIME, this );
|
||||||
@@ -247,6 +248,7 @@ ContextWidget::toggleSize()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
ui->toggleButton->setText( tr( "Open Dashboard" ) );
|
ui->toggleButton->setText( tr( "Open Dashboard" ) );
|
||||||
|
m_visible = false;
|
||||||
ui->contextView->hide();
|
ui->contextView->hide();
|
||||||
|
|
||||||
m_timeLine->setFrameRange( m_minHeight, height() );
|
m_timeLine->setFrameRange( m_minHeight, height() );
|
||||||
@@ -269,6 +271,7 @@ ContextWidget::onAnimationFinished()
|
|||||||
if ( m_timeLine->direction() == QTimeLine::Forward )
|
if ( m_timeLine->direction() == QTimeLine::Forward )
|
||||||
{
|
{
|
||||||
setFixedHeight( m_maxHeight );
|
setFixedHeight( m_maxHeight );
|
||||||
|
m_visible = true;
|
||||||
ui->contextView->show();
|
ui->contextView->show();
|
||||||
|
|
||||||
fadeOut( false );
|
fadeOut( false );
|
||||||
@@ -283,11 +286,21 @@ ContextWidget::onAnimationFinished()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
ContextWidget::paintEvent( QPaintEvent* e )
|
||||||
|
{
|
||||||
|
QWidget::paintEvent( e );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ContextWidget::resizeEvent( QResizeEvent* e )
|
ContextWidget::resizeEvent( QResizeEvent* e )
|
||||||
{
|
{
|
||||||
QWidget::resizeEvent( e );
|
QWidget::resizeEvent( e );
|
||||||
|
|
||||||
m_scene->setSceneRect( ui->contextView->viewport()->rect() );
|
if ( m_visible )
|
||||||
layoutViews( false );
|
{
|
||||||
|
m_scene->setSceneRect( ui->contextView->viewport()->rect() );
|
||||||
|
layoutViews( false );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -61,6 +61,7 @@ private slots:
|
|||||||
void onAnimationFinished();
|
void onAnimationFinished();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
void paintEvent( QPaintEvent* e );
|
||||||
void resizeEvent( QResizeEvent* e );
|
void resizeEvent( QResizeEvent* e );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -81,6 +82,7 @@ private:
|
|||||||
int m_currentView;
|
int m_currentView;
|
||||||
|
|
||||||
Tomahawk::query_ptr m_query;
|
Tomahawk::query_ptr m_query;
|
||||||
|
bool m_visible;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CONTEXTWIDGET_H
|
#endif // CONTEXTWIDGET_H
|
||||||
|
@@ -38,7 +38,7 @@
|
|||||||
<string>Dashboard</string>
|
<string>Dashboard</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="alignment">
|
<property name="alignment">
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
<set>Qt::AlignCenter</set>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@@ -17,9 +17,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "queueview.h"
|
#include "queueview.h"
|
||||||
|
#include "ui_queueview.h"
|
||||||
|
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
|
||||||
|
#include "widgets/HeaderLabel.h"
|
||||||
#include "playlist/queueproxymodel.h"
|
#include "playlist/queueproxymodel.h"
|
||||||
#include "widgets/overlaywidget.h"
|
#include "widgets/overlaywidget.h"
|
||||||
#include "utils/logger.h"
|
#include "utils/logger.h"
|
||||||
@@ -29,19 +31,21 @@ using namespace Tomahawk;
|
|||||||
|
|
||||||
QueueView::QueueView( AnimatedSplitter* parent )
|
QueueView::QueueView( AnimatedSplitter* parent )
|
||||||
: AnimatedWidget( parent )
|
: AnimatedWidget( parent )
|
||||||
|
, ui( new Ui::QueueView )
|
||||||
{
|
{
|
||||||
setHiddenSize( QSize( 0, 0 ) );
|
ui->setupUi( this );
|
||||||
setLayout( new QVBoxLayout() );
|
TomahawkUtils::unmarginLayout( layout() );
|
||||||
|
setContentsMargins( 0, 0, 0, 0 );
|
||||||
|
|
||||||
m_queue = new PlaylistView( this );
|
setHiddenSize( QSize( 0, 22 ) );
|
||||||
m_queue->setProxyModel( new QueueProxyModel( this ) );
|
|
||||||
m_queue->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Ignored );
|
|
||||||
m_queue->setFrameShape( QFrame::NoFrame );
|
|
||||||
m_queue->setAttribute( Qt::WA_MacShowFocusRect, 0 );
|
|
||||||
m_queue->overlay()->setEnabled( false );
|
|
||||||
|
|
||||||
layout()->setMargin( 0 );
|
ui->queue->setProxyModel( new QueueProxyModel( this ) );
|
||||||
layout()->addWidget( m_queue );
|
ui->queue->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Ignored );
|
||||||
|
ui->queue->setFrameShape( QFrame::NoFrame );
|
||||||
|
ui->queue->setAttribute( Qt::WA_MacShowFocusRect, 0 );
|
||||||
|
ui->queue->overlay()->setEnabled( false );
|
||||||
|
|
||||||
|
connect( ui->toggleButton, SIGNAL( clicked() ), SLOT( show() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -51,10 +55,36 @@ QueueView::~QueueView()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PlaylistView*
|
||||||
|
QueueView::queue() const
|
||||||
|
{
|
||||||
|
return ui->queue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
QueueView::hide()
|
||||||
|
{
|
||||||
|
disconnect( ui->toggleButton, SIGNAL( clicked() ), this, SLOT( hide() ) );
|
||||||
|
connect( ui->toggleButton, SIGNAL( clicked() ), SLOT( show() ) );
|
||||||
|
ui->toggleButton->setText( tr( "Show Queue" ) );
|
||||||
|
emit hideWidget();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
QueueView::show()
|
||||||
|
{
|
||||||
|
disconnect( ui->toggleButton, SIGNAL( clicked() ), this, SLOT( show() ) );
|
||||||
|
connect( ui->toggleButton, SIGNAL( clicked() ), SLOT( hide() ) );
|
||||||
|
ui->toggleButton->setText( tr( "Hide Queue" ) );
|
||||||
|
emit showWidget();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
QueueView::onShown( QWidget* widget, bool animated )
|
QueueView::onShown( QWidget* widget, bool animated )
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << widget;
|
|
||||||
if ( widget != this )
|
if ( widget != this )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -65,7 +95,6 @@ QueueView::onShown( QWidget* widget, bool animated )
|
|||||||
void
|
void
|
||||||
QueueView::onHidden( QWidget* widget, bool animated )
|
QueueView::onHidden( QWidget* widget, bool animated )
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << widget;
|
|
||||||
if ( widget != this )
|
if ( widget != this )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@@ -26,6 +26,11 @@
|
|||||||
|
|
||||||
#include "dllmacro.h"
|
#include "dllmacro.h"
|
||||||
|
|
||||||
|
namespace Ui
|
||||||
|
{
|
||||||
|
class QueueView;
|
||||||
|
}
|
||||||
|
|
||||||
class DLLEXPORT QueueView : public AnimatedWidget
|
class DLLEXPORT QueueView : public AnimatedWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@@ -34,7 +39,7 @@ public:
|
|||||||
explicit QueueView( AnimatedSplitter* parent );
|
explicit QueueView( AnimatedSplitter* parent );
|
||||||
~QueueView();
|
~QueueView();
|
||||||
|
|
||||||
PlaylistView* queue() const { return m_queue; }
|
PlaylistView* queue() const;
|
||||||
|
|
||||||
QSize sizeHint() const { return QSize( 0, 200 ); }
|
QSize sizeHint() const { return QSize( 0, 200 ); }
|
||||||
|
|
||||||
@@ -42,8 +47,11 @@ public slots:
|
|||||||
virtual void onShown( QWidget*, bool animated );
|
virtual void onShown( QWidget*, bool animated );
|
||||||
virtual void onHidden( QWidget*, bool animated );
|
virtual void onHidden( QWidget*, bool animated );
|
||||||
|
|
||||||
|
virtual void show();
|
||||||
|
virtual void hide();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
PlaylistView* m_queue;
|
Ui::QueueView* ui;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // QUEUEVIEW_H
|
#endif // QUEUEVIEW_H
|
||||||
|
@@ -151,7 +151,7 @@ AnimatedWidget::AnimatedWidget( AnimatedSplitter* parent )
|
|||||||
{
|
{
|
||||||
m_timeLine = new QTimeLine( ANIMATION_TIME, this );
|
m_timeLine = new QTimeLine( ANIMATION_TIME, this );
|
||||||
m_timeLine->setUpdateInterval( 20 );
|
m_timeLine->setUpdateInterval( 20 );
|
||||||
m_timeLine->setEasingCurve( QEasingCurve::OutBack );
|
m_timeLine->setEasingCurve( QEasingCurve::OutCubic );
|
||||||
|
|
||||||
connect( m_timeLine, SIGNAL( frameChanged( int ) ), SLOT( onAnimationStep( int ) ) );
|
connect( m_timeLine, SIGNAL( frameChanged( int ) ), SLOT( onAnimationStep( int ) ) );
|
||||||
connect( m_timeLine, SIGNAL( finished() ), SLOT( onAnimationFinished() ) );
|
connect( m_timeLine, SIGNAL( finished() ), SLOT( onAnimationFinished() ) );
|
||||||
|
@@ -200,16 +200,6 @@ TomahawkWindow::setupSideBar()
|
|||||||
TransferView* transferView = new TransferView( m_sidebar );
|
TransferView* transferView = new TransferView( m_sidebar );
|
||||||
PipelineStatusView* pipelineView = new PipelineStatusView( m_sidebar );
|
PipelineStatusView* pipelineView = new PipelineStatusView( m_sidebar );
|
||||||
|
|
||||||
m_queueButton = new QPushButton();
|
|
||||||
m_queueButton->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed );
|
|
||||||
m_queueButton->setText( tr( "Click to show queue" ) );
|
|
||||||
#ifdef Q_OS_MAC
|
|
||||||
// QPushButtons on mac have lots of weird layouting issues. Fix them by forcing the widget rect for layout calculations
|
|
||||||
m_queueButton->setAttribute( Qt::WA_LayoutUsesWidgetRect );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
connect( m_queueButton, SIGNAL( clicked() ), SLOT( showQueue() ) );
|
|
||||||
|
|
||||||
m_queueView = new QueueView( m_sidebar );
|
m_queueView = new QueueView( m_sidebar );
|
||||||
m_queueModel = new PlaylistModel( m_queueView );
|
m_queueModel = new PlaylistModel( m_queueView );
|
||||||
m_queueModel->setStyle( PlaylistModel::Short );
|
m_queueModel->setStyle( PlaylistModel::Short );
|
||||||
@@ -230,7 +220,6 @@ TomahawkWindow::setupSideBar()
|
|||||||
m_sidebar->hide( 4, false );
|
m_sidebar->hide( 4, false );
|
||||||
|
|
||||||
sidebarWidget->layout()->addWidget( m_sidebar );
|
sidebarWidget->layout()->addWidget( m_sidebar );
|
||||||
sidebarWidget->layout()->addWidget( m_queueButton );
|
|
||||||
sidebarWidget->setContentsMargins( 0, 0, 0, 0 );
|
sidebarWidget->setContentsMargins( 0, 0, 0, 0 );
|
||||||
sidebarWidget->layout()->setContentsMargins( 0, 0, 0, 0 );
|
sidebarWidget->layout()->setContentsMargins( 0, 0, 0, 0 );
|
||||||
sidebarWidget->layout()->setMargin( 0 );
|
sidebarWidget->layout()->setMargin( 0 );
|
||||||
@@ -699,11 +688,7 @@ TomahawkWindow::showQueue()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_queueButton->setText( tr( "Click to hide queue" ) );
|
m_queueView->show();
|
||||||
disconnect( m_queueButton, SIGNAL( clicked() ), this, SLOT( showQueue() ) );
|
|
||||||
connect( m_queueButton, SIGNAL( clicked() ), SLOT( hideQueue() ) );
|
|
||||||
|
|
||||||
m_sidebar->show( 4 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -717,11 +702,7 @@ TomahawkWindow::hideQueue()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_queueButton->setText( tr( "Click to show queue" ) );
|
m_queueView->hide();
|
||||||
disconnect( m_queueButton, SIGNAL( clicked() ), this, SLOT( hideQueue() ) );
|
|
||||||
connect( m_queueButton, SIGNAL( clicked() ), SLOT( showQueue() ) );
|
|
||||||
|
|
||||||
m_sidebar->hide( 4 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user