mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 07:23:00 +02:00
fixinig the controller settings page and have menu option on by default
This commit is contained in:
parent
2a3004079e
commit
82422edb59
5 changed files with 293 additions and 264 deletions
|
@ -18,7 +18,7 @@ import "../../controls-uit" as HifiControls
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: info
|
id: info
|
||||||
|
|
||||||
|
anchors.fill: parent
|
||||||
signal canceled()
|
signal canceled()
|
||||||
signal restart()
|
signal restart()
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
import QtQuick 2.7
|
import QtQuick 2.7
|
||||||
import QtQuick.Controls 2.2
|
import QtQuick.Controls 2.2
|
||||||
|
import QtQuick.Layouts 1.3
|
||||||
import QtGraphicalEffects 1.0
|
import QtGraphicalEffects 1.0
|
||||||
import Qt.labs.settings 1.0
|
import Qt.labs.settings 1.0
|
||||||
import "../../styles-uit"
|
import "../../styles-uit"
|
||||||
|
@ -15,24 +16,52 @@ import "../../controls"
|
||||||
import "../../controls-uit" as HifiControls
|
import "../../controls-uit" as HifiControls
|
||||||
import "../../dialogs"
|
import "../../dialogs"
|
||||||
import "../../dialogs/preferences"
|
import "../../dialogs/preferences"
|
||||||
|
import "tabletWindows"
|
||||||
|
import "../audio"
|
||||||
|
|
||||||
PreferencesDialog {
|
Item {
|
||||||
id: root
|
id: controllerSettings
|
||||||
objectName: "ControlSettings"
|
height: parent.height
|
||||||
title: "Control Settings"
|
width: parent.width
|
||||||
showCategories: ["VR Movement", inputConfigurationComponents]
|
|
||||||
property var settings: Settings {
|
HifiConstants { id: hifi }
|
||||||
category: root.objectName
|
|
||||||
property alias x: root.x
|
TabBar {
|
||||||
property alias y: root.y
|
id: bar
|
||||||
property alias width: root.width
|
spacing: 0
|
||||||
property alias height: root.height
|
width: parent.width
|
||||||
|
|
||||||
|
TabButton {
|
||||||
|
height: parent.height
|
||||||
|
text: qsTr("Settings")
|
||||||
|
onClicked: {
|
||||||
|
stackView.clear();
|
||||||
|
stackView.push(controllerPreferencesComponent);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
TabButton {
|
||||||
|
height: parent.height
|
||||||
|
text: qsTr("Calibration")
|
||||||
|
onClicked: {
|
||||||
|
stackView.clear();
|
||||||
|
stackView.push(inputConfigurationComponent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
StackView {
|
||||||
|
id: stackView
|
||||||
|
anchors.top: bar.bottom
|
||||||
|
anchors.bottom: controllerSettings.bottom
|
||||||
|
anchors.left: controllerSettings.left
|
||||||
|
anchors.right: controllerSettings.right
|
||||||
|
|
||||||
|
initialItem: controllerPreferencesComponent
|
||||||
|
}
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
id: inputConfigurationComponents
|
id: inputConfigurationComponent
|
||||||
|
|
||||||
Preference {
|
|
||||||
|
|
||||||
StackView {
|
StackView {
|
||||||
id: stack
|
id: stack
|
||||||
initialItem: inputConfiguration
|
initialItem: inputConfiguration
|
||||||
|
@ -247,5 +276,15 @@ PreferencesDialog {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Component {
|
||||||
|
id: controllerPreferencesComponent
|
||||||
|
TabletPreferencesDialog {
|
||||||
|
anchors.fill: stackView
|
||||||
|
id: controllerPrefereneces
|
||||||
|
objectName: "TabletControllerPreferences"
|
||||||
|
showCategories: ["VR Movement"]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,7 @@ Item {
|
||||||
id: dialog
|
id: dialog
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: parent.height
|
height: parent.height
|
||||||
|
anchors.fill: parent
|
||||||
|
|
||||||
HifiConstants { id: hifi }
|
HifiConstants { id: hifi }
|
||||||
property var sections: []
|
property var sections: []
|
||||||
|
@ -158,7 +159,8 @@ Item {
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: footer
|
id: footer
|
||||||
height: 40
|
height: dialog.height * 0.15
|
||||||
|
anchors.bottom: dialog.bottom
|
||||||
|
|
||||||
anchors {
|
anchors {
|
||||||
bottom: keyboard.top
|
bottom: keyboard.top
|
||||||
|
|
|
@ -236,8 +236,13 @@ Menu::Menu() {
|
||||||
// Settings > Controls...
|
// Settings > Controls...
|
||||||
action = addActionToQMenuAndActionHash(settingsMenu, "Controls...");
|
action = addActionToQMenuAndActionHash(settingsMenu, "Controls...");
|
||||||
connect(action, &QAction::triggered, [] {
|
connect(action, &QAction::triggered, [] {
|
||||||
qApp->showDialog(QString("hifi/tablet/ControllerSettings.qml"),
|
auto tablet = DependencyManager::get<TabletScriptingInterface>()->getTablet("com.highfidelity.interface.tablet.system");
|
||||||
QString("hifi/tablet/ControllerSettings.qml"), "ControlSettings");
|
auto hmd = DependencyManager::get<HMDScriptingInterface>();
|
||||||
|
tablet->loadQMLSource("hifi/tablet/ControllerSettings.qml");
|
||||||
|
|
||||||
|
if (!hmd->getShouldShowTablet()) {
|
||||||
|
hmd->toggleShouldShowTablet();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Settings > Audio...
|
// Settings > Audio...
|
||||||
|
|
|
@ -1150,8 +1150,7 @@ function setupModelMenus() {
|
||||||
Menu.addMenuItem({
|
Menu.addMenuItem({
|
||||||
menuName: "Edit",
|
menuName: "Edit",
|
||||||
menuItemName: "Entities",
|
menuItemName: "Entities",
|
||||||
isSeparator: true,
|
isSeparator: true
|
||||||
grouping: "Advanced"
|
|
||||||
});
|
});
|
||||||
if (!Menu.menuItemExists("Edit", "Delete")) {
|
if (!Menu.menuItemExists("Edit", "Delete")) {
|
||||||
Menu.addMenuItem({
|
Menu.addMenuItem({
|
||||||
|
@ -1161,7 +1160,6 @@ function setupModelMenus() {
|
||||||
text: "delete"
|
text: "delete"
|
||||||
},
|
},
|
||||||
afterItem: "Entities",
|
afterItem: "Entities",
|
||||||
grouping: "Advanced"
|
|
||||||
});
|
});
|
||||||
modelMenuAddedDelete = true;
|
modelMenuAddedDelete = true;
|
||||||
}
|
}
|
||||||
|
@ -1169,15 +1167,13 @@ function setupModelMenus() {
|
||||||
Menu.addMenuItem({
|
Menu.addMenuItem({
|
||||||
menuName: "Edit",
|
menuName: "Edit",
|
||||||
menuItemName: "Parent Entity to Last",
|
menuItemName: "Parent Entity to Last",
|
||||||
afterItem: "Entities",
|
afterItem: "Entities"
|
||||||
grouping: "Advanced"
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Menu.addMenuItem({
|
Menu.addMenuItem({
|
||||||
menuName: "Edit",
|
menuName: "Edit",
|
||||||
menuItemName: "Unparent Entity",
|
menuItemName: "Unparent Entity",
|
||||||
afterItem: "Parent Entity to Last",
|
afterItem: "Parent Entity to Last"
|
||||||
grouping: "Advanced"
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Menu.addMenuItem({
|
Menu.addMenuItem({
|
||||||
|
@ -1185,8 +1181,7 @@ function setupModelMenus() {
|
||||||
menuItemName: MENU_CREATE_ENTITIES_GRABBABLE,
|
menuItemName: MENU_CREATE_ENTITIES_GRABBABLE,
|
||||||
afterItem: "Unparent Entity",
|
afterItem: "Unparent Entity",
|
||||||
isCheckable: true,
|
isCheckable: true,
|
||||||
isChecked: Settings.getValue(SETTING_EDIT_PREFIX + MENU_CREATE_ENTITIES_GRABBABLE, true),
|
isChecked: Settings.getValue(SETTING_EDIT_PREFIX + MENU_CREATE_ENTITIES_GRABBABLE, true)
|
||||||
grouping: "Advanced"
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Menu.addMenuItem({
|
Menu.addMenuItem({
|
||||||
|
@ -1194,87 +1189,75 @@ function setupModelMenus() {
|
||||||
menuItemName: MENU_ALLOW_SELECTION_LARGE,
|
menuItemName: MENU_ALLOW_SELECTION_LARGE,
|
||||||
afterItem: MENU_CREATE_ENTITIES_GRABBABLE,
|
afterItem: MENU_CREATE_ENTITIES_GRABBABLE,
|
||||||
isCheckable: true,
|
isCheckable: true,
|
||||||
isChecked: Settings.getValue(SETTING_EDIT_PREFIX + MENU_ALLOW_SELECTION_LARGE, true),
|
isChecked: Settings.getValue(SETTING_EDIT_PREFIX + MENU_ALLOW_SELECTION_LARGE, true)
|
||||||
grouping: "Advanced"
|
|
||||||
});
|
});
|
||||||
Menu.addMenuItem({
|
Menu.addMenuItem({
|
||||||
menuName: "Edit",
|
menuName: "Edit",
|
||||||
menuItemName: MENU_ALLOW_SELECTION_SMALL,
|
menuItemName: MENU_ALLOW_SELECTION_SMALL,
|
||||||
afterItem: MENU_ALLOW_SELECTION_LARGE,
|
afterItem: MENU_ALLOW_SELECTION_LARGE,
|
||||||
isCheckable: true,
|
isCheckable: true,
|
||||||
isChecked: Settings.getValue(SETTING_EDIT_PREFIX + MENU_ALLOW_SELECTION_SMALL, true),
|
isChecked: Settings.getValue(SETTING_EDIT_PREFIX + MENU_ALLOW_SELECTION_SMALL, true)
|
||||||
grouping: "Advanced"
|
|
||||||
});
|
});
|
||||||
Menu.addMenuItem({
|
Menu.addMenuItem({
|
||||||
menuName: "Edit",
|
menuName: "Edit",
|
||||||
menuItemName: MENU_ALLOW_SELECTION_LIGHTS,
|
menuItemName: MENU_ALLOW_SELECTION_LIGHTS,
|
||||||
afterItem: MENU_ALLOW_SELECTION_SMALL,
|
afterItem: MENU_ALLOW_SELECTION_SMALL,
|
||||||
isCheckable: true,
|
isCheckable: true,
|
||||||
isChecked: Settings.getValue(SETTING_EDIT_PREFIX + MENU_ALLOW_SELECTION_LIGHTS, false),
|
isChecked: Settings.getValue(SETTING_EDIT_PREFIX + MENU_ALLOW_SELECTION_LIGHTS, false)
|
||||||
grouping: "Advanced"
|
|
||||||
});
|
});
|
||||||
Menu.addMenuItem({
|
Menu.addMenuItem({
|
||||||
menuName: "Edit",
|
menuName: "Edit",
|
||||||
menuItemName: "Select All Entities In Box",
|
menuItemName: "Select All Entities In Box",
|
||||||
afterItem: "Allow Selecting of Lights",
|
afterItem: "Allow Selecting of Lights"
|
||||||
grouping: "Advanced"
|
|
||||||
});
|
});
|
||||||
Menu.addMenuItem({
|
Menu.addMenuItem({
|
||||||
menuName: "Edit",
|
menuName: "Edit",
|
||||||
menuItemName: "Select All Entities Touching Box",
|
menuItemName: "Select All Entities Touching Box",
|
||||||
afterItem: "Select All Entities In Box",
|
afterItem: "Select All Entities In Box"
|
||||||
grouping: "Advanced"
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Menu.addMenuItem({
|
Menu.addMenuItem({
|
||||||
menuName: "Edit",
|
menuName: "Edit",
|
||||||
menuItemName: "Export Entities",
|
menuItemName: "Export Entities",
|
||||||
afterItem: "Entities",
|
afterItem: "Entities"
|
||||||
grouping: "Advanced"
|
|
||||||
});
|
});
|
||||||
Menu.addMenuItem({
|
Menu.addMenuItem({
|
||||||
menuName: "Edit",
|
menuName: "Edit",
|
||||||
menuItemName: "Import Entities",
|
menuItemName: "Import Entities",
|
||||||
afterItem: "Export Entities",
|
afterItem: "Export Entities"
|
||||||
grouping: "Advanced"
|
|
||||||
});
|
});
|
||||||
Menu.addMenuItem({
|
Menu.addMenuItem({
|
||||||
menuName: "Edit",
|
menuName: "Edit",
|
||||||
menuItemName: "Import Entities from URL",
|
menuItemName: "Import Entities from URL",
|
||||||
afterItem: "Import Entities",
|
afterItem: "Import Entities"
|
||||||
grouping: "Advanced"
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Menu.addMenuItem({
|
Menu.addMenuItem({
|
||||||
menuName: "Edit",
|
menuName: "Edit",
|
||||||
menuItemName: MENU_AUTO_FOCUS_ON_SELECT,
|
menuItemName: MENU_AUTO_FOCUS_ON_SELECT,
|
||||||
isCheckable: true,
|
isCheckable: true,
|
||||||
isChecked: Settings.getValue(SETTING_AUTO_FOCUS_ON_SELECT) === "true",
|
isChecked: Settings.getValue(SETTING_AUTO_FOCUS_ON_SELECT) === "true"
|
||||||
grouping: "Advanced"
|
|
||||||
});
|
});
|
||||||
Menu.addMenuItem({
|
Menu.addMenuItem({
|
||||||
menuName: "Edit",
|
menuName: "Edit",
|
||||||
menuItemName: MENU_EASE_ON_FOCUS,
|
menuItemName: MENU_EASE_ON_FOCUS,
|
||||||
afterItem: MENU_AUTO_FOCUS_ON_SELECT,
|
afterItem: MENU_AUTO_FOCUS_ON_SELECT,
|
||||||
isCheckable: true,
|
isCheckable: true,
|
||||||
isChecked: Settings.getValue(SETTING_EASE_ON_FOCUS) === "true",
|
isChecked: Settings.getValue(SETTING_EASE_ON_FOCUS) === "true"
|
||||||
grouping: "Advanced"
|
|
||||||
});
|
});
|
||||||
Menu.addMenuItem({
|
Menu.addMenuItem({
|
||||||
menuName: "Edit",
|
menuName: "Edit",
|
||||||
menuItemName: MENU_SHOW_LIGHTS_AND_PARTICLES_IN_EDIT_MODE,
|
menuItemName: MENU_SHOW_LIGHTS_AND_PARTICLES_IN_EDIT_MODE,
|
||||||
afterItem: MENU_EASE_ON_FOCUS,
|
afterItem: MENU_EASE_ON_FOCUS,
|
||||||
isCheckable: true,
|
isCheckable: true,
|
||||||
isChecked: Settings.getValue(SETTING_SHOW_LIGHTS_AND_PARTICLES_IN_EDIT_MODE) !== "false",
|
isChecked: Settings.getValue(SETTING_SHOW_LIGHTS_AND_PARTICLES_IN_EDIT_MODE) !== "false"
|
||||||
grouping: "Advanced"
|
|
||||||
});
|
});
|
||||||
Menu.addMenuItem({
|
Menu.addMenuItem({
|
||||||
menuName: "Edit",
|
menuName: "Edit",
|
||||||
menuItemName: MENU_SHOW_ZONES_IN_EDIT_MODE,
|
menuItemName: MENU_SHOW_ZONES_IN_EDIT_MODE,
|
||||||
afterItem: MENU_SHOW_LIGHTS_AND_PARTICLES_IN_EDIT_MODE,
|
afterItem: MENU_SHOW_LIGHTS_AND_PARTICLES_IN_EDIT_MODE,
|
||||||
isCheckable: true,
|
isCheckable: true,
|
||||||
isChecked: Settings.getValue(SETTING_SHOW_ZONES_IN_EDIT_MODE) !== "false",
|
isChecked: Settings.getValue(SETTING_SHOW_ZONES_IN_EDIT_MODE) !== "false"
|
||||||
grouping: "Advanced"
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Entities.setLightsArePickable(false);
|
Entities.setLightsArePickable(false);
|
||||||
|
|
Loading…
Reference in a new issue