diff --git a/interface/resources/qml/hifi/simplifiedUI/avatarApp/AvatarApp.qml b/interface/resources/qml/hifi/simplifiedUI/avatarApp/AvatarApp.qml index a659ff4e0c..57bec2250f 100644 --- a/interface/resources/qml/hifi/simplifiedUI/avatarApp/AvatarApp.qml +++ b/interface/resources/qml/hifi/simplifiedUI/avatarApp/AvatarApp.qml @@ -92,7 +92,7 @@ Rectangle { AvatarAppComponents.DisplayNameHeader { id: displayNameHeader - previewUrl: avatarPreviewUrl + previewUrl: root.avatarPreviewUrl loading: !inventoryContentsList.visible anchors.top: parent.top anchors.topMargin: 30 @@ -210,7 +210,10 @@ Rectangle { downloadUrl = avatarAppInventoryModel.get(i).download_url; previewUrl = avatarAppInventoryModel.get(i).preview; if (MyAvatar.skeletonModelURL === downloadUrl) { - avatarPreviewUrl = previewUrl; + if (previewUrl.indexOf("missing.png") > -1) { + previewUrl = "../../images/defaultAvatar.svg"; // Extra `../` because the image is stored 2 levels up from `DisplayNameHeader.qml` + } + root.avatarPreviewUrl = previewUrl; return; } } diff --git a/interface/resources/qml/hifi/simplifiedUI/avatarApp/components/AvatarAppListDelegate.qml b/interface/resources/qml/hifi/simplifiedUI/avatarApp/components/AvatarAppListDelegate.qml index 7c6ad1b09c..cdfa06190c 100644 --- a/interface/resources/qml/hifi/simplifiedUI/avatarApp/components/AvatarAppListDelegate.qml +++ b/interface/resources/qml/hifi/simplifiedUI/avatarApp/components/AvatarAppListDelegate.qml @@ -51,12 +51,14 @@ Rectangle { Image { id: itemPreviewImage - source: root.itemPreviewImageUrl + source: root.itemPreviewImageUrl.indexOf("missing.png") > -1 ? "../../images/defaultAvatar.svg" : root.itemPreviewImageUrl anchors.left: parent.left anchors.leftMargin: 20 anchors.verticalCenter: parent.verticalCenter - height: 60 - width: height + width: 60 + height: width + sourceSize.width: width + sourceSize.height: height fillMode: Image.PreserveAspectCrop mipmap: true layer.enabled: true diff --git a/interface/resources/qml/hifi/simplifiedUI/avatarApp/components/DisplayNameHeader.qml b/interface/resources/qml/hifi/simplifiedUI/avatarApp/components/DisplayNameHeader.qml index 6bf3d34d6f..a6be398e53 100644 --- a/interface/resources/qml/hifi/simplifiedUI/avatarApp/components/DisplayNameHeader.qml +++ b/interface/resources/qml/hifi/simplifiedUI/avatarApp/components/DisplayNameHeader.qml @@ -43,6 +43,8 @@ Item { anchors.verticalCenter: parent.verticalCenter height: 100 width: height + sourceSize.width: width + sourceSize.height: height fillMode: Image.PreserveAspectCrop layer.enabled: true layer.effect: OpacityMask { diff --git a/interface/resources/qml/hifi/simplifiedUI/images/defaultAvatar.svg b/interface/resources/qml/hifi/simplifiedUI/images/defaultAvatar.svg new file mode 100644 index 0000000000..05779e7d40 --- /dev/null +++ b/interface/resources/qml/hifi/simplifiedUI/images/defaultAvatar.svg @@ -0,0 +1,14 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/interface/resources/qml/hifi/simplifiedUI/inputDeviceButton/InputDeviceButton.qml b/interface/resources/qml/hifi/simplifiedUI/inputDeviceButton/InputDeviceButton.qml index 506c2a72bc..cb10cc5eef 100644 --- a/interface/resources/qml/hifi/simplifiedUI/inputDeviceButton/InputDeviceButton.qml +++ b/interface/resources/qml/hifi/simplifiedUI/inputDeviceButton/InputDeviceButton.qml @@ -48,9 +48,6 @@ Rectangle { } } - height: 30 - width: 34 - opacity: 0.7 onLevelChanged: { @@ -67,13 +64,8 @@ Rectangle { MouseArea { id: mouseArea - - anchors { - left: icon.left - right: bar.right - top: icon.top - bottom: icon.bottom - } + + anchors.fill: parent hoverEnabled: true scrollGestureEnabled: false @@ -109,9 +101,10 @@ Rectangle { Item { id: icon anchors.verticalCenter: parent.verticalCenter - anchors.left: parent.left - width: parent.width - bar.width - bar.anchors.leftMargin - height: parent.height + anchors.right: parent.horizontalCenter + anchors.rightMargin: 2 + width: 13 + height: 21 Item { anchors.fill: parent @@ -136,14 +129,12 @@ Rectangle { Item { id: bar - anchors { - left: icon.right - leftMargin: 0 - verticalCenter: icon.verticalCenter - } + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.horizontalCenter + anchors.leftMargin: 2 width: 4 - height: parent.height + height: 21 Rectangle { // base id: baseBar diff --git a/interface/resources/qml/hifi/simplifiedUI/inputDeviceButton/images/mic-clip-i.svg b/interface/resources/qml/hifi/simplifiedUI/inputDeviceButton/images/mic-clip-i.svg index f912c1e744..8b694c7f3d 100644 --- a/interface/resources/qml/hifi/simplifiedUI/inputDeviceButton/images/mic-clip-i.svg +++ b/interface/resources/qml/hifi/simplifiedUI/inputDeviceButton/images/mic-clip-i.svg @@ -1,10 +1,20 @@ - - - - - - - - - - + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/interface/resources/qml/hifi/simplifiedUI/inputDeviceButton/images/mic-gate-i.svg b/interface/resources/qml/hifi/simplifiedUI/inputDeviceButton/images/mic-gate-i.svg index 8255174532..ac70ce66cb 100644 --- a/interface/resources/qml/hifi/simplifiedUI/inputDeviceButton/images/mic-gate-i.svg +++ b/interface/resources/qml/hifi/simplifiedUI/inputDeviceButton/images/mic-gate-i.svg @@ -1,3 +1,13 @@ - - - + + + + + + image/svg+xml + + + + + + + diff --git a/interface/resources/qml/hifi/simplifiedUI/inputDeviceButton/images/mic-mute-a.svg b/interface/resources/qml/hifi/simplifiedUI/inputDeviceButton/images/mic-mute-a.svg index 67eafc27c8..eb36c2dd55 100644 --- a/interface/resources/qml/hifi/simplifiedUI/inputDeviceButton/images/mic-mute-a.svg +++ b/interface/resources/qml/hifi/simplifiedUI/inputDeviceButton/images/mic-mute-a.svg @@ -1,3 +1,13 @@ - - - + + + + + + image/svg+xml + + + + + + + diff --git a/interface/resources/qml/hifi/simplifiedUI/inputDeviceButton/images/mic-mute-i.svg b/interface/resources/qml/hifi/simplifiedUI/inputDeviceButton/images/mic-mute-i.svg index 63af1b0da8..ebca81f370 100644 --- a/interface/resources/qml/hifi/simplifiedUI/inputDeviceButton/images/mic-mute-i.svg +++ b/interface/resources/qml/hifi/simplifiedUI/inputDeviceButton/images/mic-mute-i.svg @@ -1,3 +1,13 @@ - - - + + + + + + image/svg+xml + + + + + + + diff --git a/interface/resources/qml/hifi/simplifiedUI/inputDeviceButton/images/mic-ptt-a.svg b/interface/resources/qml/hifi/simplifiedUI/inputDeviceButton/images/mic-ptt-a.svg index e6df3c69d7..3ce7c0ca51 100644 --- a/interface/resources/qml/hifi/simplifiedUI/inputDeviceButton/images/mic-ptt-a.svg +++ b/interface/resources/qml/hifi/simplifiedUI/inputDeviceButton/images/mic-ptt-a.svg @@ -1 +1,17 @@ -mic-ptt-a \ No newline at end of file + + + + + + image/svg+xml + + mic-ptt-a + + + + + + + mic-ptt-a + + diff --git a/interface/resources/qml/hifi/simplifiedUI/inputDeviceButton/images/mic-ptt-i.svg b/interface/resources/qml/hifi/simplifiedUI/inputDeviceButton/images/mic-ptt-i.svg index 2141ea5229..3bf1f1bf9e 100644 --- a/interface/resources/qml/hifi/simplifiedUI/inputDeviceButton/images/mic-ptt-i.svg +++ b/interface/resources/qml/hifi/simplifiedUI/inputDeviceButton/images/mic-ptt-i.svg @@ -1,24 +1,8 @@ - + - +image/svg+xml - + diff --git a/interface/resources/qml/hifi/simplifiedUI/inputDeviceButton/images/mic-unmute-a.svg b/interface/resources/qml/hifi/simplifiedUI/inputDeviceButton/images/mic-unmute-a.svg index 0bf7677017..0bd0b0c238 100644 --- a/interface/resources/qml/hifi/simplifiedUI/inputDeviceButton/images/mic-unmute-a.svg +++ b/interface/resources/qml/hifi/simplifiedUI/inputDeviceButton/images/mic-unmute-a.svg @@ -1,3 +1,57 @@ - - + + + + + + image/svg+xml + + + + + + + + diff --git a/interface/resources/qml/hifi/simplifiedUI/inputDeviceButton/images/mic-unmute-i.svg b/interface/resources/qml/hifi/simplifiedUI/inputDeviceButton/images/mic-unmute-i.svg index 0bf7677017..121873dd1b 100644 --- a/interface/resources/qml/hifi/simplifiedUI/inputDeviceButton/images/mic-unmute-i.svg +++ b/interface/resources/qml/hifi/simplifiedUI/inputDeviceButton/images/mic-unmute-i.svg @@ -1,3 +1,13 @@ - - - + + + + + + image/svg+xml + + + + + + + diff --git a/interface/resources/qml/hifi/simplifiedUI/topBar/SimplifiedTopBar.qml b/interface/resources/qml/hifi/simplifiedUI/topBar/SimplifiedTopBar.qml index 2c1e632cff..6622da33d9 100644 --- a/interface/resources/qml/hifi/simplifiedUI/topBar/SimplifiedTopBar.qml +++ b/interface/resources/qml/hifi/simplifiedUI/topBar/SimplifiedTopBar.qml @@ -122,21 +122,14 @@ Rectangle { width: 48 height: width - AnimatedImage { - visible: avatarButtonImage.source === "" - anchors.centerIn: parent - width: parent.width - 10 - height: width - source: "../images/loading.gif" - } - Image { id: avatarButtonImage - visible: source !== "" - source: "" + source: "./images/defaultAvatar.svg" anchors.centerIn: parent - width: parent.width - 10 + width: 32 height: width + sourceSize.width: width + sourceSize.height: height mipmap: true fillMode: Image.PreserveAspectCrop layer.enabled: true @@ -194,7 +187,9 @@ Rectangle { id: inputDeviceButton anchors.verticalCenter: parent.verticalCenter anchors.left: avatarButtonContainer.right - anchors.leftMargin: 8 + anchors.leftMargin: 6 + width: 32 + height: width } @@ -202,40 +197,46 @@ Rectangle { id: outputDeviceButtonContainer anchors.verticalCenter: parent.verticalCenter anchors.left: inputDeviceButton.right - anchors.leftMargin: 24 - width: 20 + anchors.leftMargin: 2 + width: 32 height: width - HifiStylesUit.HiFiGlyphs { - property bool outputMuted: false + Image { id: outputDeviceButton - text: (outputDeviceButton.outputMuted ? simplifiedUI.glyphs.vol_0 : simplifiedUI.glyphs.vol_3) - color: (outputDeviceButton.outputMuted ? simplifiedUI.colors.controls.outputVolumeButton.text.muted : simplifiedUI.colors.controls.outputVolumeButton.text.noisy) - opacity: outputDeviceButtonMouseArea.containsMouse ? 1.0 : 0.7 - size: 32 + property bool outputMuted: false + source: outputDeviceButton.outputMuted ? "./images/outputDeviceMuted.svg" : "./images/outputDeviceLoud.svg" anchors.centerIn: parent - width: parent.width - height: parent.height - horizontalAlignment: Text.AlignHCenter - MouseArea { - id: outputDeviceButtonMouseArea - anchors.fill: parent - hoverEnabled: true - onEntered: { - Tablet.playSound(TabletEnums.ButtonHover); - } - onClicked: { - Tablet.playSound(TabletEnums.ButtonClick); - outputDeviceButton.outputMuted = !outputDeviceButton.outputMuted; + width: 20 + height: 20 + fillMode: Image.PreserveAspectFit + visible: false + } - sendToScript({ - "source": "SimplifiedTopBar.qml", - "method": "setOutputMuted", - "data": { - "outputMuted": outputDeviceButton.outputMuted - } - }); - } + ColorOverlay { + anchors.fill: outputDeviceButton + opacity: outputDeviceButtonMouseArea.containsMouse ? 1.0 : 0.7 + source: outputDeviceButton + color: (outputDeviceButton.outputMuted ? simplifiedUI.colors.controls.outputVolumeButton.text.muted : simplifiedUI.colors.controls.outputVolumeButton.text.noisy) + } + + MouseArea { + id: outputDeviceButtonMouseArea + anchors.fill: parent + hoverEnabled: true + onEntered: { + Tablet.playSound(TabletEnums.ButtonHover); + } + onClicked: { + Tablet.playSound(TabletEnums.ButtonClick); + outputDeviceButton.outputMuted = !outputDeviceButton.outputMuted; + + sendToScript({ + "source": "SimplifiedTopBar.qml", + "method": "setOutputMuted", + "data": { + "outputMuted": outputDeviceButton.outputMuted + } + }); } } } @@ -244,34 +245,40 @@ Rectangle { Item { id: hmdButtonContainer - anchors.top: parent.top - anchors.bottom: parent.bottom + anchors.verticalCenter: parent.verticalCenter anchors.right: settingsButtonContainer.left - anchors.rightMargin: 8 - width: height + anchors.rightMargin: 14 + width: 32 + height: width - HifiStylesUit.HiFiGlyphs { - id: hmdGlyph - text: HMD.active ? simplifiedUI.glyphs.hmd : simplifiedUI.glyphs.screen - color: simplifiedUI.colors.text.white - opacity: hmdGlyphMouseArea.containsMouse ? 1.0 : 0.7 - size: 40 + Image { + id: displayModeImage + source: HMD.active ? "./images/desktopMode.svg" : "./images/vrMode.svg" anchors.centerIn: parent - width: 35 - height: parent.height - horizontalAlignment: Text.AlignHCenter - MouseArea { - id: hmdGlyphMouseArea - anchors.fill: parent - hoverEnabled: true - onEntered: { - Tablet.playSound(TabletEnums.ButtonHover); - } - onClicked: { - Tablet.playSound(TabletEnums.ButtonClick); - // TODO: actually do this right and change the display plugin - HMD.active = !HMD.active; - } + width: 29 + height: 16 + fillMode: Image.PreserveAspectFit + visible: false + } + + ColorOverlay { + anchors.fill: displayModeImage + opacity: displayModeMouseArea.containsMouse ? 1.0 : 0.7 + source: displayModeImage + color: simplifiedUI.colors.text.white + } + + MouseArea { + id: displayModeMouseArea + anchors.fill: parent + hoverEnabled: true + onEntered: { + Tablet.playSound(TabletEnums.ButtonHover); + } + onClicked: { + Tablet.playSound(TabletEnums.ButtonClick); + // TODO: actually do this right and change the display plugin + HMD.active = !HMD.active; } } } @@ -280,36 +287,42 @@ Rectangle { Item { id: settingsButtonContainer - anchors.top: parent.top - anchors.bottom: parent.bottom + anchors.verticalCenter: parent.verticalCenter anchors.right: parent.right anchors.rightMargin: 16 - width: height + width: 32 + height: width - HifiStylesUit.HiFiGlyphs { - id: settingsGlyph - text: simplifiedUI.glyphs.gear - color: simplifiedUI.colors.text.white - opacity: settingsGlyphMouseArea.containsMouse ? 1.0 : 0.7 - size: 40 + Image { + id: settingsButtonImage + source: "./images/settings.svg" anchors.centerIn: parent - width: 35 - height: parent.height - horizontalAlignment: Text.AlignHCenter - MouseArea { - id: settingsGlyphMouseArea - anchors.fill: parent - hoverEnabled: true - onEntered: { - Tablet.playSound(TabletEnums.ButtonHover); - } - onClicked: { - Tablet.playSound(TabletEnums.ButtonClick); - sendToScript({ - "source": "SimplifiedTopBar.qml", - "method": "toggleSettingsApp" - }); - } + width: 20 + height: 20 + fillMode: Image.PreserveAspectFit + visible: false + } + + ColorOverlay { + opacity: settingsButtonMouseArea.containsMouse ? 1.0 : 0.7 + anchors.fill: settingsButtonImage + source: settingsButtonImage + color: simplifiedUI.colors.text.white + } + + MouseArea { + id: settingsButtonMouseArea + anchors.fill: parent + hoverEnabled: true + onEntered: { + Tablet.playSound(TabletEnums.ButtonHover); + } + onClicked: { + Tablet.playSound(TabletEnums.ButtonClick); + sendToScript({ + "source": "SimplifiedTopBar.qml", + "method": "toggleSettingsApp" + }); } } } @@ -322,6 +335,9 @@ Rectangle { downloadUrl = topBarInventoryModel.get(i).download_url; previewUrl = topBarInventoryModel.get(i).preview; if (MyAvatar.skeletonModelURL === downloadUrl) { + if (previewUrl.indexOf("missing.png") > -1) { + previewUrl = "../images/defaultAvatar.svg"; + } avatarButtonImage.source = previewUrl; return; } @@ -336,7 +352,11 @@ Rectangle { switch (message.method) { case "updateAvatarThumbnailURL": - avatarButtonImage.source = message.data.avatarThumbnailURL; + if (message.data.avatarThumbnailURL.indexOf("defaultAvatar.svg") > -1) { + avatarButtonImage.source = "../images/defaultAvatar.svg"; + } else { + avatarButtonImage.source = message.data.avatarThumbnailURL; + } break; case "updateOutputMuted": diff --git a/interface/resources/qml/hifi/simplifiedUI/topBar/images/defaultAvatar.jpg b/interface/resources/qml/hifi/simplifiedUI/topBar/images/defaultAvatar.jpg deleted file mode 100644 index 821be6c584..0000000000 Binary files a/interface/resources/qml/hifi/simplifiedUI/topBar/images/defaultAvatar.jpg and /dev/null differ diff --git a/interface/resources/qml/hifi/simplifiedUI/topBar/images/desktopMode.svg b/interface/resources/qml/hifi/simplifiedUI/topBar/images/desktopMode.svg new file mode 100644 index 0000000000..8b04caca88 --- /dev/null +++ b/interface/resources/qml/hifi/simplifiedUI/topBar/images/desktopMode.svg @@ -0,0 +1,13 @@ + + + + + + image/svg+xml + + + + + + + diff --git a/interface/resources/qml/hifi/simplifiedUI/topBar/images/outputDeviceLoud.svg b/interface/resources/qml/hifi/simplifiedUI/topBar/images/outputDeviceLoud.svg new file mode 100644 index 0000000000..ebd844c471 --- /dev/null +++ b/interface/resources/qml/hifi/simplifiedUI/topBar/images/outputDeviceLoud.svg @@ -0,0 +1,3 @@ + + + diff --git a/interface/resources/qml/hifi/simplifiedUI/topBar/images/outputDeviceMuted.svg b/interface/resources/qml/hifi/simplifiedUI/topBar/images/outputDeviceMuted.svg new file mode 100644 index 0000000000..4188175c31 --- /dev/null +++ b/interface/resources/qml/hifi/simplifiedUI/topBar/images/outputDeviceMuted.svg @@ -0,0 +1,14 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/interface/resources/qml/hifi/simplifiedUI/topBar/images/settings.svg b/interface/resources/qml/hifi/simplifiedUI/topBar/images/settings.svg new file mode 100644 index 0000000000..04a031d498 --- /dev/null +++ b/interface/resources/qml/hifi/simplifiedUI/topBar/images/settings.svg @@ -0,0 +1,13 @@ + + + + + + image/svg+xml + + + + + + + diff --git a/interface/resources/qml/hifi/simplifiedUI/topBar/images/vrMode.svg b/interface/resources/qml/hifi/simplifiedUI/topBar/images/vrMode.svg new file mode 100644 index 0000000000..57b564813d --- /dev/null +++ b/interface/resources/qml/hifi/simplifiedUI/topBar/images/vrMode.svg @@ -0,0 +1,13 @@ + + + + + + image/svg+xml + + + + + + + diff --git a/scripts/system/simplifiedUI/simplifiedUI.js b/scripts/system/simplifiedUI/simplifiedUI.js index 3f22f376cf..c6181d2ad9 100644 --- a/scripts/system/simplifiedUI/simplifiedUI.js +++ b/scripts/system/simplifiedUI/simplifiedUI.js @@ -15,7 +15,6 @@ // START CONFIG OPTIONS var DOCKED_QML_SUPPORTED = true; -var REMOVE_EXISTING_UI = true; var TOOLBAR_NAME = "com.highfidelity.interface.toolbar.system"; var DEFAULT_SCRIPTS_PATH_PREFIX = ScriptDiscoveryService.defaultScriptsPath + "/"; // END CONFIG OPTIONS @@ -24,7 +23,7 @@ var DEFAULT_SCRIPTS_PATH_PREFIX = ScriptDiscoveryService.defaultScriptsPath + "/ var DEFAULT_SCRIPTS_SEPARATE = [ DEFAULT_SCRIPTS_PATH_PREFIX + "system/controllers/controllerScripts.js" ]; -function loadSeparateDefaults() { +function loadNewSeparateDefaults() { for (var i in DEFAULT_SCRIPTS_SEPARATE) { Script.load(DEFAULT_SCRIPTS_SEPARATE[i]); } @@ -36,7 +35,7 @@ var DEFAULT_SCRIPTS_COMBINED = [ DEFAULT_SCRIPTS_PATH_PREFIX + "system/progress.js", DEFAULT_SCRIPTS_PATH_PREFIX + "system/away.js" ]; -function runDefaultsTogether() { +function runNewDefaultsTogether() { for (var i in DEFAULT_SCRIPTS_COMBINED) { Script.include(DEFAULT_SCRIPTS_COMBINED[i]); } @@ -47,10 +46,13 @@ function runDefaultsTogether() { // 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); - }); +var keepMenusSetting = Settings.getValue("simplifiedUI/keepMenus", false); +function maybeRemoveDesktopMenu() { + if (!keepMenusSetting) { + MENU_NAMES.forEach(function(menu) { + Menu.removeMenu(menu); + }); + } } @@ -436,18 +438,21 @@ function ensureFirstPersonCameraInHMD(isHMDMode) { var simplifiedNametag = Script.require("../simplifiedNametag/simplifiedNametag.js"); var oldShowAudioTools; var oldShowBubbleTools; +var keepExistingUIAndScriptsSetting = Settings.getValue("simplifiedUI/keepExistingUIAndScripts", false); function startup() { - if (REMOVE_EXISTING_UI) { + maybeRemoveDesktopMenu(); + + if (!keepExistingUIAndScriptsSetting) { pauseCurrentScripts(); - removeDesktopMenu(); - runDefaultsTogether(); - loadSeparateDefaults(); + runNewDefaultsTogether(); + loadNewSeparateDefaults(); if (!HMD.active) { var toolbar = Toolbars.getToolbar(TOOLBAR_NAME); toolbar.writeProperty("visible", false); } } + loadSimplifiedTopBar(); simplifiedNametag.create(); @@ -476,7 +481,7 @@ function restoreScripts() { function shutdown() { restoreScripts(); - if (REMOVE_EXISTING_UI) { + if (!keepExistingUIAndScriptsSetting) { Window.confirm("You'll have to restart Interface to get full functionality back. Clicking yes or no will dismiss this dialog."); if (!HMD.active) {