mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 14:16:32 +02:00
* Smaller default size for OverlayWidget.
* Disabled OverlayWidget for QueueView.
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
|
||||||
#include "playlist/queueproxymodel.h"
|
#include "playlist/queueproxymodel.h"
|
||||||
|
#include "widgets/overlaywidget.h"
|
||||||
|
|
||||||
#ifdef Q_WS_MAC
|
#ifdef Q_WS_MAC
|
||||||
#define MINIMUM_HEIGHT 38
|
#define MINIMUM_HEIGHT 38
|
||||||
@@ -25,6 +26,7 @@ QueueView::QueueView( AnimatedSplitter* parent )
|
|||||||
m_queue->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Ignored );
|
m_queue->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Ignored );
|
||||||
m_queue->setFrameShape( QFrame::NoFrame );
|
m_queue->setFrameShape( QFrame::NoFrame );
|
||||||
m_queue->setAttribute( Qt::WA_MacShowFocusRect, 0 );
|
m_queue->setAttribute( Qt::WA_MacShowFocusRect, 0 );
|
||||||
|
m_queue->overlay()->setEnabled( false );
|
||||||
|
|
||||||
m_button = new QPushButton();
|
m_button = new QPushButton();
|
||||||
m_button->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed );
|
m_button->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed );
|
||||||
|
@@ -15,7 +15,7 @@ OverlayWidget::OverlayWidget( QWidget* parent )
|
|||||||
, m_opacity( 0.00 )
|
, m_opacity( 0.00 )
|
||||||
, m_parent( parent )
|
, m_parent( parent )
|
||||||
{
|
{
|
||||||
resize( 380, 220 );
|
resize( 380, 128 );
|
||||||
setAttribute( Qt::WA_TranslucentBackground, true );
|
setAttribute( Qt::WA_TranslucentBackground, true );
|
||||||
|
|
||||||
setOpacity( m_opacity );
|
setOpacity( m_opacity );
|
||||||
@@ -58,6 +58,9 @@ OverlayWidget::setText( const QString& text )
|
|||||||
void
|
void
|
||||||
OverlayWidget::show( int timeoutSecs )
|
OverlayWidget::show( int timeoutSecs )
|
||||||
{
|
{
|
||||||
|
if ( !isEnabled() )
|
||||||
|
return;
|
||||||
|
|
||||||
QPropertyAnimation* animation = new QPropertyAnimation( this, "opacity" );
|
QPropertyAnimation* animation = new QPropertyAnimation( this, "opacity" );
|
||||||
animation->setDuration( FADING_DURATION );
|
animation->setDuration( FADING_DURATION );
|
||||||
animation->setStartValue( 0.00 );
|
animation->setStartValue( 0.00 );
|
||||||
@@ -72,20 +75,26 @@ OverlayWidget::show( int timeoutSecs )
|
|||||||
void
|
void
|
||||||
OverlayWidget::hide()
|
OverlayWidget::hide()
|
||||||
{
|
{
|
||||||
|
if ( !isEnabled() )
|
||||||
|
return;
|
||||||
|
|
||||||
QPropertyAnimation* animation = new QPropertyAnimation( this, "opacity" );
|
QPropertyAnimation* animation = new QPropertyAnimation( this, "opacity" );
|
||||||
animation->setDuration( FADING_DURATION );
|
animation->setDuration( FADING_DURATION );
|
||||||
animation->setEndValue( 0.00 );
|
animation->setEndValue( 0.00 );
|
||||||
animation->start();
|
animation->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
OverlayWidget::shown() const
|
OverlayWidget::shown() const
|
||||||
{
|
{
|
||||||
|
if ( !isEnabled() )
|
||||||
|
return false;
|
||||||
|
|
||||||
return m_opacity == OPACITY;
|
return m_opacity == OPACITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
OverlayWidget::paintEvent( QPaintEvent* event )
|
OverlayWidget::paintEvent( QPaintEvent* event )
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user