Commit 739734cf authored by Jan Möbius's avatar Jan Möbius

Added functions and kes (ctrl+b) to show and hide status bar



git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@11971 383ad7c9-94d9-4d36-a494-682f7c89f535
parent d7f69038
......@@ -971,6 +971,15 @@ void Core::showToolbox( bool _state ) {
coreWidget_->showToolbox(_state);
}
//-----------------------------------------------------------------------------
void Core::showStatusBar( bool _state ) {
if ( OpenFlipper::Options::gui() )
coreWidget_->showStatusBar(_state);
}
//-----------------------------------------------------------------------------
void Core::multiViewMode( int _mode ) {
if ( !OpenFlipper::Options::gui() || !OpenFlipperSettings().value("Core/Gui/glViewer/useMultipleViewers",true).toBool() )
return;
......@@ -1388,6 +1397,7 @@ void Core::setDescriptions(){
emit setSlotDescription("loggerState(int)", tr("Change the logger window state"), QStringList(tr("Change the logger window state")), QStringList());
emit setSlotDescription("enableOpenMeshErrorLog(bool)", tr("Enable or disable OpenMesh error logging"), QStringList(tr("OpenMesh error logging enabled")), QStringList());
emit setSlotDescription("showToolbox(bool)", tr("Show or hide toolbox"), QStringList(tr("Show or hide the toolbox")), QStringList());
emit setSlotDescription("showStatusBar(bool)", tr("Show or hide status bar"), QStringList(tr("Show or hide the status bar")), QStringList());
emit setSlotDescription("multiViewMode(int)", tr("Switch MultiView Mode"),
QStringList(tr("Mode")), QStringList(tr("0: One Viewer\n 1: Grid \n 2: Horizontal split")));
......
......@@ -634,6 +634,9 @@ public slots:
/// Show or hide toolbox
void showToolbox( bool _state );
/// Show or hide Status Bar
void showStatusBar( bool _state );
/// Switch the multiView Mode
void multiViewMode( int _mode );
......
......@@ -911,6 +911,7 @@ CoreWidget::showToolbox( bool _state ) {
}
}
//=============================================================================
void CoreWidget::setToolBoxOrientationOnTheRight(bool _toolBoxRight) {
......
......@@ -473,6 +473,9 @@ public:
/// Hide or show toolbox area
void toggleToolbox();
/// Change visibility of the Status Bar
void toggleStatusBar();
/// Use native or gl painted cursor
void setForceNativeCursor ( bool _state );
......@@ -483,6 +486,9 @@ public:
/// Show or hide toolbox
void showToolbox( bool _state );
/// Show or hide status bar
void showStatusBar( bool _state );
private:
OpenFlipper::Options::LoggerState loggerState_;
......
......@@ -133,4 +133,32 @@ void CoreWidget::addWidgetToStatusbar(QWidget* _widget){
}
//-----------------------------------------------------------------------------
/** Hide or show Status bar
*/
void
CoreWidget::toggleStatusBar() {
//toggle
showStatusBar( OpenFlipperSettings().value("Core/Gui/StatusBar/hidden",false).toBool() );
}
//-----------------------------------------------------------------------------
/** Hide or show Status bar
*/
void
CoreWidget::showStatusBar( bool _state ) {
//toggle
OpenFlipperSettings().setValue("Core/Gui/StatusBar/hidden",!_state);
if ( OpenFlipperSettings().value("Core/Gui/StatusBar/hidden",false).toBool() ){
statusBar_->setVisible(false);
}else{
statusBar_->setVisible(true);
}
}
//=============================================================================
......@@ -522,30 +522,33 @@ void CoreWidget::registerCoreKeys() {
this , SLOT(slotRegisterKey(int, Qt::KeyboardModifiers, QString, bool)) );
emit registerKey(Qt::Key_Print , Qt::NoModifier, "Create Snapshot");
emit registerKey(Qt::Key_Escape , Qt::NoModifier, "Switch to last action mode ( Move,Picking,Light or Info Mode)");
emit registerKey(Qt::Key_Space , Qt::NoModifier, "Toggle between multiview and single view");
emit registerKey(Qt::Key_S , Qt::ControlModifier, "Save Object");
emit registerKey(Qt::Key_O , Qt::ControlModifier, "Open Object");
emit registerKey(Qt::Key_L , Qt::ControlModifier, "Show/Hide Logger");
emit registerKey(Qt::Key_T , Qt::ControlModifier, "Show/Hide Toolbox");
emit registerKey(Qt::Key_F , Qt::ControlModifier, "Toggle Fullscreen");
emit registerKey(Qt::Key_Escape , Qt::NoModifier, "Switch to last action mode ( Move,Picking,Light or Info Mode)");
emit registerKey(Qt::Key_Space , Qt::NoModifier, "Toggle between multiview and single view");
emit registerKey(Qt::Key_B , Qt::ControlModifier, "Show/Hide StatusBar");
if ( OpenFlipper::Options::isLinux() ) {
emit registerKey(Qt::Key_Meta , Qt::MetaModifier, "Use Navigation mode while key is pressed");
emit registerKey(Qt::Key_Meta , Qt::NoModifier, "Use Navigation mode while key is pressed");
} else {
emit registerKey(Qt::Key_Alt , Qt::AltModifier, "Use Navigation mode while key is pressed");
emit registerKey(Qt::Key_Alt , Qt::NoModifier, "Use Navigation mode while key is pressed");
emit registerKey(Qt::Key_Alt , Qt::AltModifier, "Use Navigation mode while key is pressed");
emit registerKey(Qt::Key_Alt , Qt::NoModifier, "Use Navigation mode while key is pressed");
}
emit registerKey(Qt::Key_Shift , Qt::ShiftModifier, "Apply context menu action to all Viewers", true);
emit registerKey(Qt::Key_Shift , Qt::NoModifier, "Apply context menu action to all Viewers", true);
emit registerKey(Qt::Key_A , Qt::NoModifier, "First Person view strafe left");
emit registerKey(Qt::Key_D , Qt::NoModifier, "First Person view strafe right");
emit registerKey(Qt::Key_W , Qt::NoModifier, "First Person view move forward");
emit registerKey(Qt::Key_S , Qt::NoModifier, "First Person view move back");
emit registerKey(Qt::Key_A , Qt::NoModifier, "First Person view strafe left");
emit registerKey(Qt::Key_D , Qt::NoModifier, "First Person view strafe right");
emit registerKey(Qt::Key_W , Qt::NoModifier, "First Person view move forward");
emit registerKey(Qt::Key_S , Qt::NoModifier, "First Person view move back");
}
......@@ -570,6 +573,10 @@ void CoreWidget::coreKeyPressEvent (QKeyEvent* _e){
if (_e->modifiers() & Qt::ControlModifier ) {
switch (_e->key()) {
case Qt::Key_B :
toggleStatusBar();
return;
case Qt::Key_F :
toggleFullscreen();
return;
......
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