1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-09 21:42:13 +00:00

new keyboard shortcut (T): move focus from scene widget to toolbar

This commit is contained in:
Marc Zinnschlag 2014-07-14 11:19:59 +02:00
parent 688d413b8c
commit 92af093856
4 changed files with 13 additions and 1 deletions

View File

@ -3,6 +3,7 @@
#include <QEvent>
#include <QResizeEvent>
#include <QTimer>
#include <QShortcut>
#include <OgreRoot.h>
#include <OgreRenderWindow.h>
@ -51,7 +52,11 @@ namespace CSVRender
QTimer *timer = new QTimer (this);
connect (timer, SIGNAL (timeout()), this, SLOT (update()));
timer->start (20); /// \todo make this configurable
timer->start (20); ///< \todo make this configurable
/// \todo make shortcut configurable
QShortcut *focusToolbar = new QShortcut (Qt::Key_T, this);
connect (focusToolbar, SIGNAL (activated()), this, SIGNAL (focusToolbarRequest()));
}
CSVWidget::SceneToolMode *SceneWidget::makeLightingSelector (CSVWidget::SceneToolbar *parent)

View File

@ -111,6 +111,10 @@ namespace CSVRender
void update();
void selectLightingMode (const std::string& mode);
signals:
void focusToolbarRequest();
};
}

View File

@ -46,6 +46,7 @@ CSVWorld::PreviewSubView::PreviewSubView (const CSMWorld::UniversalId& id, CSMDo
connect (mScene, SIGNAL (closeRequest()), this, SLOT (closeRequest()));
connect (mScene, SIGNAL (referenceableIdChanged (const std::string&)),
this, SLOT (referenceableIdChanged (const std::string&)));
connect (mScene, SIGNAL (focusToolbarRequest()), toolbar, SLOT (setFocus()));
}
void CSVWorld::PreviewSubView::setEditLock (bool locked) {}

View File

@ -238,6 +238,8 @@ void CSVWorld::SceneSubView::replaceToolbarAndWorldspace (CSVRender::WorldspaceW
mScene = widget;
mToolbar = toolbar;
connect (mScene, SIGNAL (focusToolbarRequest()), mToolbar, SLOT (setFocus()));
mLayout->addWidget (mToolbar, 0);
mLayout->addWidget (mScene, 1);