[vlc-commits] commit: Qt: remove ugly hack for popupMenu (Jean-Baptiste Kempf )

git at videolan.org git at videolan.org
Fri Mar 19 18:13:02 CET 2010


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Fri Mar 19 18:12:44 2010 +0100| [cf4cc9a84f2ee9654df61653610b2d5f3acc1429] | committer: Jean-Baptiste Kempf 

Qt: remove ugly hack for popupMenu

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

 modules/gui/qt4/main_interface.cpp |   17 ++++++-----------
 1 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp
index 1d07841..c3fa016 100644
--- a/modules/gui/qt4/main_interface.cpp
+++ b/modules/gui/qt4/main_interface.cpp
@@ -229,11 +229,6 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
     CONNECT( this, askUpdate(), this, doComponentsUpdate() );
     CONNECT( THEDP, toolBarConfUpdated(), this, recreateToolbars() );
 
-    /* Enable the popup menu in the MI */
-    setContextMenuPolicy( Qt::CustomContextMenu );
-    CONNECT( this, customContextMenuRequested( const QPoint& ),
-             this, popupMenu( const QPoint& ) );
-
     /** END of CONNECTS**/
 
 
@@ -404,6 +399,11 @@ void MainInterface::createMainWidget( QSettings *settings )
 
     getSettings()->endGroup();
 
+    /* Enable the popup menu in the MI */
+    main->setContextMenuPolicy( Qt::CustomContextMenu );
+    CONNECT( main, customContextMenuRequested( const QPoint& ),
+             this, popupMenu( const QPoint& ) );
+
     if ( depth() > 8 ) /* 8bit depth has too many issues with opacity */
         /* Create the FULLSCREEN CONTROLS Widget */
         if( var_InheritBool( p_intf, "qt-fs-controller" ) )
@@ -554,12 +554,7 @@ void MainInterface::destroyPopupMenu()
 
 void MainInterface::popupMenu( const QPoint &p )
 {
-    /* FIXME
-     * Ow, that's ugly: don't show the popup menu if cursor over
-     * the main menu bar or the status bar */
-    if( !childAt( p ) || ( ( childAt( p ) != menuBar() )
-                        && ( childAt( p )->parentWidget() != statusBar() ) ) )
-        QVLCMenu::PopupMenu( p_intf, true );
+    QVLCMenu::PopupMenu( p_intf, true );
 }
 
 void MainInterface::toggleFSC()



More information about the vlc-commits mailing list