Merge pull request #15622 from zfox23/SUI/audioListFixes

Fix a bunch of Simplified UI issues (see description)
This commit is contained in:
Zach Fox 2019-05-23 14:26:56 -07:00 committed by GitHub
commit eac435e2cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 23 deletions

View file

@ -60,7 +60,7 @@ Flickable {
HifiStylesUit.GraphikRegular { HifiStylesUit.GraphikRegular {
id: volumeControlsTitle id: volumeControlsTitle
text: "Volume Controls" text: "Volume Controls"
Layout.maximumWidth: parent.width Layout.preferredWidth: parent.width
height: paintedHeight height: paintedHeight
size: 22 size: 22
color: simplifiedUI.colors.text.white color: simplifiedUI.colors.text.white
@ -68,8 +68,7 @@ Flickable {
SimplifiedControls.Slider { SimplifiedControls.Slider {
id: peopleVolume id: peopleVolume
anchors.left: parent.left Layout.preferredWidth: parent.width
anchors.right: parent.right
Layout.topMargin: simplifiedUI.margins.settings.settingsGroupTopMargin Layout.topMargin: simplifiedUI.margins.settings.settingsGroupTopMargin
height: 30 height: 30
labelText: "People Volume" labelText: "People Volume"
@ -96,8 +95,7 @@ Flickable {
SimplifiedControls.Slider { SimplifiedControls.Slider {
id: environmentVolume id: environmentVolume
anchors.left: parent.left Layout.preferredWidth: parent.width
anchors.right: parent.right
Layout.topMargin: 2 Layout.topMargin: 2
height: 30 height: 30
labelText: "Environment Volume" labelText: "Environment Volume"
@ -125,8 +123,7 @@ Flickable {
SimplifiedControls.Slider { SimplifiedControls.Slider {
id: systemSoundVolume id: systemSoundVolume
anchors.left: parent.left Layout.preferredWidth: parent.width
anchors.right: parent.right
Layout.topMargin: 2 Layout.topMargin: 2
height: 30 height: 30
labelText: "System Sound Volume" labelText: "System Sound Volume"
@ -212,8 +209,7 @@ Flickable {
ListView { ListView {
id: inputDeviceListView id: inputDeviceListView
anchors.left: parent.left Layout.preferredWidth: parent.width
anchors.right: parent.right
Layout.topMargin: simplifiedUI.margins.settings.settingsGroupTopMargin Layout.topMargin: simplifiedUI.margins.settings.settingsGroupTopMargin
interactive: false interactive: false
height: contentItem.height height: contentItem.height
@ -228,7 +224,7 @@ Flickable {
id: inputDeviceCheckbox id: inputDeviceCheckbox
anchors.left: parent.left anchors.left: parent.left
width: parent.width - inputLevel.width width: parent.width - inputLevel.width
height: paintedHeight height: 16
wrapLabel: false wrapLabel: false
checked: selectedDesktop checked: selectedDesktop
text: model.devicename text: model.devicename
@ -278,7 +274,6 @@ Flickable {
id: testYourMicButton id: testYourMicButton
enabled: !HMD.active enabled: !HMD.active
anchors.left: parent.left
Layout.topMargin: simplifiedUI.margins.settings.settingsGroupTopMargin Layout.topMargin: simplifiedUI.margins.settings.settingsGroupTopMargin
width: 160 width: 160
height: 32 height: 32
@ -313,8 +308,7 @@ Flickable {
ListView { ListView {
id: outputDeviceListView id: outputDeviceListView
anchors.left: parent.left Layout.preferredWidth: parent.width
anchors.right: parent.right
Layout.topMargin: simplifiedUI.margins.settings.settingsGroupTopMargin Layout.topMargin: simplifiedUI.margins.settings.settingsGroupTopMargin
interactive: false interactive: false
height: contentItem.height height: contentItem.height
@ -329,7 +323,7 @@ Flickable {
id: outputDeviceCheckbox id: outputDeviceCheckbox
anchors.left: parent.left anchors.left: parent.left
width: parent.width width: parent.width
height: paintedHeight height: 16
checked: selectedDesktop checked: selectedDesktop
text: model.devicename text: model.devicename
wrapLabel: false wrapLabel: false
@ -381,7 +375,6 @@ Flickable {
id: testYourSoundButton id: testYourSoundButton
enabled: !HMD.active enabled: !HMD.active
anchors.left: parent.left
Layout.topMargin: simplifiedUI.margins.settings.settingsGroupTopMargin Layout.topMargin: simplifiedUI.margins.settings.settingsGroupTopMargin
width: 160 width: 160
height: 32 height: 32

View file

@ -198,8 +198,7 @@ Flickable {
ListView { ListView {
id: inputDeviceListView id: inputDeviceListView
anchors.left: parent.left Layout.preferredWidth: parent.width
anchors.right: parent.right
Layout.topMargin: simplifiedUI.margins.settings.settingsGroupTopMargin Layout.topMargin: simplifiedUI.margins.settings.settingsGroupTopMargin
interactive: false interactive: false
height: contentItem.height height: contentItem.height
@ -214,8 +213,10 @@ Flickable {
id: inputDeviceCheckbox id: inputDeviceCheckbox
anchors.left: parent.left anchors.left: parent.left
width: parent.width - inputLevel.width width: parent.width - inputLevel.width
height: 16
checked: selectedHMD checked: selectedHMD
text: model.devicename text: model.devicename
wrapLabel: false
ButtonGroup.group: inputDeviceButtonGroup ButtonGroup.group: inputDeviceButtonGroup
onClicked: { onClicked: {
AudioScriptingInterface.setStereoInput(false); // the next selected audio device might not support stereo AudioScriptingInterface.setStereoInput(false); // the next selected audio device might not support stereo
@ -262,7 +263,6 @@ Flickable {
id: testYourMicButton id: testYourMicButton
enabled: HMD.active enabled: HMD.active
anchors.left: parent.left
Layout.topMargin: simplifiedUI.margins.settings.settingsGroupTopMargin Layout.topMargin: simplifiedUI.margins.settings.settingsGroupTopMargin
width: 160 width: 160
height: 32 height: 32
@ -297,8 +297,7 @@ Flickable {
ListView { ListView {
id: outputDeviceListView id: outputDeviceListView
anchors.left: parent.left Layout.preferredWidth: parent.width
anchors.right: parent.right
Layout.topMargin: simplifiedUI.margins.settings.settingsGroupTopMargin Layout.topMargin: simplifiedUI.margins.settings.settingsGroupTopMargin
interactive: false interactive: false
height: contentItem.height height: contentItem.height
@ -313,11 +312,13 @@ Flickable {
id: outputDeviceCheckbox id: outputDeviceCheckbox
anchors.left: parent.left anchors.left: parent.left
width: parent.width width: parent.width
checked: selectedDesktop height: 16
checked: selectedHMD
text: model.devicename text: model.devicename
wrapLabel: false
ButtonGroup.group: outputDeviceButtonGroup ButtonGroup.group: outputDeviceButtonGroup
onClicked: { onClicked: {
AudioScriptingInterface.setOutputDevice(model.info, true); // `false` argument for Desktop mode setting AudioScriptingInterface.setOutputDevice(model.info, true); // `true` argument for VR mode setting
} }
} }
} }
@ -363,7 +364,6 @@ Flickable {
id: testYourSoundButton id: testYourSoundButton
enabled: HMD.active enabled: HMD.active
anchors.left: parent.left
Layout.topMargin: simplifiedUI.margins.settings.settingsGroupTopMargin Layout.topMargin: simplifiedUI.margins.settings.settingsGroupTopMargin
width: 160 width: 160
height: 32 height: 32

View file

@ -103,6 +103,8 @@ var AVATAR_APP_PRESENTATION_MODE = Desktop.PresentationMode.NATIVE;
var AVATAR_APP_WIDTH_PX = 480; var AVATAR_APP_WIDTH_PX = 480;
var AVATAR_APP_HEIGHT_PX = 615; var AVATAR_APP_HEIGHT_PX = 615;
var avatarAppWindow = false; var avatarAppWindow = false;
var POPOUT_SAFE_MARGIN_X = 30;
var POPOUT_SAFE_MARGIN_Y = 30;
function toggleAvatarApp() { function toggleAvatarApp() {
if (avatarAppWindow) { if (avatarAppWindow) {
avatarAppWindow.close(); avatarAppWindow.close();
@ -119,6 +121,10 @@ function toggleAvatarApp() {
size: { size: {
x: AVATAR_APP_WIDTH_PX, x: AVATAR_APP_WIDTH_PX,
y: AVATAR_APP_HEIGHT_PX y: AVATAR_APP_HEIGHT_PX
},
position: {
x: Math.max(Window.x + POPOUT_SAFE_MARGIN_X, Window.x + Window.innerWidth / 2 - AVATAR_APP_WIDTH_PX / 2),
y: Math.max(Window.y + POPOUT_SAFE_MARGIN_Y, Window.y + Window.innerHeight / 2 - AVATAR_APP_HEIGHT_PX / 2)
} }
}); });
@ -181,6 +187,10 @@ function toggleSettingsApp() {
size: { size: {
x: SETTINGS_APP_WIDTH_PX, x: SETTINGS_APP_WIDTH_PX,
y: SETTINGS_APP_HEIGHT_PX y: SETTINGS_APP_HEIGHT_PX
},
position: {
x: Math.max(Window.x + POPOUT_SAFE_MARGIN_X, Window.x + Window.innerWidth / 2 - SETTINGS_APP_WIDTH_PX / 2),
y: Math.max(Window.y + POPOUT_SAFE_MARGIN_Y, Window.y + Window.innerHeight / 2 - SETTINGS_APP_HEIGHT_PX / 2)
} }
}); });