mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-09 07:36:48 +02:00
* Added Tomahawk::toggleFullscreen on OSX.
This commit is contained in:
@@ -46,6 +46,7 @@ void setApplicationHandler(PlatformInterface* handler);
|
|||||||
void checkForUpdates();
|
void checkForUpdates();
|
||||||
|
|
||||||
// Pass in a QObject with slots "fullScreenEntered() and fullScreenExited() in order to be notified
|
// Pass in a QObject with slots "fullScreenEntered() and fullScreenExited() in order to be notified
|
||||||
|
void toggleFullscreen();
|
||||||
void enableFullscreen( QObject* notifier );
|
void enableFullscreen( QObject* notifier );
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@@ -250,6 +250,26 @@ void Tomahawk::checkForUpdates() {
|
|||||||
#define LION_FULLSCREEN_EXIT_NOTIFICATION_VALUE @"NSWindowDidExitFullScreenNotification"
|
#define LION_FULLSCREEN_EXIT_NOTIFICATION_VALUE @"NSWindowDidExitFullScreenNotification"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
void Tomahawk::toggleFullscreen()
|
||||||
|
{
|
||||||
|
if ( QSysInfo::MacintoshVersion != QSysInfo::MV_SNOWLEOPARD &&
|
||||||
|
QSysInfo::MacintoshVersion != QSysInfo::MV_LEOPARD )
|
||||||
|
{
|
||||||
|
qDebug() << "Toggling Lion Full-screeen";
|
||||||
|
// Can't include TomahawkApp.h in a .mm file, pulls in InfoSystem.h which uses
|
||||||
|
// the objc keyword 'id'
|
||||||
|
foreach( QWidget* w, QApplication::topLevelWidgets() )
|
||||||
|
{
|
||||||
|
if ( qobject_cast< TomahawkWindow* >( w ) )
|
||||||
|
{
|
||||||
|
NSView *nsview = (NSView *)w->winId();
|
||||||
|
NSWindow *nswindow = [nsview window];
|
||||||
|
[nswindow toggleFullScreen: nil];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Tomahawk::enableFullscreen( QObject* receiver )
|
void Tomahawk::enableFullscreen( QObject* receiver )
|
||||||
{
|
{
|
||||||
// We don't support anything below leopard, so if it's not [snow] leopard it must be lion
|
// We don't support anything below leopard, so if it's not [snow] leopard it must be lion
|
||||||
|
Reference in New Issue
Block a user