Improvements to switch; switch settings persist

This commit is contained in:
Zach Fox 2017-06-06 14:17:38 -07:00
parent afb7e72b25
commit ca05e3d0b6
3 changed files with 15 additions and 9 deletions

View file

@ -85,7 +85,7 @@ Item {
id: labelOff;
text: labelTextOff;
size: hifi.fontSizes.inputLabel;
color: hifi.colors.lightGrayText;
color: originalSwitch.checked ? hifi.colors.lightGrayText : hifi.colors.faintGray;
anchors.top: parent.top;
anchors.right: parent.right;
width: paintedWidth;
@ -97,7 +97,7 @@ Item {
id: labelGlyphOff;
text: labelGlyphOffText;
size: labelGlyphOffSize;
color: hifi.colors.lightGrayText;
color: labelOff.color;
anchors.top: parent.top;
anchors.topMargin: 2;
anchors.right: labelOff.left;
@ -126,7 +126,7 @@ Item {
id: labelOn;
text: labelTextOn;
size: hifi.fontSizes.inputLabel;
color: hifi.colors.lightGrayText;
color: originalSwitch.checked ? hifi.colors.faintGray : hifi.colors.lightGrayText;
anchors.top: parent.top;
anchors.left: parent.left;
width: paintedWidth;
@ -138,7 +138,7 @@ Item {
id: labelGlyphOn;
text: labelGlyphOnText;
size: labelGlyphOnSize;
color: hifi.colors.lightGrayText;
color: labelOn.color;
anchors.top: parent.top;
anchors.left: labelOn.right;
}

View file

@ -99,7 +99,7 @@ Rectangle {
// "Spectator" app description text
RalewayLight {
id: spectatorDescriptionText;
text: "Spectator lets you switch what your monitor displays while you're using an HMD. Use Spectator to stream and record video.";
text: "Spectator lets you change what your monitor displays while you're using an HMD. Use Spectator when streaming and recording video.";
// Text size
size: 14;
// Size
@ -244,7 +244,7 @@ Rectangle {
labelTextOn: "Camera View";
labelGlyphOnText: hifi.glyphs.alert;
onCheckedChanged: {
sendToScript({method: (checked ? 'showCameraViewOnMonitor' : 'showMyViewOnMonitor')});
sendToScript({method: (checked ? 'showCameraViewOnMonitor' : 'showHmdPreviewOnMonitor')});
}
}
@ -287,6 +287,9 @@ Rectangle {
case 'updateSpectatorCameraCheckbox':
cameraToggleCheckBox.checked = message.params;
break;
case 'updateMonitorShowsSwitch':
monitorShowsSwitch.checked = message.params;
break;
default:
console.log('Unrecognized message from spectatorCamera.js:', JSON.stringify(message));
}

View file

@ -223,6 +223,7 @@
tablet.loadQMLSource("../SpectatorCamera.qml");
onSpectatorCameraScreen = true;
sendToQml({ method: 'updateSpectatorCameraCheckbox', params: !!camera });
sendToQml({ method: 'updateMonitorShowsSwitch', params: !!Settings.getValue('spectatorCamera/monitorShowsCameraView', false) });
}
}
@ -285,11 +286,13 @@
case 'disableSpectatorCamera':
disableSpectatorCamera();
break;
case 'showHmdPreviewOnMonitor':
print('FIXME: showHmdPreviewOnMonitor');
Settings.setValue('spectatorCamera/monitorShowsCameraView', false);
break;
case 'showCameraViewOnMonitor':
print('FIXME: showCameraViewOnMonitor');
break;
case 'showMyViewOnMonitor':
print('FIXME: showMyViewOnMonitor');
Settings.setValue('spectatorCamera/monitorShowsCameraView', true);
break;
case 'changeSwitchViewFromControllerPreference':
print('FIXME: Preference is now: ' + message.params);