Commit 7a39c72b 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 aeedf07d
...@@ -151,7 +151,6 @@ CoreWidget( QVector<ViewMode*>& _viewModes, ...@@ -151,7 +151,6 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
helpMenu_(0), helpMenu_(0),
windowMenu_(0), windowMenu_(0),
AC_ShowViewModeControls_(0), AC_ShowViewModeControls_(0),
AC_ShowToolbox_(0),
pickToolBarExternal_(0), pickToolBarExternal_(0),
cursorPainter_(0), cursorPainter_(0),
sceneGraphDialog_(0), sceneGraphDialog_(0),
...@@ -789,26 +788,30 @@ CoreWidget::showToolbox( bool _state ) { ...@@ -789,26 +788,30 @@ CoreWidget::showToolbox( bool _state ) {
//show last view mode //show last view mode
toolBoxArea_->setVisible(true); toolBoxArea_->setVisible(true);
} }
emit toolBoxVisChanged(_state);
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
/// Hide or show menu bar void CoreWidget::showMenuBar( bool _state )
void CoreWidget::toogleMenuBar()
{ {
bool hidden = OpenFlipperSettings().value("Core/Gui/MenuBar/hidden",false).toBool(); OpenFlipperSettings().setValue("Core/Gui/MenuBar/hidden",!_state);
if ( hidden )
if ( _state ){
//hide ViewMode Selection Widget
menuBar()->show(); menuBar()->show();
else
}else{
//show last view mode
menuBar()->hide(); menuBar()->hide();
OpenFlipperSettings().setValue("Core/Gui/MenuBar/hidden",!hidden); }
emit menuBarVisChanged(_state);
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
/// Hide or show current toolbar /// Show or hide toolbar
void CoreWidget::toggleToolbar() void CoreWidget::showToolBar( bool _state )
{ {
bool hidden = OpenFlipperSettings().value("Core/Gui/Toolbar/hidden",false).toBool(); OpenFlipperSettings().setValue("Core/Gui/Toolbar/hidden",!_state);
OpenFlipperSettings().setValue("Core/Gui/Toolbar/hidden",!hidden); if ( !_state )
if ( !hidden )
{ {
//hide main toolbar //hide main toolbar
if ( ! mainToolbar_->isFloating() ) if ( ! mainToolbar_->isFloating() )
...@@ -829,6 +832,22 @@ void CoreWidget::toggleToolbar() ...@@ -829,6 +832,22 @@ void CoreWidget::toggleToolbar()
//show toolbars //show toolbars
setViewMode( OpenFlipper::Options::currentViewMode() ); 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: ...@@ -473,6 +473,20 @@ public:
//=========================================================================== //===========================================================================
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 /// Set application to Fullscreen and back
void toggleFullscreen(); void toggleFullscreen();
...@@ -485,36 +499,41 @@ public: ...@@ -485,36 +499,41 @@ public:
/// Change visibility of the logger /// Change visibility of the logger
void showLogger(OpenFlipper::Options::LoggerState _state); 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 /// Hide or show toolbox area
void toggleToolbox(); void toggleToolbox();
/// Hide or show menu bar /// Show or hide toolbox
void toogleMenuBar(); void showToolbox( bool _state );
//Hide or show current toolbar
void toggleToolbar();
/// Change visibility of the Status Bar /// Change visibility of the Status Bar
void toggleStatusBar(); void toggleStatusBar();
/// Use native or gl painted cursor /// Show or hide status bar
void setForceNativeCursor ( bool _state ); void showStatusBar( bool _state );
QSize defaultIconSize(); /// Show or hide menubar
void showMenuBar( bool _state );
public slots: /// Hide or show menu bar
void toggleMenuBar();
/// Show or hide toolbox
void showToolbox( bool _state );
/// Show or hide status bar /// Hide or show current toolbar
void showStatusBar( bool _state ); 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: private:
OpenFlipper::Options::LoggerState loggerState_; OpenFlipper::Options::LoggerState loggerState_;
...@@ -653,9 +672,6 @@ public: ...@@ -653,9 +672,6 @@ public:
/// Action for View Mode Widget Conrol in Menu /// Action for View Mode Widget Conrol in Menu
QAction* AC_ShowViewModeControls_; 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 /// gl widget used as drawing area to paint the graphics scene
QGLWidget* glWidget_; QGLWidget* glWidget_;
......
...@@ -474,14 +474,46 @@ void CoreWidget::setupMenuBar() ...@@ -474,14 +474,46 @@ void CoreWidget::setupMenuBar()
windowMenu_->addAction(AC_ShowViewModeControls_); windowMenu_->addAction(AC_ShowViewModeControls_);
// Show or Hide the View Mode Controls // Show or Hide the View Mode Controls
AC_ShowToolbox_ = new QAction(tr("Show Toolboxes"), this); QAction* AC_ShowToolbox = new QAction(tr("Show Toolboxes"), this);
AC_ShowToolbox_->setStatusTip(tr("Show or Hide the Toolbox Widget")); AC_ShowToolbox->setStatusTip(tr("Show or Hide the Toolbox Widget"));
// AC_HelpBrowser->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"help-browser.png")); // 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->setWhatsThis(tr("Show or Hide the Toolbox Widget"));
AC_ShowToolbox_->setCheckable(true); AC_ShowToolbox->setCheckable(true);
AC_ShowToolbox_->setChecked( ! OpenFlipperSettings().value("Core/Gui/ToolBoxes/hidden",false).toBool() ); AC_ShowToolbox->setChecked( ! OpenFlipperSettings().value("Core/Gui/ToolBoxes/hidden",false).toBool() );
connect(AC_ShowToolbox_, SIGNAL( toggled( bool )), this, SLOT(showToolbox(bool))); connect(AC_ShowToolbox, SIGNAL( triggered()), this, SLOT(toggleToolbox()));
windowMenu_->addAction(AC_ShowToolbox_); 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 ) { ...@@ -162,6 +162,7 @@ CoreWidget::showStatusBar( bool _state ) {
}else{ }else{
statusBar_->setVisible(true); statusBar_->setVisible(true);
} }
emit statusBarVisChanged(_state);
} }
//============================================================================= //=============================================================================
...@@ -603,11 +603,11 @@ void CoreWidget::coreKeyPressEvent (QKeyEvent* _e){ ...@@ -603,11 +603,11 @@ void CoreWidget::coreKeyPressEvent (QKeyEvent* _e){
return; return;
case Qt::Key_M : case Qt::Key_M :
toogleMenuBar(); toggleMenuBar();
return; return;
case Qt::Key_N: case Qt::Key_N:
toggleToolbar(); toggleToolBar();
return; return;
case Qt::Key_O : 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