mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 15:50:37 +02:00
Hide the cursor when in fullscreen Oculus mode.
This commit is contained in:
parent
9be4f06e9a
commit
add84b2f39
2 changed files with 9 additions and 0 deletions
|
@ -1002,6 +1002,7 @@ void Application::setNoise(bool noise) {
|
||||||
void Application::setFullscreen(bool fullscreen) {
|
void Application::setFullscreen(bool fullscreen) {
|
||||||
_window->setWindowState(fullscreen ? (_window->windowState() | Qt::WindowFullScreen) :
|
_window->setWindowState(fullscreen ? (_window->windowState() | Qt::WindowFullScreen) :
|
||||||
(_window->windowState() & ~Qt::WindowFullScreen));
|
(_window->windowState() & ~Qt::WindowFullScreen));
|
||||||
|
updateCursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::setRenderFirstPerson(bool firstPerson) {
|
void Application::setRenderFirstPerson(bool firstPerson) {
|
||||||
|
@ -1010,6 +1011,7 @@ void Application::setRenderFirstPerson(bool firstPerson) {
|
||||||
|
|
||||||
void Application::setOculus(bool oculus) {
|
void Application::setOculus(bool oculus) {
|
||||||
resizeGL(_glWidget->width(), _glWidget->height());
|
resizeGL(_glWidget->width(), _glWidget->height());
|
||||||
|
updateCursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::setFrustumOffset(bool frustumOffset) {
|
void Application::setFrustumOffset(bool frustumOffset) {
|
||||||
|
@ -2080,6 +2082,11 @@ void Application::setMenuShortcutsEnabled(bool enabled) {
|
||||||
setShortcutsEnabled(_window->menuBar(), enabled);
|
setShortcutsEnabled(_window->menuBar(), enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Application::updateCursor() {
|
||||||
|
_glWidget->setCursor(_oculusOn->isChecked() && _window->windowState().testFlag(Qt::WindowFullScreen) ?
|
||||||
|
Qt::BlankCursor : Qt::ArrowCursor);
|
||||||
|
}
|
||||||
|
|
||||||
// when QActionGroup is set to non-exclusive, it doesn't return anything as checked;
|
// when QActionGroup is set to non-exclusive, it doesn't return anything as checked;
|
||||||
// hence, we must check ourselves
|
// hence, we must check ourselves
|
||||||
QAction* Application::checkedVoxelModeAction() const {
|
QAction* Application::checkedVoxelModeAction() const {
|
||||||
|
|
|
@ -128,6 +128,8 @@ private:
|
||||||
|
|
||||||
void setMenuShortcutsEnabled(bool enabled);
|
void setMenuShortcutsEnabled(bool enabled);
|
||||||
|
|
||||||
|
void updateCursor();
|
||||||
|
|
||||||
QAction* checkedVoxelModeAction() const;
|
QAction* checkedVoxelModeAction() const;
|
||||||
|
|
||||||
static void attachNewHeadToAgent(Agent *newAgent);
|
static void attachNewHeadToAgent(Agent *newAgent);
|
||||||
|
|
Loading…
Reference in a new issue