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 {
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;
}
}

View file

@ -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

View file

@ -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"

View file

@ -20,6 +20,7 @@
static AvatarInputs* INSTANCE{ nullptr };
Setting::Handle<bool> showAudioToolsSetting { QStringList { "AvatarInputs", "showAudioTools" }, true };
Setting::Handle<bool> 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<NodeList>()->getIgnoreRadiusEnabled();
}

View file

@ -35,6 +35,7 @@ class AvatarInputs : public QObject {
* @property {boolean} cameraMuted <em>Read-only.</em>
* @property {boolean} isHMD <em>Read-only.</em>
* @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

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() {
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;
}