layout->setContentsMargins(0,0,0,0);
layout->addSpacing( 3 );
- lbl = new QLabel( text );
+ lbl = new QVLCElidingLabel( text );
layout->addWidget(lbl, 1);
setLayout( layout );
- setMinimumHeight( 22 ); //Action icon height plus 6
+ int height = qMax( 22, fontMetrics().height() + 8 );
+ setMinimumHeight( height );
}
void PLSelItem::addAction( ItemAction act, const QString& tooltip )
PLSelItem *PLSelector::addPodcastItem( playlist_item_t *p_item )
{
- vlc_gc_incref( p_item->p_input );
- char *psz_name = input_item_GetName( p_item->p_input );
- PLSelItem *item = addItem(
- PL_ITEM_TYPE, qfu( psz_name ), false, podcastsParent );
- item->addAction( RM_ACTION, qtr( "Remove this podcast subscription" ) );
- item->treeItem()->setData( 0, PL_ITEM_ROLE, QVariant::fromValue( p_item ) );
- item->treeItem()->setData( 0, PL_ITEM_ID_ROLE, QVariant(p_item->i_id) );
- item->treeItem()->setData( 0, IN_ITEM_ROLE, QVariant::fromValue( p_item->p_input ) );
- CONNECT( item, action( PLSelItem* ), this, podcastRemove( PLSelItem* ) );
- free( psz_name );
- return item;
+ vlc_gc_incref( p_item->p_input );
+ char *psz_name = input_item_GetName( p_item->p_input );
+ PLSelItem *item = addItem(
+ PL_ITEM_TYPE, qfu( psz_name ), false, podcastsParent );
+ item->addAction( RM_ACTION, qtr( "Remove this podcast subscription" ) );
+ item->treeItem()->setData( 0, PL_ITEM_ROLE, QVariant::fromValue( p_item ) );
+ item->treeItem()->setData( 0, PL_ITEM_ID_ROLE, QVariant(p_item->i_id) );
+ item->treeItem()->setData( 0, IN_ITEM_ROLE, QVariant::fromValue( p_item->p_input ) );
+ CONNECT( item, action( PLSelItem* ), this, podcastRemove( PLSelItem* ) );
+ free( psz_name );
+ return item;
}
void PLSelector::createItems()
void PLSelector::podcastRemove( PLSelItem* item )
{
- //FIXME will translators know to leave that %1 somewhere inside?
QString question ( qtr( "Do you really want to unsubscribe from %1?" ) );
question = question.arg( item->text() );
QMessageBox::StandardButton res =
QStyleOption option;
option.initFrom( this );
option.rect = rect.adjusted( rect.width() - indentation(), 0, 0, 0 );
-
- /*option.state = QStyle::State_Children;
- if( isExpanded( index ) ) option.state |= QStyle::State_Open;*/
style()->drawPrimitive( isExpanded( index ) ?
QStyle::PE_IndicatorArrowDown :
QStyle::PE_IndicatorArrowRight, &option, painter );