Commit ee3f372e authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: no icons in Menus on Mac

parent f3b49014
...@@ -96,6 +96,7 @@ void addDPStaticEntry( QMenu *menu, ...@@ -96,6 +96,7 @@ void addDPStaticEntry( QMenu *menu,
const char *shortcut = NULL ) const char *shortcut = NULL )
{ {
QAction *action = NULL; QAction *action = NULL;
#ifndef __APPLE__ /* We don't set icons in menus in MacOS X */
if( !EMPTY_STR( icon ) ) if( !EMPTY_STR( icon ) )
{ {
if( !EMPTY_STR( shortcut ) ) if( !EMPTY_STR( shortcut ) )
...@@ -105,6 +106,7 @@ void addDPStaticEntry( QMenu *menu, ...@@ -105,6 +106,7 @@ void addDPStaticEntry( QMenu *menu,
action = menu->addAction( QIcon( icon ), text, THEDP, member ); action = menu->addAction( QIcon( icon ), text, THEDP, member );
} }
else else
#endif
{ {
if( !EMPTY_STR( shortcut ) ) if( !EMPTY_STR( shortcut ) )
action = menu->addAction( text, THEDP, member, qtr( shortcut ) ); action = menu->addAction( text, THEDP, member, qtr( shortcut ) );
...@@ -125,12 +127,14 @@ QAction* addMIMStaticEntry( intf_thread_t *p_intf, ...@@ -125,12 +127,14 @@ QAction* addMIMStaticEntry( intf_thread_t *p_intf,
bool bStatic = false ) bool bStatic = false )
{ {
QAction *action; QAction *action;
#ifndef __APPLE__ /* We don't set icons in menus in MacOS X */
if( !EMPTY_STR( icon ) ) if( !EMPTY_STR( icon ) )
{ {
action = menu->addAction( text, THEMIM, member ); action = menu->addAction( text, THEMIM, member );
action->setIcon( QIcon( icon ) ); action->setIcon( QIcon( icon ) );
} }
else else
#endif
{ {
action = menu->addAction( text, THEMIM, member ); action = menu->addAction( text, THEMIM, member );
} }
...@@ -448,7 +452,10 @@ QMenu *QVLCMenu::ViewMenu( intf_thread_t *p_intf, QMenu *current, MainInterface ...@@ -448,7 +452,10 @@ QMenu *QVLCMenu::ViewMenu( intf_thread_t *p_intf, QMenu *current, MainInterface
} }
} }
menu->addAction( QIcon( ":/menu/playlist_menu" ), menu->addAction(
#ifndef __APPLE__
QIcon( ":/menu/playlist_menu" ),
#endif
qtr( "Play&list" ), mi, qtr( "Play&list" ), mi,
SLOT( togglePlaylist() ), qtr( "Ctrl+L" ) ); SLOT( togglePlaylist() ), qtr( "Ctrl+L" ) );
...@@ -789,7 +796,9 @@ void QVLCMenu::PopupPlayEntries( QMenu *menu, ...@@ -789,7 +796,9 @@ void QVLCMenu::PopupPlayEntries( QMenu *menu,
{ {
action = menu->addAction( qtr( "Play" ), action = menu->addAction( qtr( "Play" ),
ActionsManager::getInstance( p_intf ), SLOT( play() ) ); ActionsManager::getInstance( p_intf ), SLOT( play() ) );
#ifndef __APPLE__ /* No icons in menus in Mac */
action->setIcon( QIcon( ":/menu/play" ) ); action->setIcon( QIcon( ":/menu/play" ) );
#endif
} }
else else
{ {
...@@ -805,7 +814,9 @@ void QVLCMenu::PopupMenuControlEntries( QMenu *menu, intf_thread_t *p_intf ) ...@@ -805,7 +814,9 @@ void QVLCMenu::PopupMenuControlEntries( QMenu *menu, intf_thread_t *p_intf )
/* Faster/Slower */ /* Faster/Slower */
action = menu->addAction( qtr( "&Faster" ), THEMIM->getIM(), action = menu->addAction( qtr( "&Faster" ), THEMIM->getIM(),
SLOT( faster() ) ); SLOT( faster() ) );
#ifndef __APPLE__ /* No icons in menus in Mac */
action->setIcon( QIcon( ":/toolbar/faster") ); action->setIcon( QIcon( ":/toolbar/faster") );
#endif
action->setData( STATIC_ENTRY ); action->setData( STATIC_ENTRY );
action = menu->addAction( qtr( "Faster (fine)" ), THEMIM->getIM(), action = menu->addAction( qtr( "Faster (fine)" ), THEMIM->getIM(),
...@@ -822,19 +833,25 @@ void QVLCMenu::PopupMenuControlEntries( QMenu *menu, intf_thread_t *p_intf ) ...@@ -822,19 +833,25 @@ void QVLCMenu::PopupMenuControlEntries( QMenu *menu, intf_thread_t *p_intf )
action = menu->addAction( qtr( "Slo&wer" ), THEMIM->getIM(), action = menu->addAction( qtr( "Slo&wer" ), THEMIM->getIM(),
SLOT( slower() ) ); SLOT( slower() ) );
#ifndef __APPLE__ /* No icons in menus in Mac */
action->setIcon( QIcon( ":/toolbar/slower") ); action->setIcon( QIcon( ":/toolbar/slower") );
#endif
action->setData( STATIC_ENTRY ); action->setData( STATIC_ENTRY );
menu->addSeparator(); menu->addSeparator();
action = menu->addAction( qtr( "&Jump Forward" ), THEMIM->getIM(), action = menu->addAction( qtr( "&Jump Forward" ), THEMIM->getIM(),
SLOT( jumpFwd() ) ); SLOT( jumpFwd() ) );
#ifndef __APPLE__ /* No icons in menus in Mac */
action->setIcon( QIcon( ":/toolbar/skip_fw") ); action->setIcon( QIcon( ":/toolbar/skip_fw") );
#endif
action->setData( STATIC_ENTRY ); action->setData( STATIC_ENTRY );
action = menu->addAction( qtr( "Jump Bac&kward" ), THEMIM->getIM(), action = menu->addAction( qtr( "Jump Bac&kward" ), THEMIM->getIM(),
SLOT( jumpBwd() ) ); SLOT( jumpBwd() ) );
#ifndef __APPLE__ /* No icons in menus in Mac */
action->setIcon( QIcon( ":/toolbar/skip_back") ); action->setIcon( QIcon( ":/toolbar/skip_back") );
#endif
action->setData( STATIC_ENTRY ); action->setData( STATIC_ENTRY );
addDPStaticEntry( menu, qtr( I_MENU_GOTOTIME ),"", addDPStaticEntry( menu, qtr( I_MENU_GOTOTIME ),"",
SLOT( gotoTimeDialog() ), "Ctrl+T" ); SLOT( gotoTimeDialog() ), "Ctrl+T" );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment