Commit 10283bf9 authored by Matthias Möller's avatar Matthias Möller
Browse files

- remove second fullscreen state

- add fullscreen button

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@16117 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 1aa5eaba
...@@ -141,7 +141,6 @@ CoreWidget( QVector<ViewMode*>& _viewModes, ...@@ -141,7 +141,6 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
QMainWindow(), QMainWindow(),
coreSlots_(_coreSlots), coreSlots_(_coreSlots),
shiftPressed_(false), shiftPressed_(false),
fullscreenState_(0),
viewModes_(_viewModes), viewModes_(_viewModes),
viewModeButton_(0), viewModeButton_(0),
viewModeMenu_(0), viewModeMenu_(0),
...@@ -647,69 +646,9 @@ CoreWidget::~CoreWidget() { ...@@ -647,69 +646,9 @@ CoreWidget::~CoreWidget() {
void void
CoreWidget::toggleFullscreen() { CoreWidget::toggleFullscreen() {
switch (fullscreenState_){ bool fullScreen = OpenFlipperSettings().value("Core/Gui/fullscreen", false ).toBool();
case 0: setFullscreen( !fullScreen );
//switch to fullscreen
setWindowState( windowState() | Qt::WindowFullScreen);
break;
case 1:
//fullscreen without toolbars
if ( ! (windowState() & Qt::WindowFullScreen) )
setWindowState( windowState() | Qt::WindowFullScreen);
//hide plugin toolbars
for (uint p=0; p < plugins_.size(); p++)
for ( uint j = 0 ; j < plugins_[p].toolbars.size(); ++j ) {
if ( ! plugins_[p].toolbars[j].second->isFloating() )
plugins_[p].toolbars[j].second->hide();
}
//hide main toolbar
if ( ! mainToolbar_->isFloating() )
mainToolbar_->hide();
//hide viewer toolbar
if ( ! viewerToolbar_->isFloating() )
viewerToolbar_->hide();
//hide the menubar
menuBar()->hide();
// hide the statusbar but don't change its last state, as this is only the large fullscreen mode
// that hides everything.
statusBar()->hide();
break;
default:
//disable fullscreen
if ( windowState() & Qt::WindowFullScreen )
setWindowState( windowState() ^ Qt::WindowFullScreen);
//show toolbars
setViewMode( OpenFlipper::Options::currentViewMode() );
//show the menubar
if ( ! OpenFlipperSettings().value("Core/Gui/MenuBar/hidden",false).toBool())
menuBar()->show();
// show the statusbar if this is the requested state
// stored in the properties
if ( ! OpenFlipperSettings().value("Core/Gui/StatusBar/hidden",false).toBool() )
statusBar()->show();
break;
}
fullscreenState_ = (fullscreenState_ + 1) % 3;
OpenFlipperSettings().setValue("Core/Gui/fullscreen", bool( windowState() & Qt::WindowFullScreen) );
show();
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
...@@ -725,11 +664,11 @@ CoreWidget::setFullscreen(bool _state ) { ...@@ -725,11 +664,11 @@ CoreWidget::setFullscreen(bool _state ) {
setWindowState( windowState() ^ Qt::WindowFullScreen); setWindowState( windowState() ^ Qt::WindowFullScreen);
} }
fullscreenState_ = (uint) _state;
OpenFlipperSettings().setValue("Core/Gui/fullscreen", bool( windowState() & Qt::WindowFullScreen) ); OpenFlipperSettings().setValue("Core/Gui/fullscreen", bool( windowState() & Qt::WindowFullScreen) );
show(); show();
emit fullScreenChanged( _state );
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
......
...@@ -535,10 +535,11 @@ public: ...@@ -535,10 +535,11 @@ public:
/// will be emitted if the visibility of the menubar is changed /// will be emitted if the visibility of the menubar is changed
void menuBarVisChanged( bool _state ); void menuBarVisChanged( bool _state );
/// will be emitted if the fullscreen state is changed (_state = true => in fullscreen)
void fullScreenChanged( bool _state );
private: private:
OpenFlipper::Options::LoggerState loggerState_; OpenFlipper::Options::LoggerState loggerState_;
uint fullscreenState_;
QSize defaultIconSize_; QSize defaultIconSize_;
......
...@@ -514,7 +514,15 @@ void CoreWidget::setupMenuBar() ...@@ -514,7 +514,15 @@ void CoreWidget::setupMenuBar()
connect(this,SIGNAL(toolBarVisChanged(bool)),AC_ShowToolBar,SLOT(setChecked(bool))); connect(this,SIGNAL(toolBarVisChanged(bool)),AC_ShowToolBar,SLOT(setChecked(bool)));
windowMenu_->addAction(AC_ShowToolBar); windowMenu_->addAction(AC_ShowToolBar);
// Enable or Disable Fullscreen Mode
QAction* AC_Fullscreen = new QAction(tr("Fullscreen"), this);
AC_Fullscreen->setStatusTip(tr("Enable or Disable the Fullscreen"));
AC_Fullscreen->setWhatsThis(tr("Enable or Disable the Fullscreen"));
AC_Fullscreen->setCheckable(true);
AC_Fullscreen->setChecked( OpenFlipperSettings().value("Core/Gui/fullscreen", false ).toBool() );
connect(AC_Fullscreen,SIGNAL(triggered()),this,SLOT(toggleFullscreen()));
connect(this,SIGNAL(fullScreenChanged(bool)),AC_Fullscreen,SLOT(setChecked(bool)));
windowMenu_->addAction(AC_Fullscreen);
// ====================================================================== // ======================================================================
// Algorithms Menu // Algorithms Menu
......
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