vlc/vlc-1.2 | branch: master | Francois Cartegnie <[email protected]> | Sat Nov 26 18:14:43 2011 +0100| [4067e7cc88a884f0d62c6d75e674ef7fbf20daff] | committer: Jean-Baptiste Kempf
Qt: Menus: make speed menu tearable. Tuning playback speed is usually done through multiple actions (because values are relative/increments). It is better to create a tear-off menu from it. Especially true since status bar isn't enabled by default. (cherry picked from commit 88515f20012beb82028e1fd1fbf2f015d0042b23) Signed-off-by: Jean-Baptiste Kempf <[email protected]> > http://git.videolan.org/gitweb.cgi/vlc/vlc-1.2.git/?a=commit;h=4067e7cc88a884f0d62c6d75e674ef7fbf20daff --- modules/gui/qt4/menus.cpp | 15 ++++++++++----- 1 files changed, 10 insertions(+), 5 deletions(-) diff --git a/modules/gui/qt4/menus.cpp b/modules/gui/qt4/menus.cpp index f85e515..8d8181c 100644 --- a/modules/gui/qt4/menus.cpp +++ b/modules/gui/qt4/menus.cpp @@ -797,11 +797,13 @@ void QVLCMenu::PopupMenuControlEntries( QMenu *menu, intf_thread_t *p_intf, bool b_normal ) { QAction *action; + QMenu *rateMenu = new QMenu( "Sp&eed" ); + rateMenu->setTearOffEnabled( true ); if( b_normal ) { /* Faster/Slower */ - action = menu->addAction( qtr( "&Faster" ), THEMIM->getIM(), + action = rateMenu->addAction( qtr( "&Faster" ), THEMIM->getIM(), SLOT( faster() ) ); #ifndef __APPLE__ /* No icons in menus in Mac */ action->setIcon( QIcon( ":/toolbar/faster2") ); @@ -809,21 +811,21 @@ void QVLCMenu::PopupMenuControlEntries( QMenu *menu, intf_thread_t *p_intf, action->setData( STATIC_ENTRY ); } - action = menu->addAction( qtr( "Faster (fine)" ), THEMIM->getIM(), + action = rateMenu->addAction( qtr( "Faster (fine)" ), THEMIM->getIM(), SLOT( littlefaster() ) ); action->setData( STATIC_ENTRY ); - action = menu->addAction( qtr( "N&ormal Speed" ), THEMIM->getIM(), + action = rateMenu->addAction( qtr( "N&ormal Speed" ), THEMIM->getIM(), SLOT( normalRate() ) ); action->setData( STATIC_ENTRY ); - action = menu->addAction( qtr( "Slower (fine)" ), THEMIM->getIM(), + action = rateMenu->addAction( qtr( "Slower (fine)" ), THEMIM->getIM(), SLOT( littleslower() ) ); action->setData( STATIC_ENTRY ); if( b_normal ) { - action = menu->addAction( qtr( "Slo&wer" ), THEMIM->getIM(), + action = rateMenu->addAction( qtr( "Slo&wer" ), THEMIM->getIM(), SLOT( slower() ) ); #ifndef __APPLE__ /* No icons in menus in Mac */ action->setIcon( QIcon( ":/toolbar/slower2") ); @@ -831,6 +833,9 @@ void QVLCMenu::PopupMenuControlEntries( QMenu *menu, intf_thread_t *p_intf, action->setData( STATIC_ENTRY ); } + action = menu->addMenu( rateMenu ); + action->setData( STATIC_ENTRY ); + menu->addSeparator(); if( !b_normal ) return; _______________________________________________ vlc-commits mailing list [email protected] http://mailman.videolan.org/listinfo/vlc-commits
