Commit faceecb5 authored by Victor Yacovlev's avatar Victor Yacovlev

Toggle fullscreen button for MacOS 10.7

parent 05dc4375
......@@ -14,6 +14,16 @@ set(SOURCES
pascalprogram.cpp
)
set(EXTRA_LIBS
)
if(APPLE)
set(SOURCES ${SOURCES}
mac-fixes.mm
)
find_library(COCOA_LIBRARY Cocoa)
set(EXTRA_LIBS ${COCOA_LIBRARY})
endif(APPLE)
set(MOC_HEADERS
mainwindow.h
......@@ -45,7 +55,7 @@ qt4_add_resources(QRC_SOURCES ${RESOURCES})
copySpecFile(CoreGUI)
add_library(CoreGUI SHARED ${UI_SOURCES} ${MOC_SOURCES} ${SOURCES} ${QRC_SOURCES})
handleTranslation(CoreGUI)
target_link_libraries(CoreGUI ${QT_LIBRARIES} ExtensionSystem DataFormats KumirStdLib)
target_link_libraries(CoreGUI ${QT_LIBRARIES} ${EXTRA_LIBS} ExtensionSystem DataFormats KumirStdLib)
copyResources(coregui)
install(TARGETS CoreGUI DESTINATION ${PLUGINS_DIR})
#ifndef __MAC_FIXES_H
#define __MAC_FIXES_H
class MacFixes {
public:
static void setLionFullscreenButton(void * nsview);
};
#endif
#import <Cocoa/Cocoa.h>
#include "mac-fixes.h"
void MacFixes::setLionFullscreenButton(void * nsviewptr) {
NSView * nsview = (NSView*)nsviewptr;
NSWindow *nswindow = [nsview window];
[nswindow setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
}
......@@ -3,6 +3,9 @@
#include "extensionsystem/pluginmanager.h"
#include "kumirvariableswebobject.h"
#include "ui_mainwindow.h"
#ifdef Q_OS_MACX
#include "mac-fixes.h"
#endif
namespace CoreGUI {
......@@ -61,6 +64,11 @@ QString Plugin::initialize(const QStringList & parameters)
m_kumirStateLabel = new QLabel();
m_genericCounterLabel = new QLabel();
m_mainWindow = new MainWindow(this);
#ifdef Q_OS_MACX
void * mac_mainWindow = (class NSView*)(m_mainWindow->winId());
MacFixes::setLionFullscreenButton(mac_mainWindow);
#endif
plugin_editor = qobject_cast<EditorInterface*>(myDependency("Editor"));
plugin_BytecodeGenerator = qobject_cast<GeneratorInterface*>(myDependency("KumirCodeGenerator"));
......
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