[vlc-devel] commit: Show the normal popupMenu when no item is under the selection ( Jean-Baptiste Kempf )

git version control git at videolan.org
Thu Feb 4 13:19:12 CET 2010


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Thu Feb  4 13:18:51 2010 +0100| [c338f4fd509be18af26f69c1fbdf51c49322df3e] | committer: Jean-Baptiste Kempf 

Show the normal popupMenu when no item is under the selection

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c338f4fd509be18af26f69c1fbdf51c49322df3e
---

 .../gui/qt4/components/playlist/standardpanel.cpp  |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/modules/gui/qt4/components/playlist/standardpanel.cpp b/modules/gui/qt4/components/playlist/standardpanel.cpp
index 80b0bfd..58c2b5f 100644
--- a/modules/gui/qt4/components/playlist/standardpanel.cpp
+++ b/modules/gui/qt4/components/playlist/standardpanel.cpp
@@ -32,6 +32,7 @@
 #include "components/playlist/standardpanel.hpp"
 #include "components/playlist/icon_view.hpp"
 #include "util/customwidgets.hpp"
+#include "menus.hpp"
 
 #include <vlc_intf_strings.h>
 
@@ -87,7 +88,7 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
     layout->addWidget( search, 0, 4 );
     CONNECT( search, textChanged( const QString& ),
              this, search( const QString& ) );
-    layout->setColumnStretch( 4, 2 );
+    layout->setColumnStretch( 4, 10 );
 
     /* Add item to the playlist button */
     addButton = new QToolButton;
@@ -185,9 +186,15 @@ void StandardPLPanel::popupPlView( const QPoint &point )
 {
     QModelIndex index = currentView->indexAt( point );
     QPoint globalPoint = currentView->viewport()->mapToGlobal( point );
-    QItemSelectionModel *selection = currentView->selectionModel();
-    QModelIndexList list = selection->selectedIndexes();
-    model->popup( index, globalPoint, list );
+    if( !index.isValid() ){
+        QVLCMenu::PopupMenu( p_intf, true );
+    }
+    else
+    {
+        QItemSelectionModel *selection = currentView->selectionModel();
+        QModelIndexList list = selection->selectedIndexes();
+        model->popup( index, globalPoint, list );
+    }
 }
 
 void StandardPLPanel::popupSelectColumn( QPoint pos )




More information about the vlc-devel mailing list