Commit 1aa5eaba authored by Matthias Möller's avatar Matthias Möller

- add some buttons changing gui widgets

- fix: widget buttons will be checked/unchecked if corresponding widget is changed via hotkey

refs #1380

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@16116 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 21f2590f
......@@ -151,7 +151,6 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
helpMenu_(0),
windowMenu_(0),
AC_ShowViewModeControls_(0),
AC_ShowToolbox_(0),
pickToolBarExternal_(0),
cursorPainter_(0),
sceneGraphDialog_(0),
......@@ -789,26 +788,30 @@ CoreWidget::showToolbox( bool _state ) {
//show last view mode
toolBoxArea_->setVisible(true);
}
emit toolBoxVisChanged(_state);
}
//-----------------------------------------------------------------------------
/// Hide or show menu bar
void CoreWidget::toogleMenuBar()
void CoreWidget::showMenuBar( bool _state )
{
bool hidden = OpenFlipperSettings().value("Core/Gui/MenuBar/hidden",false).toBool();
if ( hidden )
OpenFlipperSettings().setValue("Core/Gui/MenuBar/hidden",!_state);
if ( _state ){
//hide ViewMode Selection Widget
menuBar()->show();
else
}else{
//show last view mode
menuBar()->hide();
OpenFlipperSettings().setValue("Core/Gui/MenuBar/hidden",!hidden);
}
emit menuBarVisChanged(_state);
}
//-----------------------------------------------------------------------------
/// Hide or show current toolbar
void CoreWidget::toggleToolbar()
/// Show or hide toolbar
void CoreWidget::showToolBar( bool _state )
{
bool hidden = OpenFlipperSettings().value("Core/Gui/Toolbar/hidden",false).toBool();
OpenFlipperSettings().setValue("Core/Gui/Toolbar/hidden",!hidden);
if ( !hidden )
OpenFlipperSettings().setValue("Core/Gui/Toolbar/hidden",!_state);
if ( !_state )
{
//hide main toolbar
if ( ! mainToolbar_->isFloating() )
......@@ -829,6 +832,22 @@ void CoreWidget::toggleToolbar()
//show toolbars
setViewMode( OpenFlipper::Options::currentViewMode() );
}
emit toolBarVisChanged(_state);
}
//-----------------------------------------------------------------------------
/// Hide or show menubar
void CoreWidget::toggleMenuBar()
{
bool hidden = OpenFlipperSettings().value("Core/Gui/MenuBar/hidden",false).toBool();
showMenuBar( hidden );
}
//-----------------------------------------------------------------------------
/// Hide or show current toolbar
void CoreWidget::toggleToolBar()
{
bool hidden = OpenFlipperSettings().value("Core/Gui/Toolbar/hidden",false).toBool();
showToolBar( hidden );
}
......
......@@ -473,6 +473,20 @@ public:
//===========================================================================
public :
/// Show logger in splitter or not
void showLoggerInSplitView(bool _show);
/// Set in-scene logger geometry right
void updateInSceneLoggerGeometry();
/// Use native or gl painted cursor
void setForceNativeCursor ( bool _state );
QSize defaultIconSize();
public slots:
/// Set application to Fullscreen and back
void toggleFullscreen();
......@@ -485,36 +499,41 @@ public:
/// Change visibility of the logger
void showLogger(OpenFlipper::Options::LoggerState _state);
/// Show logger in splitter or not
void showLoggerInSplitView(bool _show);
/// Set in-scene logger geometry right
void updateInSceneLoggerGeometry();
/// Hide or show toolbox area
void toggleToolbox();
/// Hide or show menu bar
void toogleMenuBar();
//Hide or show current toolbar
void toggleToolbar();
/// Show or hide toolbox
void showToolbox( bool _state );
/// Change visibility of the Status Bar
void toggleStatusBar();
/// Use native or gl painted cursor
void setForceNativeCursor ( bool _state );
/// Show or hide status bar
void showStatusBar( bool _state );
QSize defaultIconSize();
/// Show or hide menubar
void showMenuBar( bool _state );
public slots:
/// Show or hide toolbox
void showToolbox( bool _state );
/// Hide or show menu bar
void toggleMenuBar();
/// Show or hide status bar
void showStatusBar( bool _state );
/// Hide or show current toolbar
void toggleToolBar();
/// Show or hide toolbar, emits toolBarToggled( bool _state )
void showToolBar( bool _state );
signals:
/// will be emitted if the visibility of the toolbar is changed
void toolBarVisChanged( bool _state );
/// will be emitted if the visibility of the toolbox is changed
void toolBoxVisChanged( bool _state );
/// will be emitted if the visibility of the statusbar is changed
void statusBarVisChanged( bool _state );
/// will be emitted if the visibility of the menubar is changed
void menuBarVisChanged( bool _state );
private:
OpenFlipper::Options::LoggerState loggerState_;
......@@ -653,9 +672,6 @@ public:
/// Action for View Mode Widget Conrol in Menu
QAction* AC_ShowViewModeControls_;
/// Action for View Mode Widget Conrol in Menu
QAction* AC_ShowToolbox_;
/// gl widget used as drawing area to paint the graphics scene
QGLWidget* glWidget_;
......
......@@ -474,14 +474,46 @@ void CoreWidget::setupMenuBar()
windowMenu_->addAction(AC_ShowViewModeControls_);
// Show or Hide the View Mode Controls
AC_ShowToolbox_ = new QAction(tr("Show Toolboxes"), this);
AC_ShowToolbox_->setStatusTip(tr("Show or Hide the Toolbox Widget"));
QAction* AC_ShowToolbox = new QAction(tr("Show Toolboxes"), this);
AC_ShowToolbox->setStatusTip(tr("Show or Hide the Toolbox Widget"));
// AC_HelpBrowser->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"help-browser.png"));
AC_ShowToolbox_->setWhatsThis(tr("Show or Hide the Toolbox Widget"));
AC_ShowToolbox_->setCheckable(true);
AC_ShowToolbox_->setChecked( ! OpenFlipperSettings().value("Core/Gui/ToolBoxes/hidden",false).toBool() );
connect(AC_ShowToolbox_, SIGNAL( toggled( bool )), this, SLOT(showToolbox(bool)));
windowMenu_->addAction(AC_ShowToolbox_);
AC_ShowToolbox->setWhatsThis(tr("Show or Hide the Toolbox Widget"));
AC_ShowToolbox->setCheckable(true);
AC_ShowToolbox->setChecked( ! OpenFlipperSettings().value("Core/Gui/ToolBoxes/hidden",false).toBool() );
connect(AC_ShowToolbox, SIGNAL( triggered()), this, SLOT(toggleToolbox()));
connect(this,SIGNAL(toolBoxVisChanged(bool)),AC_ShowToolbox,SLOT(setChecked(bool)));
windowMenu_->addAction(AC_ShowToolbox);
// Show or Hide the Status bar
QAction* AC_ShowStatusBar = new QAction(tr("Show Statusbar"), this);
AC_ShowStatusBar->setStatusTip(tr("Show or Hide the Statusbar"));
AC_ShowStatusBar->setWhatsThis(tr("Show or Hide the Statusbar"));
AC_ShowStatusBar->setCheckable(true);
AC_ShowStatusBar->setChecked( !OpenFlipperSettings().value("Core/Gui/StatusBar/hidden",false).toBool());
connect(AC_ShowStatusBar,SIGNAL(triggered()),this,SLOT(toggleStatusBar()));
connect(this,SIGNAL(statusBarVisChanged(bool)),AC_ShowStatusBar,SLOT(setChecked(bool)));
windowMenu_->addAction(AC_ShowStatusBar);
// Show or Hide the Menu bar
QAction* AC_ShowMenuBar = new QAction(tr("Show Menubar"), this);
AC_ShowMenuBar->setStatusTip(tr("Show or Hide the Menubar"));
AC_ShowMenuBar->setWhatsThis(tr("Show or Hide the Menubar"));
AC_ShowMenuBar->setCheckable(true);
AC_ShowMenuBar->setChecked( !OpenFlipperSettings().value("Core/Gui/MenuBar/hidden",false).toBool());
connect(AC_ShowMenuBar,SIGNAL(triggered()),this,SLOT(toggleMenuBar()));
connect(this,SIGNAL(menuBarVisChanged(bool)),AC_ShowMenuBar,SLOT(setChecked(bool)));
windowMenu_->addAction(AC_ShowMenuBar);
// Show or Hide the Tool bar
QAction* AC_ShowToolBar = new QAction(tr("Show Toolbar"), this);
AC_ShowToolBar->setStatusTip(tr("Show or Hide the Toolbar"));
AC_ShowToolBar->setWhatsThis(tr("Show or Hide the Toolbar"));
AC_ShowToolBar->setCheckable(true);
AC_ShowToolBar->setChecked( !OpenFlipperSettings().value("Core/Gui/ToolBar/hidden",false).toBool());
connect(AC_ShowToolBar,SIGNAL(triggered()),this,SLOT(toggleToolBar()));
connect(this,SIGNAL(toolBarVisChanged(bool)),AC_ShowToolBar,SLOT(setChecked(bool)));
windowMenu_->addAction(AC_ShowToolBar);
// ======================================================================
......
......@@ -162,6 +162,7 @@ CoreWidget::showStatusBar( bool _state ) {
}else{
statusBar_->setVisible(true);
}
emit statusBarVisChanged(_state);
}
//=============================================================================
......@@ -603,11 +603,11 @@ void CoreWidget::coreKeyPressEvent (QKeyEvent* _e){
return;
case Qt::Key_M :
toogleMenuBar();
toggleMenuBar();
return;
case Qt::Key_N:
toggleToolbar();
toggleToolBar();
return;
case Qt::Key_O :
......
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