mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-05 13:47:26 +02:00
* Small tweaks to the SocialWidget.
This commit is contained in:
@@ -92,6 +92,14 @@ SocialWidget::setOpacity( qreal opacity )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
SocialWidget::setPosition( QPoint position )
|
||||||
|
{
|
||||||
|
m_position = position;
|
||||||
|
onGeometryUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
SocialWidget::show( int timeoutSecs )
|
SocialWidget::show( int timeoutSecs )
|
||||||
{
|
{
|
||||||
@@ -136,13 +144,6 @@ SocialWidget::paintEvent( QPaintEvent* event )
|
|||||||
{
|
{
|
||||||
Q_UNUSED( event );
|
Q_UNUSED( event );
|
||||||
|
|
||||||
QPoint position( m_position - QPoint( size().width(), size().height() ) );
|
|
||||||
if ( position != pos() )
|
|
||||||
{
|
|
||||||
move( position );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
QPainter p( this );
|
QPainter p( this );
|
||||||
QRect r = contentsRect();
|
QRect r = contentsRect();
|
||||||
|
|
||||||
@@ -191,7 +192,10 @@ SocialWidget::paintEvent( QPaintEvent* event )
|
|||||||
void
|
void
|
||||||
SocialWidget::onShortLinkReady( const QUrl& longUrl, const QUrl& shortUrl, const QVariant& callbackObj )
|
SocialWidget::onShortLinkReady( const QUrl& longUrl, const QUrl& shortUrl, const QVariant& callbackObj )
|
||||||
{
|
{
|
||||||
ui->textEdit->setText( tr( "Listening to \"%1\" by %2 on \"%3\" and loving it! %4" ).arg( m_query->track() ).arg( m_query->artist() ).arg( m_query->album() ).arg( shortUrl.toString() ) );
|
if ( m_query->album().isEmpty() )
|
||||||
|
ui->textEdit->setText( tr( "Listening to \"%1\" by %2 and loving it! %4" ).arg( m_query->track() ).arg( m_query->artist() ).arg( shortUrl.toString() ) );
|
||||||
|
else
|
||||||
|
ui->textEdit->setText( tr( "Listening to \"%1\" by %2 on \"%3\" and loving it! %4" ).arg( m_query->track() ).arg( m_query->artist() ).arg( m_query->album() ).arg( shortUrl.toString() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -200,6 +204,7 @@ SocialWidget::setQuery( const Tomahawk::query_ptr& query )
|
|||||||
{
|
{
|
||||||
m_query = query;
|
m_query = query;
|
||||||
ui->coverImage->setPixmap( query->cover( ui->coverImage->size() ) );
|
ui->coverImage->setPixmap( query->cover( ui->coverImage->size() ) );
|
||||||
|
onShortLinkReady( QString(), QString(), QVariant() );
|
||||||
onChanged();
|
onChanged();
|
||||||
|
|
||||||
QUrl longUrl = GlobalActionManager::instance()->openLinkFromQuery( query );
|
QUrl longUrl = GlobalActionManager::instance()->openLinkFromQuery( query );
|
||||||
|
@@ -46,7 +46,7 @@ public:
|
|||||||
void setOpacity( qreal opacity );
|
void setOpacity( qreal opacity );
|
||||||
|
|
||||||
QPoint position() const { return m_position; }
|
QPoint position() const { return m_position; }
|
||||||
void setPosition( QPoint position ) { m_position = position; }
|
void setPosition( QPoint position );
|
||||||
|
|
||||||
bool shown() const;
|
bool shown() const;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user