Commit bdd0c1e1 authored by Ilkka Ollakka's avatar Ilkka Ollakka

Qt4: add size-scale into playlist model

parent 7c9fdd3c
......@@ -88,6 +88,8 @@ PLModel::PLModel( playlist_t *_p_playlist, /* THEPL */
ADD_ICON( NODE, ":/type/node" );
#undef ADD_ICON
i_zoom = getSettings()->value( "Playlist/zoom", 0 ).toInt();
rebuild( p_root );
DCONNECT( THEMIM->getIM(), metaChanged( input_item_t *),
this, processInputItemUpdate( input_item_t *) );
......@@ -101,6 +103,7 @@ PLModel::PLModel( playlist_t *_p_playlist, /* THEPL */
PLModel::~PLModel()
{
getSettings()->setValue( "Playlist/zoom", i_zoom );
delete rootItem;
delete sortingMenu;
}
......@@ -367,7 +370,7 @@ QVariant PLModel::data( const QModelIndex &index, const int role ) const
else if( role == Qt::FontRole )
{
QFont f;
f.setPointSize( f.pointSize() - 1 );
f.setPointSize( f.pointSize() - 1 + i_zoom );
if( isCurrent( index ) )
f.setBold( true );
return QVariant( f );
......
......@@ -104,6 +104,10 @@ public:
{
return getItem( index )->id();
}
inline int getZoom() const
{
return i_zoom;
}
signals:
void currentChanged( const QModelIndex& );
......@@ -112,6 +116,11 @@ signals:
public slots:
virtual void activateItem( const QModelIndex &index );
void activateItem( playlist_item_t *p_item );
inline void changeZoom( const int zoom )
{
i_zoom = zoom;
emit layoutChanged();
}
private:
/* General */
......@@ -153,6 +162,9 @@ private:
int i_cached_id;
int i_cached_input_id;
/* Zoom factor for font-size */
int i_zoom;
private slots:
void popupPlay();
void popupDel();
......
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