Commit 229c807c authored by Francois Cartegnie's avatar Francois Cartegnie

Qt: PLModel: Move font's contextual style to views

parent 12d6985f
...@@ -363,10 +363,7 @@ QVariant PLModel::data( const QModelIndex &index, const int role ) const ...@@ -363,10 +363,7 @@ QVariant PLModel::data( const QModelIndex &index, const int role ) const
} }
else if( role == Qt::FontRole ) else if( role == Qt::FontRole )
{ {
QFont f; return QVariant( QFont() );
if( isCurrent( index ) )
f.setBold( true );
return QVariant( f );
} }
else if( role == Qt::ToolTipRole ) else if( role == Qt::ToolTipRole )
{ {
......
...@@ -80,6 +80,7 @@ void PlIconViewItemDelegate::paint( QPainter * painter, const QStyleOptionViewIt ...@@ -80,6 +80,7 @@ void PlIconViewItemDelegate::paint( QPainter * painter, const QStyleOptionViewIt
QFont font( index.data( Qt::FontRole ).value<QFont>() ); QFont font( index.data( Qt::FontRole ).value<QFont>() );
font.setPointSize( __MAX( font.pointSize() + i_zoom, 4 ) ); font.setPointSize( __MAX( font.pointSize() + i_zoom, 4 ) );
font.setBold( option.state & QStyle::State_Selected );
painter->setFont( font ); painter->setFont( font );
QFontMetrics fm = painter->fontMetrics(); QFontMetrics fm = painter->fontMetrics();
...@@ -220,6 +221,7 @@ void PlListViewItemDelegate::paint( QPainter * painter, const QStyleOptionViewIt ...@@ -220,6 +221,7 @@ void PlListViewItemDelegate::paint( QPainter * painter, const QStyleOptionViewIt
//Draw title info //Draw title info
f.setItalic( true ); f.setItalic( true );
f.setPointSize( __MAX( f.pointSize() + i_zoom, 4 ) ); f.setPointSize( __MAX( f.pointSize() + i_zoom, 4 ) );
f.setBold( option.state & QStyle::State_Selected );
painter->setFont( f ); painter->setFont( f );
QFontMetrics fm( painter->fontMetrics() ); QFontMetrics fm( painter->fontMetrics() );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment