Skip to content
Snippets Groups Projects
Commit 208283d7 authored by Oliver Bock's avatar Oliver Bock
Browse files

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

parent 251f7619
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment