mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-12 00:54:20 +02:00
* Fix elided texts fo now-playing row in PlaylistItemDelegate.
* Fixed blue now-playing frame around the entire row.
This commit is contained in:
@@ -349,7 +349,6 @@ Servent::createParallelConnection( Connection* orig_conn, Connection* new_conn,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// for outbound connections. DRY out the socket handover code from readyread too?
|
|
||||||
void
|
void
|
||||||
Servent::socketConnected()
|
Servent::socketConnected()
|
||||||
{
|
{
|
||||||
|
@@ -62,7 +62,7 @@ PlaylistItemDelegate::paint( QPainter* painter, const QStyleOptionViewItem& opti
|
|||||||
if ( item->isPlaying() )
|
if ( item->isPlaying() )
|
||||||
{
|
{
|
||||||
painter->save();
|
painter->save();
|
||||||
painter->setRenderHint( QPainter::Antialiasing );
|
// painter->setRenderHint( QPainter::Antialiasing );
|
||||||
|
|
||||||
{
|
{
|
||||||
QRect r = option.rect.adjusted( 3, 0, 0, 0 );
|
QRect r = option.rect.adjusted( 3, 0, 0, 0 );
|
||||||
@@ -73,13 +73,14 @@ PlaylistItemDelegate::paint( QPainter* painter, const QStyleOptionViewItem& opti
|
|||||||
r.adjust( 22, 0, 0, 3 );
|
r.adjust( 22, 0, 0, 3 );
|
||||||
}
|
}
|
||||||
|
|
||||||
QTextOption to( Qt::AlignVCenter );
|
|
||||||
|
|
||||||
painter->setPen( option.palette.text().color() );
|
painter->setPen( option.palette.text().color() );
|
||||||
painter->drawText( r.adjusted( 0, 1, 0, 0 ), index.data().toString(), to );
|
|
||||||
|
QTextOption to( Qt::AlignVCenter );
|
||||||
|
QString text = painter->fontMetrics().elidedText( index.data().toString(), Qt::ElideRight, r.width() - 3 );
|
||||||
|
painter->drawText( r.adjusted( 0, 1, 0, 0 ), text, to );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( m_view->header()->visualIndex( index.column() ) == m_view->header()->visibleSectionCount() - 1 )
|
// if ( m_view->header()->visualIndex( index.column() ) == m_view->header()->visibleSectionCount() - 1 )
|
||||||
{
|
{
|
||||||
QRect r = QRect( 3, option.rect.y() + 1, m_view->viewport()->width() - 6, option.rect.height() - 2 );
|
QRect r = QRect( 3, option.rect.y() + 1, m_view->viewport()->width() - 6, option.rect.height() - 2 );
|
||||||
painter->setPen( option.palette.highlight().color() );
|
painter->setPen( option.palette.highlight().color() );
|
||||||
|
@@ -135,12 +135,16 @@ TomahawkApp::TomahawkApp( int& argc, char *argv[] )
|
|||||||
m_servent = new Servent( this );
|
m_servent = new Servent( this );
|
||||||
connect( m_servent, SIGNAL( ready() ), SLOT( setupSIP() ) );
|
connect( m_servent, SIGNAL( ready() ), SLOT( setupSIP() ) );
|
||||||
|
|
||||||
|
qDebug() << "Init Database.";
|
||||||
setupDatabase();
|
setupDatabase();
|
||||||
|
|
||||||
|
qDebug() << "Init Echonest Factory.";
|
||||||
GeneratorFactory::registerFactory( "echonest", new EchonestFactory );
|
GeneratorFactory::registerFactory( "echonest", new EchonestFactory );
|
||||||
|
|
||||||
#ifndef NO_LIBLASTFM
|
#ifndef NO_LIBLASTFM
|
||||||
|
qDebug() << "Init Scrobbler.";
|
||||||
m_scrobbler = new Scrobbler( this );
|
m_scrobbler = new Scrobbler( this );
|
||||||
|
qDebug() << "Setting NAM.";
|
||||||
TomahawkUtils::setNam( new lastfm::NetworkAccessManager( this ) );
|
TomahawkUtils::setNam( new lastfm::NetworkAccessManager( this ) );
|
||||||
|
|
||||||
connect( m_audioEngine, SIGNAL( started( const Tomahawk::result_ptr& ) ),
|
connect( m_audioEngine, SIGNAL( started( const Tomahawk::result_ptr& ) ),
|
||||||
@@ -155,6 +159,7 @@ TomahawkApp::TomahawkApp( int& argc, char *argv[] )
|
|||||||
connect( m_audioEngine, SIGNAL( stopped() ),
|
connect( m_audioEngine, SIGNAL( stopped() ),
|
||||||
m_scrobbler, SLOT( trackStopped() ), Qt::QueuedConnection );
|
m_scrobbler, SLOT( trackStopped() ), Qt::QueuedConnection );
|
||||||
#else
|
#else
|
||||||
|
qDebug() << "Setting NAM.";
|
||||||
TomahawkUtils::setNam( new QNetworkAccessManager );
|
TomahawkUtils::setNam( new QNetworkAccessManager );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -173,12 +178,15 @@ TomahawkApp::TomahawkApp( int& argc, char *argv[] )
|
|||||||
|
|
||||||
QNetworkProxy::setApplicationProxy( *TomahawkUtils::proxy() );
|
QNetworkProxy::setApplicationProxy( *TomahawkUtils::proxy() );
|
||||||
|
|
||||||
|
qDebug() << "Init SIP system.";
|
||||||
m_sipHandler = new SipHandler( this );
|
m_sipHandler = new SipHandler( this );
|
||||||
|
qDebug() << "Init InfoSystem.";
|
||||||
m_infoSystem = new Tomahawk::InfoSystem::InfoSystem( this );
|
m_infoSystem = new Tomahawk::InfoSystem::InfoSystem( this );
|
||||||
|
|
||||||
#ifndef TOMAHAWK_HEADLESS
|
#ifndef TOMAHAWK_HEADLESS
|
||||||
if ( !m_headless )
|
if ( !m_headless )
|
||||||
{
|
{
|
||||||
|
qDebug() << "Init MainWindow.";
|
||||||
m_mainwindow = new TomahawkWindow();
|
m_mainwindow = new TomahawkWindow();
|
||||||
m_mainwindow->setWindowTitle( "Tomahawk" );
|
m_mainwindow->setWindowTitle( "Tomahawk" );
|
||||||
m_mainwindow->show();
|
m_mainwindow->show();
|
||||||
@@ -186,13 +194,19 @@ TomahawkApp::TomahawkApp( int& argc, char *argv[] )
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
qDebug() << "Init Pipeline.";
|
||||||
setupPipeline();
|
setupPipeline();
|
||||||
|
qDebug() << "Init Local Collection.";
|
||||||
initLocalCollection();
|
initLocalCollection();
|
||||||
|
qDebug() << "Init Servent.";
|
||||||
startServent();
|
startServent();
|
||||||
//loadPlugins();
|
//loadPlugins();
|
||||||
|
|
||||||
if( arguments().contains( "--http" ) || TomahawkSettings::instance()->value( "network/http", true ).toBool() )
|
if( arguments().contains( "--http" ) || TomahawkSettings::instance()->value( "network/http", true ).toBool() )
|
||||||
|
{
|
||||||
|
qDebug() << "Init HTTP Server.";
|
||||||
startHTTP();
|
startHTTP();
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef TOMAHAWK_HEADLESS
|
#ifndef TOMAHAWK_HEADLESS
|
||||||
if ( !TomahawkSettings::instance()->hasScannerPath() )
|
if ( !TomahawkSettings::instance()->hasScannerPath() )
|
||||||
|
Reference in New Issue
Block a user