QVariant tmp = it->data( index.column() );
return tmp;
}
- else if( role == VLCModel::IsLeafNodeRole )
+ else if( role == IsLeafNodeRole )
return QVariant( true );
- else if( role == VLCModel::IsCurrentsParentNodeRole )
+ else if( role == IsCurrentsParentNodeRole )
return QVariant( false );
}
return QVariant();
CONNECT( mainView, viewChanged( const QModelIndex& ),
this, changeView( const QModelIndex &) );
- /* Zoom */
- QSlider *zoomSlider = new QSlider( Qt::Horizontal, this );
- zoomSlider->setRange( -10, 10);
- zoomSlider->setPageStep( 3 );
- zoomSlider->setValue( model->getZoom() );
- zoomSlider->setToolTip( qtr("Zoom playlist") );
- CONNECT( zoomSlider, valueChanged( int ), model, changeZoom( int ) );
- topbarLayout->addWidget( zoomSlider );
-
/* Connect the activation of the selector to a redefining of the PL */
DCONNECT( selector, categoryActivated( playlist_item_t *, bool ),
mainView, setRoot( playlist_item_t *, bool ) );
{
return QVariant( QBrush( Qt::gray ) );
}
- else if( role == IsCurrentRole ) return QVariant( isCurrent( index ) );
+ else if( role == IsCurrentRole )
+ {
+ return QVariant( isCurrent( index ) );
+ }
else if( role == IsLeafNodeRole )
{
QVariant isLeaf;
}
menu.addMenu( sortingMenu );
+ /* Zoom */
+ QMenu *zoomMenu = new QMenu( qtr( "Display size" ) );
+ zoomMenu->addAction( qtr( "Increase" ), this, SLOT( increaseZoom() ) );
+ zoomMenu->addAction( qtr( "Decrease" ), this, SLOT( decreaseZoom() ) );
+ menu.addMenu( zoomMenu );
+
/* Store the current selected item for popup*() methods */
current_selection = list;
column > 0 ? Qt::AscendingOrder : Qt::DescendingOrder );
}
+/* */
+void PLModel::increaseZoom()
+{
+ i_zoom++;
+ emit layoutChanged();
+}
+
+void PLModel::decreaseZoom()
+{
+ i_zoom--;
+ emit layoutChanged();
+}
+
/******************* Drag and Drop helper class ******************/
PlMimeData::~PlMimeData()
{
return static_cast<PLItem*>( index.internalPointer() );
else return rootItem;
}
- int getZoom() const
- {
- return i_zoom;
- }
signals:
void currentChanged( const QModelIndex& );
public slots:
virtual void activateItem( const QModelIndex &index );
- void changeZoom( const int zoom )
- {
- i_zoom = zoom;
- emit layoutChanged();
- }
private:
/* General */
void processItemRemoval( int i_id );
void processItemAppend( int item, int parent );
void activateItem( playlist_item_t *p_item );
+ void increaseZoom();
+ void decreaseZoom();
};
class PlMimeData : public QMimeData