mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-20 04:41:36 +02:00
Do not elide artist name when there's enough space.
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
||||||
*
|
*
|
||||||
* Copyright 2013, Christian Muehlhaeuser <muesli@tomahawk-player.org>
|
* Copyright 2013, Christian Muehlhaeuser <muesli@tomahawk-player.org>
|
||||||
|
* Copyright 2013-2014, Teo Mrnjavac <teo@kde.org>
|
||||||
*
|
*
|
||||||
* Tomahawk is free software: you can redistribute it and/or modify
|
* Tomahawk is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -68,7 +69,6 @@ ColumnViewPreviewWidget::ColumnViewPreviewWidget( ColumnView* parent )
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
m_trackLabel = new ScrollingLabel( this );
|
m_trackLabel = new ScrollingLabel( this );
|
||||||
//m_trackLabel->setAlignment( Qt::AlignCenter );
|
|
||||||
QFont font;
|
QFont font;
|
||||||
font.setPointSize( TomahawkUtils::defaultFontSize() + 9 );
|
font.setPointSize( TomahawkUtils::defaultFontSize() + 9 );
|
||||||
font.setBold( true );
|
font.setBold( true );
|
||||||
@@ -87,6 +87,7 @@ ColumnViewPreviewWidget::ColumnViewPreviewWidget( ColumnView* parent )
|
|||||||
QHBoxLayout* artistLayout = new QHBoxLayout;
|
QHBoxLayout* artistLayout = new QHBoxLayout;
|
||||||
artistLayout->addStretch();
|
artistLayout->addStretch();
|
||||||
artistLayout->addWidget( m_artistLabel );
|
artistLayout->addWidget( m_artistLabel );
|
||||||
|
m_artistLabel->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Preferred );
|
||||||
artistLayout->addStretch();
|
artistLayout->addStretch();
|
||||||
mainLayout->addLayout( artistLayout );
|
mainLayout->addLayout( artistLayout );
|
||||||
|
|
||||||
@@ -197,6 +198,11 @@ ColumnViewPreviewWidget::setQuery( const Tomahawk::query_ptr& query )
|
|||||||
|
|
||||||
m_trackLabel->setText( query->track()->track() );
|
m_trackLabel->setText( query->track()->track() );
|
||||||
m_artistLabel->setArtist( query->track()->artistPtr() );
|
m_artistLabel->setArtist( query->track()->artistPtr() );
|
||||||
|
m_artistLabel->setMinimumWidth( qMin( m_artistLabel->fontMetrics().width( query->track()->artist() ) +
|
||||||
|
m_artistLabel->contentsMargins().left() +
|
||||||
|
m_artistLabel->contentsMargins().right() +
|
||||||
|
2 * m_artistLabel->lineWidth(),
|
||||||
|
width() ) );
|
||||||
m_artistLabel->setElideMode( Qt::ElideRight );
|
m_artistLabel->setElideMode( Qt::ElideRight );
|
||||||
m_composerValue->setText( query->track()->composer() );
|
m_composerValue->setText( query->track()->composer() );
|
||||||
|
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
||||||
*
|
*
|
||||||
* Copyright 2013, Christian Muehlhaeuser <muesli@tomahawk-player.org>
|
* Copyright 2013, Christian Muehlhaeuser <muesli@tomahawk-player.org>
|
||||||
|
* Copyright 2013-2014, Teo Mrnjavac <teo@kde.org>
|
||||||
*
|
*
|
||||||
* Tomahawk is free software: you can redistribute it and/or modify
|
* Tomahawk is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
Reference in New Issue
Block a user