diff --git a/src/pulsatingscience.cpp b/src/pulsatingscience.cpp index ec09f43f55ee9141e5be85bae2892bcea2d83ebd..60ae6088e890f8c5038dcdf2f5d45b6ee6786b7b 100644 --- a/src/pulsatingscience.cpp +++ b/src/pulsatingscience.cpp @@ -62,6 +62,8 @@ PulsatingScience::PulsatingScience(QWidget *parent) : QMainWindow(parent) m_menuBarShortcut->setEnabled(false); m_fullscreenShortcut = new QShortcut(ui.actionFullscreen->shortcut(), this); m_fullscreenShortcut->setEnabled(false); + m_fullscreenESCShortcut = new QShortcut(QKeySequence(Qt::Key_Escape), this); + m_fullscreenESCShortcut->setEnabled(false); // register "hidden" demo mode shortcut for IYA2009 exhibition m_hiddenShortcut = new QShortcut(Qt::CTRL + Qt::SHIFT + Qt::ALT + Qt::Key_D, this); @@ -160,6 +162,11 @@ PulsatingScience::~PulsatingScience() delete m_fullscreenShortcut; } + if(m_fullscreenESCShortcut) { + m_fullscreenESCShortcut->disconnect(); + delete m_fullscreenESCShortcut; + } + if(m_hiddenShortcut) { m_hiddenShortcut->disconnect(); delete m_hiddenShortcut; @@ -337,6 +344,9 @@ void PulsatingScience::on_actionFullscreen_toggled(bool checked) // keep visibility setting m_animControlVisible = true; } + + m_fullscreenESCShortcut->setEnabled(true); + connect(m_fullscreenESCShortcut, SIGNAL(activated()), this, SLOT(fullscreenToggled())); } else { window()->setWindowState(windowState() & ~Qt::WindowFullScreen); @@ -346,6 +356,9 @@ void PulsatingScience::on_actionFullscreen_toggled(bool checked) #endif if(m_statusBarVisible) ui.statusbar->show(); if(m_animControlVisible && !m_animControlFloating) ui.dockAnimControl->show(); + + m_fullscreenESCShortcut->disconnect(); + m_fullscreenESCShortcut->setEnabled(false); } } diff --git a/src/pulsatingscience.h b/src/pulsatingscience.h index c4a78392282785be9eb9e8cc4292a241bac76efd..4d9f49b15515e570ed0cf5304b00e14328ace157 100644 --- a/src/pulsatingscience.h +++ b/src/pulsatingscience.h @@ -79,6 +79,7 @@ private: QShortcut *m_rotationAxesShortcut; QShortcut *m_menuBarShortcut; QShortcut *m_fullscreenShortcut; + QShortcut *m_fullscreenESCShortcut; QShortcut *m_hiddenShortcut; bool m_rotationAxesVisible;