1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-04-14 04:51:53 +02:00

* Smaller default size for OverlayWidget.

* Disabled OverlayWidget for QueueView.
This commit is contained in:
Christian Muehlhaeuser 2011-02-15 08:51:42 +01:00
parent 795d71213e
commit f7f1a26758
2 changed files with 14 additions and 3 deletions

View File

@ -4,6 +4,7 @@
#include <QVBoxLayout>
#include "playlist/queueproxymodel.h"
#include "widgets/overlaywidget.h"
#ifdef Q_WS_MAC
#define MINIMUM_HEIGHT 38
@ -25,6 +26,7 @@ QueueView::QueueView( AnimatedSplitter* parent )
m_queue->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Ignored );
m_queue->setFrameShape( QFrame::NoFrame );
m_queue->setAttribute( Qt::WA_MacShowFocusRect, 0 );
m_queue->overlay()->setEnabled( false );
m_button = new QPushButton();
m_button->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed );
@ -49,7 +51,7 @@ QueueView::onShown( QWidget* widget )
qDebug() << Q_FUNC_INFO << widget;
if ( widget != this )
return;
AnimatedWidget::onShown( widget );
m_button->setText( tr( "Click to hide queue" ) );

View File

@ -15,7 +15,7 @@ OverlayWidget::OverlayWidget( QWidget* parent )
, m_opacity( 0.00 )
, m_parent( parent )
{
resize( 380, 220 );
resize( 380, 128 );
setAttribute( Qt::WA_TranslucentBackground, true );
setOpacity( m_opacity );
@ -58,6 +58,9 @@ OverlayWidget::setText( const QString& text )
void
OverlayWidget::show( int timeoutSecs )
{
if ( !isEnabled() )
return;
QPropertyAnimation* animation = new QPropertyAnimation( this, "opacity" );
animation->setDuration( FADING_DURATION );
animation->setStartValue( 0.00 );
@ -72,20 +75,26 @@ OverlayWidget::show( int timeoutSecs )
void
OverlayWidget::hide()
{
if ( !isEnabled() )
return;
QPropertyAnimation* animation = new QPropertyAnimation( this, "opacity" );
animation->setDuration( FADING_DURATION );
animation->setEndValue( 0.00 );
animation->start();
}
bool
OverlayWidget::shown() const
{
if ( !isEnabled() )
return false;
return m_opacity == OPACITY;
}
void
OverlayWidget::paintEvent( QPaintEvent* event )
{