mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 06:07:37 +02:00
* AlbumViews are now sorted by Artist - Album.
* Tweaked mode switching. * Hide stats & mode buttons for certain view types.
This commit is contained in:
@@ -40,10 +40,9 @@ AudioEngine::AudioEngine()
|
|||||||
|
|
||||||
AudioEngine::~AudioEngine()
|
AudioEngine::~AudioEngine()
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << "waiting for event loop to finish..";
|
qDebug() << Q_FUNC_INFO << "waiting for event loop to finish...";
|
||||||
quit();
|
quit();
|
||||||
wait( 1000 );
|
wait( 1000 );
|
||||||
qDebug() << Q_FUNC_INFO << "ok";
|
|
||||||
|
|
||||||
m_input.clear();
|
m_input.clear();
|
||||||
delete m_audio;
|
delete m_audio;
|
||||||
|
@@ -11,6 +11,8 @@ AlbumProxyModel::AlbumProxyModel( QObject* parent )
|
|||||||
: QSortFilterProxyModel( parent )
|
: QSortFilterProxyModel( parent )
|
||||||
, PlaylistInterface( this )
|
, PlaylistInterface( this )
|
||||||
, m_model( 0 )
|
, m_model( 0 )
|
||||||
|
, m_repeatMode( PlaylistInterface::NoRepeat )
|
||||||
|
, m_shuffled( false )
|
||||||
{
|
{
|
||||||
qsrand( QTime( 0, 0, 0 ).secsTo( QTime::currentTime() ) );
|
qsrand( QTime( 0, 0, 0 ).secsTo( QTime::currentTime() ) );
|
||||||
|
|
||||||
@@ -71,6 +73,26 @@ AlbumProxyModel::filterAcceptsRow( int sourceRow, const QModelIndex& sourceParen
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
AlbumProxyModel::lessThan( const QModelIndex& left, const QModelIndex& right ) const
|
||||||
|
{
|
||||||
|
AlbumItem* p1 = sourceModel()->itemFromIndex( left );
|
||||||
|
AlbumItem* p2 = sourceModel()->itemFromIndex( right );
|
||||||
|
|
||||||
|
if ( !p1 )
|
||||||
|
return true;
|
||||||
|
if ( !p2 )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if ( p1->album()->artist()->name() == p2->album()->artist()->name() )
|
||||||
|
{
|
||||||
|
return QString::localeAwareCompare( p1->album()->name(), p2->album()->name() ) < 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return QString::localeAwareCompare( p1->album()->artist()->name(), p2->album()->artist()->name() ) < 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
AlbumProxyModel::removeIndex( const QModelIndex& index )
|
AlbumProxyModel::removeIndex( const QModelIndex& index )
|
||||||
{
|
{
|
||||||
|
@@ -45,6 +45,7 @@ public slots:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool filterAcceptsRow( int sourceRow, const QModelIndex& sourceParent ) const;
|
bool filterAcceptsRow( int sourceRow, const QModelIndex& sourceParent ) const;
|
||||||
|
bool lessThan( const QModelIndex& left, const QModelIndex& right ) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
AlbumModel* m_model;
|
AlbumModel* m_model;
|
||||||
|
@@ -33,7 +33,6 @@ AlbumView::AlbumView( QWidget* parent )
|
|||||||
setResizeMode( Adjust );
|
setResizeMode( Adjust );
|
||||||
setViewMode( IconMode );
|
setViewMode( IconMode );
|
||||||
setVerticalScrollMode( QAbstractItemView::ScrollPerPixel );
|
setVerticalScrollMode( QAbstractItemView::ScrollPerPixel );
|
||||||
// setIconSize( QSize( 64, 64 ) );
|
|
||||||
|
|
||||||
setProxyModel( new AlbumProxyModel( this ) );
|
setProxyModel( new AlbumProxyModel( this ) );
|
||||||
|
|
||||||
@@ -63,7 +62,10 @@ AlbumView::setModel( AlbumModel* model )
|
|||||||
m_model = model;
|
m_model = model;
|
||||||
|
|
||||||
if ( m_proxyModel )
|
if ( m_proxyModel )
|
||||||
|
{
|
||||||
m_proxyModel->setSourceModel( model );
|
m_proxyModel->setSourceModel( model );
|
||||||
|
m_proxyModel->sort( 0 );
|
||||||
|
}
|
||||||
|
|
||||||
connect( m_proxyModel, SIGNAL( filterChanged( QString ) ), SLOT( onFilterChanged( QString ) ) );
|
connect( m_proxyModel, SIGNAL( filterChanged( QString ) ), SLOT( onFilterChanged( QString ) ) );
|
||||||
|
|
||||||
|
@@ -28,6 +28,8 @@ PlaylistManager::PlaylistManager( QObject* parent )
|
|||||||
, m_currentInterface( 0 )
|
, m_currentInterface( 0 )
|
||||||
, m_currentMode( 0 )
|
, m_currentMode( 0 )
|
||||||
, m_superCollectionVisible( true )
|
, m_superCollectionVisible( true )
|
||||||
|
, m_statsAvailable( false )
|
||||||
|
, m_modesAvailable( false )
|
||||||
{
|
{
|
||||||
m_stack = new QStackedWidget();
|
m_stack = new QStackedWidget();
|
||||||
|
|
||||||
@@ -54,7 +56,12 @@ PlaylistManager::PlaylistManager( QObject* parent )
|
|||||||
m_superCollectionFlatModel = new CollectionFlatModel( m_superCollectionView );
|
m_superCollectionFlatModel = new CollectionFlatModel( m_superCollectionView );
|
||||||
m_superCollectionView->setModel( m_superCollectionFlatModel );
|
m_superCollectionView->setModel( m_superCollectionFlatModel );
|
||||||
|
|
||||||
|
m_superAlbumView = new AlbumView();
|
||||||
|
m_superAlbumModel = new AlbumModel( m_superAlbumView );
|
||||||
|
m_superAlbumView->setModel( m_superAlbumModel );
|
||||||
|
|
||||||
m_stack->addWidget( m_superCollectionView );
|
m_stack->addWidget( m_superCollectionView );
|
||||||
|
m_stack->addWidget( m_superAlbumView );
|
||||||
m_currentInterface = m_superCollectionView->proxyModel();
|
m_currentInterface = m_superCollectionView->proxyModel();
|
||||||
|
|
||||||
connect( &m_filterTimer, SIGNAL( timeout() ), SLOT( applyFilter() ) );
|
connect( &m_filterTimer, SIGNAL( timeout() ), SLOT( applyFilter() ) );
|
||||||
@@ -102,6 +109,8 @@ PlaylistManager::show( const Tomahawk::playlist_ptr& playlist )
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_superCollectionVisible = false;
|
m_superCollectionVisible = false;
|
||||||
|
m_statsAvailable = true;
|
||||||
|
m_modesAvailable = false;
|
||||||
linkPlaylist();
|
linkPlaylist();
|
||||||
|
|
||||||
emit numSourcesChanged( APP->sourcelist().count() );
|
emit numSourcesChanged( APP->sourcelist().count() );
|
||||||
@@ -136,6 +145,8 @@ PlaylistManager::show( const Tomahawk::album_ptr& album )
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_superCollectionVisible = false;
|
m_superCollectionVisible = false;
|
||||||
|
m_statsAvailable = false;
|
||||||
|
m_modesAvailable = false;
|
||||||
linkPlaylist();
|
linkPlaylist();
|
||||||
|
|
||||||
emit numSourcesChanged( 1 );
|
emit numSourcesChanged( 1 );
|
||||||
@@ -148,6 +159,7 @@ PlaylistManager::show( const Tomahawk::collection_ptr& collection )
|
|||||||
{
|
{
|
||||||
unlinkPlaylist();
|
unlinkPlaylist();
|
||||||
|
|
||||||
|
m_currentCollection = collection;
|
||||||
if ( m_currentMode == 0 )
|
if ( m_currentMode == 0 )
|
||||||
{
|
{
|
||||||
if ( !m_collectionViews.contains( collection ) )
|
if ( !m_collectionViews.contains( collection ) )
|
||||||
@@ -195,6 +207,8 @@ PlaylistManager::show( const Tomahawk::collection_ptr& collection )
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_superCollectionVisible = false;
|
m_superCollectionVisible = false;
|
||||||
|
m_statsAvailable = ( m_currentMode == 0 );
|
||||||
|
m_modesAvailable = true;
|
||||||
linkPlaylist();
|
linkPlaylist();
|
||||||
|
|
||||||
emit numSourcesChanged( 1 );
|
emit numSourcesChanged( 1 );
|
||||||
@@ -223,6 +237,10 @@ PlaylistManager::show( const Tomahawk::source_ptr& source )
|
|||||||
|
|
||||||
m_stack->setCurrentWidget( m_currentInfoWidget );
|
m_stack->setCurrentWidget( m_currentInfoWidget );
|
||||||
m_superCollectionVisible = false;
|
m_superCollectionVisible = false;
|
||||||
|
m_statsAvailable = false;
|
||||||
|
m_modesAvailable = false;
|
||||||
|
|
||||||
|
linkPlaylist();
|
||||||
|
|
||||||
emit numSourcesChanged( 1 );
|
emit numSourcesChanged( 1 );
|
||||||
return true;
|
return true;
|
||||||
@@ -238,13 +256,24 @@ PlaylistManager::showSuperCollection()
|
|||||||
{
|
{
|
||||||
m_superCollections.append( source->collection() );
|
m_superCollections.append( source->collection() );
|
||||||
m_superCollectionFlatModel->addCollection( source->collection() );
|
m_superCollectionFlatModel->addCollection( source->collection() );
|
||||||
|
m_superAlbumModel->addCollection( source->collection() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( m_currentMode == 0 )
|
||||||
|
{
|
||||||
m_stack->setCurrentWidget( m_superCollectionView );
|
m_stack->setCurrentWidget( m_superCollectionView );
|
||||||
m_currentInterface = m_superCollectionView->proxyModel();
|
m_currentInterface = m_superCollectionView->proxyModel();
|
||||||
|
}
|
||||||
|
else if ( m_currentMode == 2 )
|
||||||
|
{
|
||||||
|
m_stack->setCurrentWidget( m_superAlbumView );
|
||||||
|
m_currentInterface = m_superAlbumView->proxyModel();
|
||||||
|
}
|
||||||
|
|
||||||
m_superCollectionVisible = true;
|
m_superCollectionVisible = true;
|
||||||
|
m_statsAvailable = ( m_currentMode == 0 );
|
||||||
|
m_modesAvailable = true;
|
||||||
linkPlaylist();
|
linkPlaylist();
|
||||||
|
|
||||||
emit numSourcesChanged( m_superCollections.count() );
|
emit numSourcesChanged( m_superCollections.count() );
|
||||||
@@ -258,7 +287,11 @@ PlaylistManager::setTableMode()
|
|||||||
qDebug() << Q_FUNC_INFO;
|
qDebug() << Q_FUNC_INFO;
|
||||||
|
|
||||||
m_currentMode = 0;
|
m_currentMode = 0;
|
||||||
m_stack->setCurrentWidget( m_superCollectionView );
|
|
||||||
|
if ( m_superCollectionVisible )
|
||||||
|
showSuperCollection();
|
||||||
|
else
|
||||||
|
show( m_currentCollection );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -270,7 +303,11 @@ PlaylistManager::setTreeMode()
|
|||||||
qDebug() << Q_FUNC_INFO;
|
qDebug() << Q_FUNC_INFO;
|
||||||
|
|
||||||
m_currentMode = 1;
|
m_currentMode = 1;
|
||||||
m_stack->setCurrentWidget( m_superCollectionView );
|
|
||||||
|
if ( m_superCollectionVisible )
|
||||||
|
showSuperCollection();
|
||||||
|
else
|
||||||
|
show( m_currentCollection );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -280,7 +317,11 @@ PlaylistManager::setAlbumMode()
|
|||||||
qDebug() << Q_FUNC_INFO;
|
qDebug() << Q_FUNC_INFO;
|
||||||
|
|
||||||
m_currentMode = 2;
|
m_currentMode = 2;
|
||||||
m_stack->setCurrentWidget( m_superCollectionView );
|
|
||||||
|
if ( m_superCollectionVisible )
|
||||||
|
showSuperCollection();
|
||||||
|
else
|
||||||
|
show( m_currentCollection );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -377,13 +418,17 @@ PlaylistManager::linkPlaylist()
|
|||||||
applyFilter();
|
applyFilter();
|
||||||
APP->audioEngine()->setPlaylist( m_currentInterface );
|
APP->audioEngine()->setPlaylist( m_currentInterface );
|
||||||
|
|
||||||
if ( m_currentInterface )
|
if ( m_currentInterface && m_statsAvailable )
|
||||||
{
|
{
|
||||||
emit numTracksChanged( m_currentInterface->unfilteredTrackCount() );
|
emit numTracksChanged( m_currentInterface->unfilteredTrackCount() );
|
||||||
emit numShownChanged( m_currentInterface->trackCount() );
|
emit numShownChanged( m_currentInterface->trackCount() );
|
||||||
emit repeatModeChanged( m_currentInterface->repeatMode() );
|
emit repeatModeChanged( m_currentInterface->repeatMode() );
|
||||||
emit shuffleModeChanged( m_currentInterface->shuffled() );
|
emit shuffleModeChanged( m_currentInterface->shuffled() );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
emit statsAvailable( m_statsAvailable );
|
||||||
|
emit modesAvailable( m_modesAvailable );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -9,6 +9,7 @@
|
|||||||
#include "tomahawk/playlistinterface.h"
|
#include "tomahawk/playlistinterface.h"
|
||||||
|
|
||||||
class AnimatedSplitter;
|
class AnimatedSplitter;
|
||||||
|
class AlbumModel;
|
||||||
class AlbumView;
|
class AlbumView;
|
||||||
class CollectionModel;
|
class CollectionModel;
|
||||||
class CollectionFlatModel;
|
class CollectionFlatModel;
|
||||||
@@ -51,6 +52,9 @@ signals:
|
|||||||
void repeatModeChanged( PlaylistInterface::RepeatMode mode );
|
void repeatModeChanged( PlaylistInterface::RepeatMode mode );
|
||||||
void shuffleModeChanged( bool enabled );
|
void shuffleModeChanged( bool enabled );
|
||||||
|
|
||||||
|
void statsAvailable( bool b );
|
||||||
|
void modesAvailable( bool b );
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void setTreeMode();
|
void setTreeMode();
|
||||||
void setTableMode();
|
void setTableMode();
|
||||||
@@ -78,6 +82,8 @@ private:
|
|||||||
PlaylistModel* m_queueModel;
|
PlaylistModel* m_queueModel;
|
||||||
QueueView* m_queueView;
|
QueueView* m_queueView;
|
||||||
|
|
||||||
|
AlbumModel* m_superAlbumModel;
|
||||||
|
AlbumView* m_superAlbumView;
|
||||||
CollectionFlatModel* m_superCollectionFlatModel;
|
CollectionFlatModel* m_superCollectionFlatModel;
|
||||||
CollectionView* m_superCollectionView;
|
CollectionView* m_superCollectionView;
|
||||||
|
|
||||||
@@ -94,8 +100,12 @@ private:
|
|||||||
|
|
||||||
QWidget* m_currentInfoWidget;
|
QWidget* m_currentInfoWidget;
|
||||||
|
|
||||||
|
Tomahawk::collection_ptr m_currentCollection;
|
||||||
|
|
||||||
int m_currentMode;
|
int m_currentMode;
|
||||||
bool m_superCollectionVisible;
|
bool m_superCollectionVisible;
|
||||||
|
bool m_statsAvailable;
|
||||||
|
bool m_modesAvailable;
|
||||||
|
|
||||||
QTimer m_filterTimer;
|
QTimer m_filterTimer;
|
||||||
QString m_filter;
|
QString m_filter;
|
||||||
|
@@ -337,7 +337,6 @@ void
|
|||||||
TrackModel::onPlaybackFinished( const Tomahawk::result_ptr& result )
|
TrackModel::onPlaybackFinished( const Tomahawk::result_ptr& result )
|
||||||
{
|
{
|
||||||
PlItem* oldEntry = itemFromIndex( m_currentIndex );
|
PlItem* oldEntry = itemFromIndex( m_currentIndex );
|
||||||
qDebug() << oldEntry->query();
|
|
||||||
if ( oldEntry && !oldEntry->query().isNull() && oldEntry->query()->results().contains( result ) )
|
if ( oldEntry && !oldEntry->query().isNull() && oldEntry->query()->results().contains( result ) )
|
||||||
{
|
{
|
||||||
oldEntry->setIsPlaying( false );
|
oldEntry->setIsPlaying( false );
|
||||||
|
@@ -142,6 +142,12 @@ TomahawkWindow::setupSignals()
|
|||||||
connect( m_topbar, SIGNAL( albumMode() ),
|
connect( m_topbar, SIGNAL( albumMode() ),
|
||||||
playlistManager(), SLOT( setAlbumMode() ) );
|
playlistManager(), SLOT( setAlbumMode() ) );
|
||||||
|
|
||||||
|
connect( playlistManager(), SIGNAL( statsAvailable( bool ) ),
|
||||||
|
m_topbar, SLOT( setStatsVisible( bool ) ) );
|
||||||
|
|
||||||
|
connect( playlistManager(), SIGNAL( modesAvailable( bool ) ),
|
||||||
|
m_topbar, SLOT( setModesVisible( bool ) ) );
|
||||||
|
|
||||||
// <From PlaylistManager>
|
// <From PlaylistManager>
|
||||||
connect( playlistManager(), SIGNAL( repeatModeChanged( PlaylistInterface::RepeatMode ) ),
|
connect( playlistManager(), SIGNAL( repeatModeChanged( PlaylistInterface::RepeatMode ) ),
|
||||||
m_audioControls, SLOT( onRepeatModeChanged( PlaylistInterface::RepeatMode ) ) );
|
m_audioControls, SLOT( onRepeatModeChanged( PlaylistInterface::RepeatMode ) ) );
|
||||||
|
@@ -171,7 +171,6 @@ void
|
|||||||
TopBar::setNumTracks( unsigned int i )
|
TopBar::setNumTracks( unsigned int i )
|
||||||
{
|
{
|
||||||
m_tracks = i;
|
m_tracks = i;
|
||||||
ui->statsLabelNumTracks->setVisible( m_tracks > 0 );
|
|
||||||
ui->statsLabelNumTracks->setVal( i );
|
ui->statsLabelNumTracks->setVal( i );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -189,7 +188,7 @@ void
|
|||||||
TopBar::setNumShown( unsigned int i )
|
TopBar::setNumShown( unsigned int i )
|
||||||
{
|
{
|
||||||
m_shown = i;
|
m_shown = i;
|
||||||
ui->statsLabelNumShown->setVisible( m_shown != m_tracks );
|
ui->statsLabelNumShown->setVisible( m_shown != m_tracks && ui->statsLabelNumTracks->isVisible() );
|
||||||
ui->statsLabelNumShown->setText( QString( "%L1 %2" ).arg( i ).arg( tr( "Shown" ) ) );
|
ui->statsLabelNumShown->setText( QString( "%L1 %2" ).arg( i ).arg( tr( "Shown" ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -209,3 +208,23 @@ TopBar::removeSource()
|
|||||||
Q_ASSERT( m_sources > 0 );
|
Q_ASSERT( m_sources > 0 );
|
||||||
setNumSources( m_sources - 1 );
|
setNumSources( m_sources - 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
TopBar::setStatsVisible( bool b )
|
||||||
|
{
|
||||||
|
foreach( QLabel* dude, m_dudes )
|
||||||
|
dude->setVisible( b );
|
||||||
|
|
||||||
|
// ui->statsLabelNumArtists->setVisible( b );
|
||||||
|
// ui->statsLabelNumShown->setVisible( b );
|
||||||
|
ui->statsLabelNumSources->setVisible( b );
|
||||||
|
ui->statsLabelNumTracks->setVisible( b );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
TopBar::setModesVisible( bool b )
|
||||||
|
{
|
||||||
|
ui->widgetRadio->setVisible( b );
|
||||||
|
}
|
||||||
|
@@ -33,6 +33,9 @@ public slots:
|
|||||||
void setNumArtists( unsigned int );
|
void setNumArtists( unsigned int );
|
||||||
void setNumShown( unsigned int );
|
void setNumShown( unsigned int );
|
||||||
|
|
||||||
|
void setStatsVisible( bool b );
|
||||||
|
void setModesVisible( bool b );
|
||||||
|
|
||||||
void addSource();
|
void addSource();
|
||||||
void removeSource();
|
void removeSource();
|
||||||
|
|
||||||
|
@@ -19,7 +19,7 @@
|
|||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>0</width>
|
<width>0</width>
|
||||||
<height>27</height>
|
<height>38</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
@@ -31,6 +31,13 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
void setVisible( bool b )
|
||||||
|
{
|
||||||
|
QLabel::setVisible( b );
|
||||||
|
if ( !m_diff.isNull() )
|
||||||
|
m_diff.data()->setVisible( b );
|
||||||
|
}
|
||||||
|
|
||||||
void frame( int f )
|
void frame( int f )
|
||||||
{
|
{
|
||||||
m_displayed = f;
|
m_displayed = f;
|
||||||
@@ -65,24 +72,25 @@ public slots:
|
|||||||
void showDiff()
|
void showDiff()
|
||||||
{
|
{
|
||||||
int differ = m_val - m_oldval;
|
int differ = m_val - m_oldval;
|
||||||
QLabel* diff = new QLabel( QString("%1 %L2" ).arg( differ > 0 ? "+" : "" )
|
m_diff = new QLabel( QString("%1 %L2" ).arg( differ > 0 ? "+" : "" )
|
||||||
.arg( (int)m_val - (int)m_oldval ),
|
.arg( (int)m_val - (int)m_oldval ),
|
||||||
this->parentWidget() );
|
this->parentWidget() );
|
||||||
|
|
||||||
diff->setStyleSheet( "font-size:9px; color:grey;" );
|
m_diff.data()->setStyleSheet( "font-size:9px; color:grey;" );
|
||||||
diff->move( QPoint( this->pos().x(), this->pos().y() ) );
|
m_diff.data()->move( QPoint( this->pos().x(), this->pos().y() ) );
|
||||||
QPropertyAnimation* a = new QPropertyAnimation( diff, "pos" );
|
QPropertyAnimation* a = new QPropertyAnimation( m_diff.data(), "pos" );
|
||||||
a->setEasingCurve( QEasingCurve( QEasingCurve::InQuad ) );
|
a->setEasingCurve( QEasingCurve( QEasingCurve::InQuad ) );
|
||||||
a->setStartValue( diff->pos() + QPoint( 0, -10 ) );
|
a->setStartValue( m_diff.data()->pos() + QPoint( 0, -10 ) );
|
||||||
a->setEndValue( QPoint( diff->pos().x(), diff->pos().y() - 25 ) );
|
a->setEndValue( QPoint( m_diff.data()->pos().x(), m_diff.data()->pos().y() - 25 ) );
|
||||||
a->setDuration( 1000 );
|
a->setDuration( 1000 );
|
||||||
// qDebug() << "ANIMATING DIFF:" << a->startValue() << a->endValue();
|
// qDebug() << "ANIMATING DIFF:" << a->startValue() << a->endValue();
|
||||||
|
|
||||||
connect( a, SIGNAL( finished() ), diff, SLOT( hide() ) );
|
connect( a, SIGNAL( finished() ), m_diff.data(), SLOT( hide() ) );
|
||||||
connect( a, SIGNAL( finished() ), diff, SLOT( deleteLater() ) );
|
connect( a, SIGNAL( finished() ), m_diff.data(), SLOT( deleteLater() ) );
|
||||||
connect( a, SIGNAL( finished() ), a, SLOT( deleteLater() ) );
|
connect( a, SIGNAL( finished() ), a, SLOT( deleteLater() ) );
|
||||||
|
|
||||||
diff->show();
|
m_diff.data()->show();
|
||||||
|
m_diff.data()->setVisible( this->isVisible() );
|
||||||
a->start();
|
a->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -96,7 +104,7 @@ private:
|
|||||||
unsigned int m_val, m_oldval;
|
unsigned int m_val, m_oldval;
|
||||||
|
|
||||||
QString m_format;
|
QString m_format;
|
||||||
|
QWeakPointer<QLabel> m_diff;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // ANIMATEDCOUNTERLABEL_H
|
#endif // ANIMATEDCOUNTERLABEL_H
|
||||||
|
@@ -98,8 +98,6 @@ AnimatedSplitter::addWidget( AnimatedWidget* widget )
|
|||||||
QSplitter::addWidget( widget );
|
QSplitter::addWidget( widget );
|
||||||
m_sizes << widget->hiddenSize();
|
m_sizes << widget->hiddenSize();
|
||||||
|
|
||||||
qDebug() << m_sizes.count();
|
|
||||||
|
|
||||||
connect( widget, SIGNAL( showWidget() ), SLOT( onShowRequest() ) );
|
connect( widget, SIGNAL( showWidget() ), SLOT( onShowRequest() ) );
|
||||||
connect( widget, SIGNAL( hideWidget() ), SLOT( onHideRequest() ) );
|
connect( widget, SIGNAL( hideWidget() ), SLOT( onHideRequest() ) );
|
||||||
connect( widget, SIGNAL( hiddenSizeChanged() ), SLOT( onHiddenSizeChanged() ) );
|
connect( widget, SIGNAL( hiddenSizeChanged() ), SLOT( onHiddenSizeChanged() ) );
|
||||||
|
Reference in New Issue
Block a user