1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-03 20:57:52 +02:00

Show Lion full-screen toggle if on Lion

This commit is contained in:
Leo Franchi
2011-09-20 16:40:54 -04:00
parent 5750f51bdd
commit 36738fc9e4
3 changed files with 16 additions and 0 deletions

View File

@@ -43,6 +43,7 @@ void setShortcutHandler(Tomahawk::MacShortcutHandler* engine);
// used for opening files with tomahawk // used for opening files with tomahawk
void setApplicationHandler(PlatformInterface* handler); void setApplicationHandler(PlatformInterface* handler);
void checkForUpdates(); void checkForUpdates();
void enableFullscreen();
}; };

View File

@@ -20,6 +20,7 @@
#include "macdelegate.h" #include "macdelegate.h"
#include "macshortcuthandler.h" #include "macshortcuthandler.h"
#include "tomahawkapp.h"
#include "config.h" #include "config.h"
#import <AppKit/NSApplication.h> #import <AppKit/NSApplication.h>
@@ -232,3 +233,12 @@ void Tomahawk::checkForUpdates() {
[[SUUpdater sharedUpdater] checkForUpdates: NSApp]; [[SUUpdater sharedUpdater] checkForUpdates: NSApp];
#endif #endif
} }
void Tomahawk::enableFullscreen()
{
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
NSView *nsview = (NSView *)APP->mainWindow()->winId();
NSWindow *nswindow = [nsview window];
[nswindow setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
#endif
}

View File

@@ -267,6 +267,11 @@ TomahawkApp::init()
// check if our spotify playlist api server is up and running, and enable spotify playlist drops if so // check if our spotify playlist api server is up and running, and enable spotify playlist drops if so
QNetworkReply* r = TomahawkUtils::nam()->get( QNetworkRequest( QUrl( SPOTIFY_PLAYLIST_API_URL "/playlist/test" ) ) ); QNetworkReply* r = TomahawkUtils::nam()->get( QNetworkRequest( QUrl( SPOTIFY_PLAYLIST_API_URL "/playlist/test" ) ) );
connect( r, SIGNAL( finished() ), this, SLOT( spotifyApiCheckFinished() ) ); connect( r, SIGNAL( finished() ), this, SLOT( spotifyApiCheckFinished() ) );
#ifdef Q_WS_MAC
// Make sure to do this after main window is inited
Tomahawk::enableFullscreen();
#endif
} }