Commit 86a5afff authored by Matthias Möller's avatar Matthias Möller

- 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 7a39c72b
......@@ -141,7 +141,6 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
QMainWindow(),
coreSlots_(_coreSlots),
shiftPressed_(false),
fullscreenState_(0),
viewModes_(_viewModes),
viewModeButton_(0),
viewModeMenu_(0),
......@@ -647,69 +646,9 @@ CoreWidget::~CoreWidget() {
void
CoreWidget::toggleFullscreen() {
switch (fullscreenState_){
bool fullScreen = OpenFlipperSettings().value("Core/Gui/fullscreen", false ).toBool();
case 0:
//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();
setFullscreen( !fullScreen );
}
//-----------------------------------------------------------------------------
......@@ -725,11 +664,11 @@ CoreWidget::setFullscreen(bool _state ) {
setWindowState( windowState() ^ Qt::WindowFullScreen);
}
fullscreenState_ = (uint) _state;
OpenFlipperSettings().setValue("Core/Gui/fullscreen", bool( windowState() & Qt::WindowFullScreen) );
show();
emit fullScreenChanged( _state );
}
//-----------------------------------------------------------------------------
......
......@@ -535,10 +535,11 @@ public:
/// will be emitted if the visibility of the menubar is changed
void menuBarVisChanged( bool _state );
/// will be emitted if the fullscreen state is changed (_state = true => in fullscreen)
void fullScreenChanged( bool _state );
private:
OpenFlipper::Options::LoggerState loggerState_;
uint fullscreenState_;
QSize defaultIconSize_;
......
......@@ -514,7 +514,15 @@ void CoreWidget::setupMenuBar()
connect(this,SIGNAL(toolBarVisChanged(bool)),AC_ShowToolBar,SLOT(setChecked(bool)));
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
......
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