]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/playlist/playlist_model.cpp
Qt: remove the zoom slider and put it on the menu
[vlc] / modules / gui / qt4 / components / playlist / playlist_model.cpp
index 7200cffb91c7250f24cd3f8ff9226f16180b79a3..8f5da1847e55040f8cb488d10fa31d28dc263f61 100644 (file)
@@ -380,7 +380,10 @@ QVariant PLModel::data( const QModelIndex &index, const int role ) const
     {
         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;
@@ -977,6 +980,12 @@ bool PLModel::popup( const QModelIndex & index, const QPoint &point, const QMode
     }
     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;
 
@@ -1103,6 +1112,19 @@ void PLModel::popupSort( int column )
           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()
 {