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