]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/main_interface.cpp
Qt: add the popup menu in the main interface
[vlc] / modules / gui / qt4 / main_interface.cpp
index e91d12afafe8762acdb2cf687ba801742765e78f..5f1eb0f6a847e0cf5a280b48e2b447bf204f02b9 100644 (file)
@@ -256,6 +256,11 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
     /* Playlist */
     if( b_visible ) togglePlaylist();
 
+    /* Enable the popup menu in the MI */
+    setContextMenuPolicy( Qt::CustomContextMenu );
+    CONNECT( this, customContextMenuRequested( const QPoint& ),
+             this, popupMenu() );
+
     /* Final sizing and showing */
     setMinimumWidth( __MAX( controls->sizeHint().width(),
                             menuBar()->sizeHint().width() ) );
@@ -647,6 +652,11 @@ void MainInterface::toggleFSC()
    QApplication::postEvent( fullscreenControls, eShow );
 }
 
+void MainInterface::popupMenu()
+{
+    QVLCMenu::PopupMenu( p_intf, true );
+}
+
 void MainInterface::debug()
 {
 #ifndef NDEBUG