mirror of
https://github.com/overte-org/overte.git
synced 2025-04-10 18:36:11 +02:00
Interface respects Show Overlay menu checkbox on start up.
This commit is contained in:
parent
3b44b3a31f
commit
c8a04911f4
3 changed files with 17 additions and 2 deletions
|
@ -3177,6 +3177,12 @@ void Application::setHmdTabletBecomesToolbarSetting(bool value) {
|
|||
updateSystemTabletMode();
|
||||
}
|
||||
|
||||
#pragma optimize("", off)
|
||||
void Application::setShowOverlays(bool value) {
|
||||
_hmdTabletBecomesToolbarSetting.set(value);
|
||||
updateSystemTabletMode();
|
||||
}
|
||||
|
||||
void Application::setPreferStylusOverLaser(bool value) {
|
||||
_preferStylusOverLaserSetting.set(value);
|
||||
}
|
||||
|
@ -8260,13 +8266,15 @@ void Application::updateThreadPoolCount() const {
|
|||
QThreadPool::globalInstance()->setMaxThreadCount(threadPoolSize);
|
||||
}
|
||||
|
||||
#pragma optimize("", off)
|
||||
void Application::updateSystemTabletMode() {
|
||||
if (_settingsLoaded) {
|
||||
qApp->setProperty(hifi::properties::HMD, isHMDMode());
|
||||
if (isHMDMode()) {
|
||||
DependencyManager::get<TabletScriptingInterface>()->setToolbarMode(getHmdTabletBecomesToolbarSetting());
|
||||
} else {
|
||||
DependencyManager::get<TabletScriptingInterface>()->setToolbarMode(getDesktopTabletBecomesToolbarSetting());
|
||||
// Show toolbar if toolbar is enabled AND the Show Overlays menu option is checked
|
||||
DependencyManager::get<TabletScriptingInterface>()->setToolbarMode(getDesktopTabletBecomesToolbarSetting() && (Menu::getInstance()->isOptionChecked(MenuOption::Overlays)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -218,8 +218,12 @@ public:
|
|||
|
||||
bool getDesktopTabletBecomesToolbarSetting() { return _desktopTabletBecomesToolbarSetting.get(); }
|
||||
void setDesktopTabletBecomesToolbarSetting(bool value);
|
||||
|
||||
bool getHmdTabletBecomesToolbarSetting() { return _hmdTabletBecomesToolbarSetting.get(); }
|
||||
void setHmdTabletBecomesToolbarSetting(bool value);
|
||||
|
||||
void setShowOverlays(bool value);
|
||||
|
||||
bool getPreferStylusOverLaser() { return _preferStylusOverLaserSetting.get(); }
|
||||
void setPreferStylusOverLaser(bool value);
|
||||
// FIXME: Remove setting completely or make available through JavaScript API?
|
||||
|
|
|
@ -240,7 +240,10 @@ Menu::Menu() {
|
|||
addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::CenterPlayerInView,
|
||||
0, true, qApp, SLOT(rotationModeChanged()));
|
||||
|
||||
addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::Overlays, 0, true);
|
||||
action = addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::Overlays, 0, true);
|
||||
connect(action, &QAction::triggered, [action] {
|
||||
qApp->setDesktopTabletBecomesToolbarSetting(action->isChecked());
|
||||
});
|
||||
|
||||
// View > Enter First Person Mode in HMD
|
||||
addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::FirstPersonHMD, 0, true);
|
||||
|
|
Loading…
Reference in a new issue