mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 15:30:38 +02:00
Merge pull request #5571 from ZappoMan/hmdToolsRedux
remove HMD Tools as menu item, automatically hide/show it when display plugin is an hmd
This commit is contained in:
commit
9706a44ca1
5 changed files with 10 additions and 18 deletions
|
@ -4729,6 +4729,11 @@ void Application::updateDisplayMode() {
|
||||||
if (oldDisplayPlugin) {
|
if (oldDisplayPlugin) {
|
||||||
oldDisplayPlugin->deactivate();
|
oldDisplayPlugin->deactivate();
|
||||||
_offscreenContext->makeCurrent();
|
_offscreenContext->makeCurrent();
|
||||||
|
|
||||||
|
// if the old plugin was HMD and the new plugin is not HMD, then hide our hmdtools
|
||||||
|
if (oldDisplayPlugin->isHmd() && !newDisplayPlugin->isHmd()) {
|
||||||
|
DependencyManager::get<DialogsManager>()->hmdTools(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
emit activeDisplayPluginChanged();
|
emit activeDisplayPluginChanged();
|
||||||
resetSensors();
|
resetSensors();
|
||||||
|
|
|
@ -289,16 +289,6 @@ Menu::Menu() {
|
||||||
addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::CenterPlayerInView,
|
addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::CenterPlayerInView,
|
||||||
0, false, qApp, SLOT(rotationModeChanged()));
|
0, false, qApp, SLOT(rotationModeChanged()));
|
||||||
|
|
||||||
addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::HMDTools,
|
|
||||||
#ifdef Q_OS_MAC
|
|
||||||
Qt::META | Qt::Key_H,
|
|
||||||
#else
|
|
||||||
Qt::CTRL | Qt::Key_H,
|
|
||||||
#endif
|
|
||||||
false,
|
|
||||||
dialogsManager.data(),
|
|
||||||
SLOT(hmdTools(bool)));
|
|
||||||
|
|
||||||
addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::TurnWithHead, 0, false);
|
addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::TurnWithHead, 0, false);
|
||||||
|
|
||||||
addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::StandingHMDSensorMode, 0, false,
|
addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::StandingHMDSensorMode, 0, false,
|
||||||
|
|
|
@ -199,7 +199,6 @@ namespace MenuOption {
|
||||||
const QString FullscreenMirror = "Fullscreen Mirror";
|
const QString FullscreenMirror = "Fullscreen Mirror";
|
||||||
const QString GlowWhenSpeaking = "Glow When Speaking";
|
const QString GlowWhenSpeaking = "Glow When Speaking";
|
||||||
const QString HandMouseInput = "Enable Hand Mouse Input";
|
const QString HandMouseInput = "Enable Hand Mouse Input";
|
||||||
const QString HMDTools = "HMD Tools";
|
|
||||||
const QString IncreaseAvatarSize = "Increase Avatar Size";
|
const QString IncreaseAvatarSize = "Increase Avatar Size";
|
||||||
const QString IndependentMode = "Independent Mode";
|
const QString IndependentMode = "Independent Mode";
|
||||||
const QString InputMenu = "Avatar>Input Devices";
|
const QString InputMenu = "Avatar>Input Devices";
|
||||||
|
|
|
@ -173,7 +173,6 @@ void DialogsManager::hmdTools(bool showTools) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogsManager::hmdToolsClosed() {
|
void DialogsManager::hmdToolsClosed() {
|
||||||
Menu::getInstance()->getActionForOption(MenuOption::HMDTools)->setChecked(false);
|
|
||||||
_hmdToolsDialog->hide();
|
_hmdToolsDialog->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,8 +30,9 @@
|
||||||
static const int WIDTH = 350;
|
static const int WIDTH = 350;
|
||||||
static const int HEIGHT = 100;
|
static const int HEIGHT = 100;
|
||||||
|
|
||||||
|
|
||||||
HMDToolsDialog::HMDToolsDialog(QWidget* parent) :
|
HMDToolsDialog::HMDToolsDialog(QWidget* parent) :
|
||||||
QDialog(parent, Qt::Window | Qt::WindowCloseButtonHint | Qt::WindowStaysOnTopHint)
|
QDialog(parent, Qt::Window | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowStaysOnTopHint)
|
||||||
{
|
{
|
||||||
// FIXME do we want to support more than one connected HMD? It seems like a pretty corner case
|
// FIXME do we want to support more than one connected HMD? It seems like a pretty corner case
|
||||||
foreach(auto displayPlugin, PluginManager::getInstance()->getDisplayPlugins()) {
|
foreach(auto displayPlugin, PluginManager::getInstance()->getDisplayPlugins()) {
|
||||||
|
@ -171,14 +172,12 @@ void HMDToolsDialog::leaveHMDMode() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void HMDToolsDialog::reject() {
|
void HMDToolsDialog::reject() {
|
||||||
// Just regularly close upon ESC
|
// We don't want this window to be closable from a close icon, just from our "Leave HMD Mode" button
|
||||||
close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void HMDToolsDialog::closeEvent(QCloseEvent* event) {
|
void HMDToolsDialog::closeEvent(QCloseEvent* event) {
|
||||||
// TODO: consider if we want to prevent closing of this window with event->ignore();
|
// We don't want this window to be closable from a close icon, just from our "Leave HMD Mode" button
|
||||||
QDialog::closeEvent(event);
|
event->ignore();
|
||||||
emit closed();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void HMDToolsDialog::centerCursorOnWidget(QWidget* widget) {
|
void HMDToolsDialog::centerCursorOnWidget(QWidget* widget) {
|
||||||
|
|
Loading…
Reference in a new issue