Showing the changes to interface/src/Application.cpp (1 of 2 files). Show all
Unified · Split
| @@ -228,6 +228,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 227 unmodified lines | ||
| 228 | 228 | _touchAvgX(0.0f), |
| 229 | 229 | _touchAvgY(0.0f), |
| 230 | 230 | _isTouchPressed(false), |
| 231 | + _cursorVisible(true), | |
| 231 | 232 | _mousePressed(false), |
| 232 | 233 | _enableProcessOctreeThread(true), |
| 233 | 234 | _octreeProcessor(), |
| @@ -1473,6 +1474,8 @@ void Application::setEnableVRMode(bool enableVRMode) { · 1239 unmodified lines | ||
| 1473 | 1474 | |
| 1474 | 1475 | auto glCanvas = DependencyManager::get<GLCanvas>(); |
| 1475 | 1476 | resizeGL(glCanvas->getDeviceWidth(), glCanvas->getDeviceHeight()); |
| 1477 | + | |
| 1478 | + updateCursorVisibility(); | |
| 1476 | 1479 | } |
| 1477 | 1480 | |
| 1478 | 1481 | void Application::setLowVelocityFilter(bool lowVelocityFilter) { |
| @@ -1943,14 +1946,19 @@ void Application::updateCursor(float deltaTime) { · 464 unmodified lines | ||
| 1943 | 1946 | lastMousePos = QCursor::pos(); |
| 1944 | 1947 | } |
| 1945 | 1948 | |
| 1946 | −void Application::setCursorVisible(bool visible) { | |
| 1947 | − if (visible) { | |
| 1948 | − DependencyManager::get<GLCanvas>()->unsetCursor(); | |
| 1949 | − } else { | |
| 1949 | +void Application::updateCursorVisibility() { | |
| 1950 | + if (!_cursorVisible || Menu::getInstance()->isOptionChecked(MenuOption::EnableVRMode)) { | |
| 1950 | 1951 | DependencyManager::get<GLCanvas>()->setCursor(Qt::BlankCursor); |
| 1952 | + } else { | |
| 1953 | + DependencyManager::get<GLCanvas>()->unsetCursor(); | |
| 1951 | 1954 | } |
| 1952 | 1955 | } |
| 1953 | 1956 | |
| 1957 | +void Application::setCursorVisible(bool visible) { | |
| 1958 | + _cursorVisible = visible; | |
| 1959 | + updateCursorVisibility(); | |
| 1960 | +} | |
| 1961 | + | |
| 1954 | 1962 | void Application::update(float deltaTime) { |
| 1955 | 1963 | bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings); |
| 1956 | 1964 | PerformanceWarning warn(showWarnings, "Application::update()"); |