diff --git a/interface/resources/qml/AvatarInputsBar.qml b/interface/resources/qml/AvatarInputsBar.qml index 3f1f598991..9230111cb6 100644 --- a/interface/resources/qml/AvatarInputsBar.qml +++ b/interface/resources/qml/AvatarInputsBar.qml @@ -16,6 +16,7 @@ import TabletScriptingInterface 1.0 Item { id: root; + visible: AvatarInputs.showAudioTools || AvatarInputs.showBubbleTools objectName: "AvatarInputsBar" property int modality: Qt.NonModal readonly property bool ignoreRadiusEnabled: AvatarInputs.ignoreRadiusEnabled; @@ -58,6 +59,6 @@ Item { BubbleIcon { dragTarget: parent - visible: !root.hmdActive; + visible: !root.hmdActive && AvatarInputs.showBubbleTools; } } diff --git a/interface/resources/qml/hifi/simplifiedUI/avatarApp/components/DisplayNameHeader.qml b/interface/resources/qml/hifi/simplifiedUI/avatarApp/components/DisplayNameHeader.qml index 8386e3cddc..f3b2e0b510 100644 --- a/interface/resources/qml/hifi/simplifiedUI/avatarApp/components/DisplayNameHeader.qml +++ b/interface/resources/qml/hifi/simplifiedUI/avatarApp/components/DisplayNameHeader.qml @@ -103,7 +103,7 @@ Item { TextInput { id: myDisplayNameText - text: MyAvatar.displayName + text: MyAvatar.sessionDisplayName === "" ? MyAvatar.displayName : MyAvatar.sessionDisplayName maximumLength: 256 clip: true anchors.fill: parent diff --git a/interface/resources/qml/hifi/simplifiedUI/simplifiedControls/Slider.qml b/interface/resources/qml/hifi/simplifiedUI/simplifiedControls/Slider.qml index c75811130a..2b1dc68261 100644 --- a/interface/resources/qml/hifi/simplifiedUI/simplifiedControls/Slider.qml +++ b/interface/resources/qml/hifi/simplifiedUI/simplifiedControls/Slider.qml @@ -53,7 +53,6 @@ Item { width: root.width * 0.6 enabled: root.enabled anchors.right: parent.right - anchors.rightMargin: sliderHandle.width / 2 anchors.verticalCenter: parent.verticalCenter onPressedChanged: { @@ -70,8 +69,9 @@ Item { background: Rectangle { id: sliderBackground - width: sliderControl.width + width: sliderControl.width - sliderHandle.width height: simplifiedUI.sizes.controls.slider.backgroundHeight + x: sliderHandle.width / 2 y: sliderControl.height / 2 - height / 2 radius: height / 2 color: simplifiedUI.colors.controls.slider.background.empty @@ -91,7 +91,7 @@ Item { id: sliderHandle width: sliderControl.height height: width - x: sliderControl.visualPosition * (sliderBackground.width - (sliderHandle.width / 2)) + x: sliderControl.visualPosition * sliderBackground.width y: sliderControl.height / 2 - height / 2 radius: height / 2 color: "#000000" diff --git a/interface/src/ui/AvatarInputs.cpp b/interface/src/ui/AvatarInputs.cpp index 80604f354b..bae6621fb2 100644 --- a/interface/src/ui/AvatarInputs.cpp +++ b/interface/src/ui/AvatarInputs.cpp @@ -20,6 +20,7 @@ static AvatarInputs* INSTANCE{ nullptr }; Setting::Handle showAudioToolsSetting { QStringList { "AvatarInputs", "showAudioTools" }, true }; +Setting::Handle showBubbleToolsSetting{ QStringList { "AvatarInputs", "showBubbleTools" }, true }; AvatarInputs* AvatarInputs::getInstance() { if (!INSTANCE) { @@ -88,6 +89,15 @@ void AvatarInputs::setShowAudioTools(bool showAudioTools) { emit showAudioToolsChanged(_showAudioTools); } +void AvatarInputs::setShowBubbleTools(bool showBubbleTools) { + if (_showBubbleTools == showBubbleTools) + return; + + _showBubbleTools = showBubbleTools; + showBubbleToolsSetting.set(_showAudioTools); + emit showBubbleToolsChanged(_showBubbleTools); +} + bool AvatarInputs::getIgnoreRadiusEnabled() const { return DependencyManager::get()->getIgnoreRadiusEnabled(); } diff --git a/interface/src/ui/AvatarInputs.h b/interface/src/ui/AvatarInputs.h index f53adc1749..976771d82b 100644 --- a/interface/src/ui/AvatarInputs.h +++ b/interface/src/ui/AvatarInputs.h @@ -35,6 +35,7 @@ class AvatarInputs : public QObject { * @property {boolean} cameraMuted Read-only. * @property {boolean} isHMD Read-only. * @property {boolean} showAudioTools + * @property {boolean} showBubbleTools */ AI_PROPERTY(bool, cameraEnabled, false) @@ -42,6 +43,7 @@ class AvatarInputs : public QObject { AI_PROPERTY(bool, isHMD, false) Q_PROPERTY(bool showAudioTools READ showAudioTools WRITE setShowAudioTools NOTIFY showAudioToolsChanged) + Q_PROPERTY(bool showBubbleTools READ showBubbleTools WRITE setShowBubbleTools NOTIFY showBubbleToolsChanged) Q_PROPERTY(bool ignoreRadiusEnabled READ getIgnoreRadiusEnabled NOTIFY ignoreRadiusEnabledChanged) //Q_PROPERTY(bool enteredIgnoreRadius READ getEnteredIgnoreRadius NOTIFY enteredIgnoreRadiusChanged) @@ -58,6 +60,7 @@ public: AvatarInputs(QObject* parent = nullptr); void update(); bool showAudioTools() const { return _showAudioTools; } + bool showBubbleTools() const { return _showBubbleTools; } bool getIgnoreRadiusEnabled() const; //bool getEnteredIgnoreRadius() const; @@ -69,6 +72,12 @@ public slots: */ void setShowAudioTools(bool showAudioTools); + /**jsdoc + * @function AvatarInputs.setShowBubbleTools + * @param {boolean} showBubbleTools + */ + void setShowBubbleTools(bool showBubbleTools); + signals: /**jsdoc @@ -97,6 +106,13 @@ signals: */ void showAudioToolsChanged(bool show); + /**jsdoc + * @function AvatarInputs.showBubbleToolsChanged + * @param {boolean} show + * @returns {Signal} + */ + void showBubbleToolsChanged(bool show); + /**jsdoc * @function AvatarInputs.avatarEnteredIgnoreRadius * @param {QUuid} avatarID @@ -142,6 +158,7 @@ private: void onAvatarLeftIgnoreRadius(); float _trailingAudioLoudness{ 0 }; bool _showAudioTools { false }; + bool _showBubbleTools{ false }; }; #endif // hifi_AvatarInputs_h diff --git a/scripts/system/simplifiedUI/simplifiedUI.js b/scripts/system/simplifiedUI/simplifiedUI.js index e4395effa1..7d73ef0703 100644 --- a/scripts/system/simplifiedUI/simplifiedUI.js +++ b/scripts/system/simplifiedUI/simplifiedUI.js @@ -43,7 +43,10 @@ function runDefaultsTogether() { } -var MENU_NAMES = ["File", "Edit", "Display", "View", "Navigate", "Settings", "Developer", "Help"]; +// Uncomment this out once the work is actually complete. +// Until then, users are required to access some functionality from the top menu bar. +//var MENU_NAMES = ["File", "Edit", "Display", "View", "Navigate", "Settings", "Developer", "Help"]; +var MENU_NAMES = ["File", "Edit", "View", "Navigate", "Help"]; function removeDesktopMenu() { MENU_NAMES.forEach(function(menu) { Menu.removeMenu(menu); @@ -431,6 +434,8 @@ function ensureFirstPersonCameraInHMD(isHMDMode) { var simplifiedNametag = Script.require("../simplifiedNametag/simplifiedNametag.js"); +var oldShowAudioTools; +var oldShowBubbleTools; function startup() { if (REMOVE_EXISTING_UI) { pauseCurrentScripts(); @@ -451,6 +456,11 @@ function startup() { Audio.mutedDesktopChanged.connect(onDesktopInputDeviceMutedChanged); Window.geometryChanged.connect(onGeometryChanged); HMD.displayModeChanged.connect(ensureFirstPersonCameraInHMD); + + oldShowAudioTools = AvatarInputs.showAudioTools; + AvatarInputs.showAudioTools = false; + oldShowBubbleTools = AvatarInputs.showBubbleTools; + AvatarInputs.showBubbleTools = false; } @@ -495,6 +505,9 @@ function shutdown() { Audio.mutedDesktopChanged.disconnect(onDesktopInputDeviceMutedChanged); Window.geometryChanged.disconnect(onGeometryChanged); HMD.displayModeChanged.disconnect(ensureFirstPersonCameraInHMD); + + AvatarInputs.showAudioTools = oldShowAudioTools; + AvatarInputs.showBubbleTools = oldShowBubbleTools; }