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 @@
#include "pulsatingscience.h"
#ifdef __APPLE__
#include "/System/Library/Frameworks/Carbon.framework/Versions/A/Headers/Carbon.h"
#endif
PulsatingScience::PulsatingScience(QWidget *parent) : QMainWindow(parent)
{
ui.setupUi(this);
......@@ -32,7 +36,7 @@ PulsatingScience::PulsatingScience(QWidget *parent) : QMainWindow(parent)
// inital status (based on GUI)
m_permanentOrbits = ui.actionPermanent_orbits->isChecked();
m_rotationAxesVisible = ui.actionRotationAxes->isChecked();
m_menuBarVisible = ui.actionMenu_bar->isChecked();
m_menuBarVisible = ui.actionMenu_bar->isChecked();
m_statusBarVisible = ui.actionStatus_bar->isChecked();
m_animControlVisible = true;
m_animControlFloating = ui.dockAnimControl->isFloating();
......@@ -438,13 +442,34 @@ void PulsatingScience::updatePulsarSemiMajorAxisValue(double value)
void PulsatingScience::toggleHiddenDemoMode()
{
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);
ui.actionMenu_bar->setChecked(true);
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;
}
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);
ui.actionMenu_bar->setChecked(false);
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