Hide controls in top left; don't remove certain menus; fixup slider UIT

This commit is contained in:
Zach Fox 2019-05-13 17:26:19 -07:00
parent 7bb2d6871b
commit 89006cd9c5
6 changed files with 47 additions and 6 deletions

View file

@ -16,6 +16,7 @@ import TabletScriptingInterface 1.0
Item { Item {
id: root; id: root;
visible: AvatarInputs.showAudioTools || AvatarInputs.showBubbleTools
objectName: "AvatarInputsBar" objectName: "AvatarInputsBar"
property int modality: Qt.NonModal property int modality: Qt.NonModal
readonly property bool ignoreRadiusEnabled: AvatarInputs.ignoreRadiusEnabled; readonly property bool ignoreRadiusEnabled: AvatarInputs.ignoreRadiusEnabled;
@ -58,6 +59,6 @@ Item {
BubbleIcon { BubbleIcon {
dragTarget: parent dragTarget: parent
visible: !root.hmdActive; visible: !root.hmdActive && AvatarInputs.showBubbleTools;
} }
} }

View file

@ -103,7 +103,7 @@ Item {
TextInput { TextInput {
id: myDisplayNameText id: myDisplayNameText
text: MyAvatar.displayName text: MyAvatar.sessionDisplayName === "" ? MyAvatar.displayName : MyAvatar.sessionDisplayName
maximumLength: 256 maximumLength: 256
clip: true clip: true
anchors.fill: parent anchors.fill: parent

View file

@ -53,7 +53,6 @@ Item {
width: root.width * 0.6 width: root.width * 0.6
enabled: root.enabled enabled: root.enabled
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: sliderHandle.width / 2
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
onPressedChanged: { onPressedChanged: {
@ -70,8 +69,9 @@ Item {
background: Rectangle { background: Rectangle {
id: sliderBackground id: sliderBackground
width: sliderControl.width width: sliderControl.width - sliderHandle.width
height: simplifiedUI.sizes.controls.slider.backgroundHeight height: simplifiedUI.sizes.controls.slider.backgroundHeight
x: sliderHandle.width / 2
y: sliderControl.height / 2 - height / 2 y: sliderControl.height / 2 - height / 2
radius: height / 2 radius: height / 2
color: simplifiedUI.colors.controls.slider.background.empty color: simplifiedUI.colors.controls.slider.background.empty
@ -91,7 +91,7 @@ Item {
id: sliderHandle id: sliderHandle
width: sliderControl.height width: sliderControl.height
height: width height: width
x: sliderControl.visualPosition * (sliderBackground.width - (sliderHandle.width / 2)) x: sliderControl.visualPosition * sliderBackground.width
y: sliderControl.height / 2 - height / 2 y: sliderControl.height / 2 - height / 2
radius: height / 2 radius: height / 2
color: "#000000" color: "#000000"

View file

@ -20,6 +20,7 @@
static AvatarInputs* INSTANCE{ nullptr }; static AvatarInputs* INSTANCE{ nullptr };
Setting::Handle<bool> showAudioToolsSetting { QStringList { "AvatarInputs", "showAudioTools" }, true }; Setting::Handle<bool> showAudioToolsSetting { QStringList { "AvatarInputs", "showAudioTools" }, true };
Setting::Handle<bool> showBubbleToolsSetting{ QStringList { "AvatarInputs", "showBubbleTools" }, true };
AvatarInputs* AvatarInputs::getInstance() { AvatarInputs* AvatarInputs::getInstance() {
if (!INSTANCE) { if (!INSTANCE) {
@ -88,6 +89,15 @@ void AvatarInputs::setShowAudioTools(bool showAudioTools) {
emit showAudioToolsChanged(_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 { bool AvatarInputs::getIgnoreRadiusEnabled() const {
return DependencyManager::get<NodeList>()->getIgnoreRadiusEnabled(); return DependencyManager::get<NodeList>()->getIgnoreRadiusEnabled();
} }

View file

@ -35,6 +35,7 @@ class AvatarInputs : public QObject {
* @property {boolean} cameraMuted <em>Read-only.</em> * @property {boolean} cameraMuted <em>Read-only.</em>
* @property {boolean} isHMD <em>Read-only.</em> * @property {boolean} isHMD <em>Read-only.</em>
* @property {boolean} showAudioTools * @property {boolean} showAudioTools
* @property {boolean} showBubbleTools
*/ */
AI_PROPERTY(bool, cameraEnabled, false) AI_PROPERTY(bool, cameraEnabled, false)
@ -42,6 +43,7 @@ class AvatarInputs : public QObject {
AI_PROPERTY(bool, isHMD, false) AI_PROPERTY(bool, isHMD, false)
Q_PROPERTY(bool showAudioTools READ showAudioTools WRITE setShowAudioTools NOTIFY showAudioToolsChanged) 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 ignoreRadiusEnabled READ getIgnoreRadiusEnabled NOTIFY ignoreRadiusEnabledChanged)
//Q_PROPERTY(bool enteredIgnoreRadius READ getEnteredIgnoreRadius NOTIFY enteredIgnoreRadiusChanged) //Q_PROPERTY(bool enteredIgnoreRadius READ getEnteredIgnoreRadius NOTIFY enteredIgnoreRadiusChanged)
@ -58,6 +60,7 @@ public:
AvatarInputs(QObject* parent = nullptr); AvatarInputs(QObject* parent = nullptr);
void update(); void update();
bool showAudioTools() const { return _showAudioTools; } bool showAudioTools() const { return _showAudioTools; }
bool showBubbleTools() const { return _showBubbleTools; }
bool getIgnoreRadiusEnabled() const; bool getIgnoreRadiusEnabled() const;
//bool getEnteredIgnoreRadius() const; //bool getEnteredIgnoreRadius() const;
@ -69,6 +72,12 @@ public slots:
*/ */
void setShowAudioTools(bool showAudioTools); void setShowAudioTools(bool showAudioTools);
/**jsdoc
* @function AvatarInputs.setShowBubbleTools
* @param {boolean} showBubbleTools
*/
void setShowBubbleTools(bool showBubbleTools);
signals: signals:
/**jsdoc /**jsdoc
@ -97,6 +106,13 @@ signals:
*/ */
void showAudioToolsChanged(bool show); void showAudioToolsChanged(bool show);
/**jsdoc
* @function AvatarInputs.showBubbleToolsChanged
* @param {boolean} show
* @returns {Signal}
*/
void showBubbleToolsChanged(bool show);
/**jsdoc /**jsdoc
* @function AvatarInputs.avatarEnteredIgnoreRadius * @function AvatarInputs.avatarEnteredIgnoreRadius
* @param {QUuid} avatarID * @param {QUuid} avatarID
@ -142,6 +158,7 @@ private:
void onAvatarLeftIgnoreRadius(); void onAvatarLeftIgnoreRadius();
float _trailingAudioLoudness{ 0 }; float _trailingAudioLoudness{ 0 };
bool _showAudioTools { false }; bool _showAudioTools { false };
bool _showBubbleTools{ false };
}; };
#endif // hifi_AvatarInputs_h #endif // hifi_AvatarInputs_h

View file

@ -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() { function removeDesktopMenu() {
MENU_NAMES.forEach(function(menu) { MENU_NAMES.forEach(function(menu) {
Menu.removeMenu(menu); Menu.removeMenu(menu);
@ -431,6 +434,8 @@ function ensureFirstPersonCameraInHMD(isHMDMode) {
var simplifiedNametag = Script.require("../simplifiedNametag/simplifiedNametag.js"); var simplifiedNametag = Script.require("../simplifiedNametag/simplifiedNametag.js");
var oldShowAudioTools;
var oldShowBubbleTools;
function startup() { function startup() {
if (REMOVE_EXISTING_UI) { if (REMOVE_EXISTING_UI) {
pauseCurrentScripts(); pauseCurrentScripts();
@ -451,6 +456,11 @@ function startup() {
Audio.mutedDesktopChanged.connect(onDesktopInputDeviceMutedChanged); Audio.mutedDesktopChanged.connect(onDesktopInputDeviceMutedChanged);
Window.geometryChanged.connect(onGeometryChanged); Window.geometryChanged.connect(onGeometryChanged);
HMD.displayModeChanged.connect(ensureFirstPersonCameraInHMD); 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); Audio.mutedDesktopChanged.disconnect(onDesktopInputDeviceMutedChanged);
Window.geometryChanged.disconnect(onGeometryChanged); Window.geometryChanged.disconnect(onGeometryChanged);
HMD.displayModeChanged.disconnect(ensureFirstPersonCameraInHMD); HMD.displayModeChanged.disconnect(ensureFirstPersonCameraInHMD);
AvatarInputs.showAudioTools = oldShowAudioTools;
AvatarInputs.showBubbleTools = oldShowBubbleTools;
} }