Commit 208283d7 authored by Oliver Bock's avatar Oliver Bock

Added Bernd's patch for Mac OS X kiosk mode (setting normally redundant window states/flags)

parent 251f7619
...@@ -20,6 +20,10 @@ ...@@ -20,6 +20,10 @@
#include "pulsatingscience.h" #include "pulsatingscience.h"
#ifdef __APPLE__
#include "/System/Library/Frameworks/Carbon.framework/Versions/A/Headers/Carbon.h"
#endif
PulsatingScience::PulsatingScience(QWidget *parent) : QMainWindow(parent) PulsatingScience::PulsatingScience(QWidget *parent) : QMainWindow(parent)
{ {
ui.setupUi(this); ui.setupUi(this);
...@@ -438,13 +442,34 @@ void PulsatingScience::updatePulsarSemiMajorAxisValue(double value) ...@@ -438,13 +442,34 @@ void PulsatingScience::updatePulsarSemiMajorAxisValue(double value)
void PulsatingScience::toggleHiddenDemoMode() void PulsatingScience::toggleHiddenDemoMode()
{ {
if(m_hiddenDemoModeActivated) { if(m_hiddenDemoModeActivated) {
#ifdef __APPLE__
// show Menubar & Dock
SetSystemUIMode(kUIModeNormal, 0);
window()->setWindowFlags(windowFlags()
& ~Qt::FramelessWindowHint
& ~Qt::WindowStaysOnTopHint);
window()->showNormal();
#endif
on_actionMenu_bar_toggled(true); on_actionMenu_bar_toggled(true);
ui.actionMenu_bar->setChecked(true); ui.actionMenu_bar->setChecked(true);
window()->setWindowState(windowState() & ~Qt::WindowFullScreen); window()->setWindowState(windowState() & ~Qt::WindowFullScreen);
ui.dockAnimControl->setFeatures(QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable); ui.dockAnimControl->setFeatures(QDockWidget::DockWidgetClosable
| QDockWidget::DockWidgetMovable
| QDockWidget::DockWidgetFloatable);
m_hiddenDemoModeActivated = false; m_hiddenDemoModeActivated = false;
} }
else { else {
#ifdef __APPLE__
// hide Menubar & Dock
SetSystemUIMode(kUIModeAllHidden, 0);
// don't ever ask my why this works _only_ in exactly this order on the Mac
window()->setWindowFlags(windowFlags()
| Qt::FramelessWindowHint
| Qt::WindowStaysOnTopHint);
window()->showMaximized();
// might be needed to remove the resize handle on some systems
// window()->setFixedSize(width(), height());
#endif
on_actionMenu_bar_toggled(false); on_actionMenu_bar_toggled(false);
ui.actionMenu_bar->setChecked(false); ui.actionMenu_bar->setChecked(false);
window()->setWindowState(windowState() | Qt::WindowFullScreen); window()->setWindowState(windowState() | Qt::WindowFullScreen);
......
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