Merge branch 'master' of github.com:highfidelity/hifi into groups

This commit is contained in:
Seth Alves 2016-06-17 17:37:41 -07:00
commit 1527780351
3 changed files with 75 additions and 48 deletions

View file

@ -614,12 +614,6 @@ ModalWindow {
readOnly: !root.saveDialog
activeFocusOnTab: !readOnly
onActiveFocusChanged: if (activeFocus) { selectAll(); }
onTextChanged: {
if (root.saveDialog && text !== "") {
fileTableView.selection.clear();
fileTableView.currentRow = -1;
}
}
onAccepted: okAction.trigger();
}

View file

@ -452,6 +452,7 @@
var elTextText = document.getElementById("property-text-text");
var elTextLineHeight = document.getElementById("property-text-line-height");
var elTextTextColor = document.getElementById("property-text-text-color");
var elTextFaceCamera = document.getElementById("property-text-face-camera");
var elTextTextColorRed = document.getElementById("property-text-text-color-red");
var elTextTextColorGreen = document.getElementById("property-text-text-color-green");
var elTextTextColorBlue = document.getElementById("property-text-text-color-blue");
@ -726,6 +727,7 @@
elTextText.value = properties.text;
elTextLineHeight.value = properties.lineHeight.toFixed(4);
elTextFaceCamera = properties.faceCamera;
elTextTextColor.style.backgroundColor = "rgb(" + properties.textColor.red + "," + properties.textColor.green + "," + properties.textColor.blue + ")";
elTextTextColorRed.value = properties.textColor.red;
elTextTextColorGreen.value = properties.textColor.green;
@ -988,8 +990,8 @@
elModelTextures.addEventListener('change', createEmitTextPropertyUpdateFunction('textures'));
elTextText.addEventListener('change', createEmitTextPropertyUpdateFunction('text'));
elTextFaceCamera.addEventListener('change', createEmitCheckedPropertyUpdateFunction('faceCamera'));
elTextLineHeight.addEventListener('change', createEmitNumberPropertyUpdateFunction('lineHeight'));
var textTextColorChangeFunction = createEmitColorPropertyUpdateFunction(
'textColor', elTextTextColorRed, elTextTextColorGreen, elTextTextColorBlue);
elTextTextColorRed.addEventListener('change', textTextColorChangeFunction);
@ -1707,6 +1709,10 @@
<label for="property-text-text">Text content</label>
<input type="text" id="property-text-text">
</div>
<div class="text-group text-section property checkbox">
<input type="checkbox" id="property-text-face-camera">
<label for="property-text-face-camera">&nbsp;Face Camera</label>
</div>
<div class="text-group text-section property number">
<label>Line height <span class="unit">m</span></label>
<input type="number" id="property-text-line-height" min="0" step="0.005">

View file

@ -253,7 +253,11 @@ var usersWindow = (function () {
WINDOW_BORDER_BOTTOM_MARGIN = WINDOW_BASE_MARGIN,
WINDOW_BORDER_LEFT_MARGIN = WINDOW_BASE_MARGIN,
WINDOW_BORDER_RADIUS = 4,
WINDOW_BORDER_COLOR = { red: 255, green: 255, blue: 255 },
WINDOW_BORDER_COLOR = {
red: 255,
green: 255,
blue: 255
},
WINDOW_BORDER_ALPHA = 0.5,
windowBorder,
@ -379,7 +383,10 @@ var usersWindow = (function () {
windowPosition = {}, // Bottom left corner of window pane.
isMovingWindow = false,
movingClickOffset = { x: 0, y: 0 },
movingClickOffset = {
x: 0,
y: 0
},
isUsingScrollbars = false,
isMovingScrollbar = false,
@ -401,9 +408,7 @@ var usersWindow = (function () {
}
// Reserve space for title, friends button, and option controls
nonUsersHeight = WINDOW_MARGIN + windowLineHeight + FRIENDS_BUTTON_SPACER + FRIENDS_BUTTON_HEIGHT + DISPLAY_SPACER
+ windowLineHeight + VISIBILITY_SPACER
+ windowLineHeight + WINDOW_BASE_MARGIN;
nonUsersHeight = WINDOW_MARGIN + windowLineHeight + FRIENDS_BUTTON_SPACER + FRIENDS_BUTTON_HEIGHT + DISPLAY_SPACER + windowLineHeight + VISIBILITY_SPACER + windowLineHeight + WINDOW_BASE_MARGIN;
// Limit window to height of viewport above window position minus VU meter and mirror if displayed
windowHeight = linesOfUsers.length * windowLineHeight - windowLineSpacing + nonUsersHeight;
@ -456,17 +461,14 @@ var usersWindow = (function () {
x: scrollbarBackgroundPosition.x,
y: scrollbarBackgroundPosition.y
});
scrollbarBarPosition.y = scrollbarBackgroundPosition.y + 1
+ scrollbarValue * (scrollbarBackgroundHeight - scrollbarBarHeight - 2);
scrollbarBarPosition.y = scrollbarBackgroundPosition.y + 1 + scrollbarValue * (scrollbarBackgroundHeight - scrollbarBarHeight - 2);
Overlays.editOverlay(scrollbarBar, {
x: scrollbarBackgroundPosition.x + 1,
y: scrollbarBarPosition.y
});
x = windowLeft + WINDOW_MARGIN;
y = windowPosition.y - FRIENDS_BUTTON_HEIGHT - DISPLAY_SPACER
- windowLineHeight - VISIBILITY_SPACER
- windowLineHeight - WINDOW_BASE_MARGIN;
y = windowPosition.y - FRIENDS_BUTTON_HEIGHT - DISPLAY_SPACER - windowLineHeight - VISIBILITY_SPACER - windowLineHeight - WINDOW_BASE_MARGIN;
Overlays.editOverlay(friendsButton, {
x: x,
y: y
@ -554,8 +556,35 @@ var usersWindow = (function () {
usersRequest.ontimeout = pollUsersTimedOut;
usersRequest.onreadystatechange = processUsers;
usersRequest.send();
checkLoggedIn();
}
var loggedIn = false;
function checkLoggedIn() {
loggedIn = Account.isLoggedIn();
if (loggedIn === false) {
Overlays.editOverlay(friendsButton, {
visible: false
});
visibilityControl.setVisible(false);
displayControl.setVisible(false);
} else {
if (isMinimized === true) {
loggedIn = true;
return
}
Overlays.editOverlay(friendsButton, {
visible: true
});
visibilityControl.setVisible(true);
displayControl.setVisible(true);
loggedIn = true;
}
}
processUsers = function() {
var response,
myUsername,
@ -633,6 +662,8 @@ var usersWindow = (function () {
Overlays.editOverlay(scrollbarBar, {
visible: isVisible && isUsingScrollbars && !isMinimized
});
if (loggedIn === true) {
Overlays.editOverlay(friendsButton, {
visible: isVisible && !isMinimized
});
@ -640,6 +671,8 @@ var usersWindow = (function () {
visibilityControl.setVisible(isVisible && !isMinimized);
}
}
function setVisible(visible) {
isVisible = visible;
@ -730,9 +763,7 @@ var usersWindow = (function () {
userClicked = firstUserToDisplay + lineClicked;
if (0 <= userClicked && userClicked < linesOfUsers.length && 0 <= overlayX
&& overlayX <= usersOnline[linesOfUsers[userClicked]].textWidth) {
//print("Go to " + usersOnline[linesOfUsers[userClicked]].username);
if (0 <= userClicked && userClicked < linesOfUsers.length && 0 <= overlayX && overlayX <= usersOnline[linesOfUsers[userClicked]].textWidth) {
location.goToUser(usersOnline[linesOfUsers[userClicked]].username);
}
@ -800,12 +831,8 @@ var usersWindow = (function () {
var isVisible;
if (isMovingScrollbar) {
if (scrollbarBackgroundPosition.x - WINDOW_MARGIN <= event.x
&& event.x <= scrollbarBackgroundPosition.x + SCROLLBAR_BACKGROUND_WIDTH + WINDOW_MARGIN
&& scrollbarBackgroundPosition.y - WINDOW_MARGIN <= event.y
&& event.y <= scrollbarBackgroundPosition.y + scrollbarBackgroundHeight + WINDOW_MARGIN) {
scrollbarValue = (event.y - scrollbarBarClickedAt * scrollbarBarHeight - scrollbarBackgroundPosition.y)
/ (scrollbarBackgroundHeight - scrollbarBarHeight - 2);
if (scrollbarBackgroundPosition.x - WINDOW_MARGIN <= event.x && event.x <= scrollbarBackgroundPosition.x + SCROLLBAR_BACKGROUND_WIDTH + WINDOW_MARGIN && scrollbarBackgroundPosition.y - WINDOW_MARGIN <= event.y && event.y <= scrollbarBackgroundPosition.y + scrollbarBackgroundHeight + WINDOW_MARGIN) {
scrollbarValue = (event.y - scrollbarBarClickedAt * scrollbarBarHeight - scrollbarBackgroundPosition.y) / (scrollbarBackgroundHeight - scrollbarBarHeight - 2);
scrollbarValue = Math.min(Math.max(scrollbarValue, 0.0), 1.0);
firstUserToDisplay = Math.floor(scrollbarValue * (linesOfUsers.length - numUsersToDisplay));
updateOverlayPositions();
@ -831,13 +858,9 @@ var usersWindow = (function () {
isVisible = isBorderVisible;
if (isVisible) {
isVisible = windowPosition.x - WINDOW_BORDER_LEFT_MARGIN <= event.x
&& event.x <= windowPosition.x - WINDOW_BORDER_LEFT_MARGIN + WINDOW_BORDER_WIDTH
&& windowPosition.y - windowHeight - WINDOW_BORDER_TOP_MARGIN <= event.y
&& event.y <= windowPosition.y + WINDOW_BORDER_BOTTOM_MARGIN;
isVisible = windowPosition.x - WINDOW_BORDER_LEFT_MARGIN <= event.x && event.x <= windowPosition.x - WINDOW_BORDER_LEFT_MARGIN + WINDOW_BORDER_WIDTH && windowPosition.y - windowHeight - WINDOW_BORDER_TOP_MARGIN <= event.y && event.y <= windowPosition.y + WINDOW_BORDER_BOTTOM_MARGIN;
} else {
isVisible = windowPosition.x <= event.x && event.x <= windowPosition.x + WINDOW_WIDTH
&& windowPosition.y - windowHeight <= event.y && event.y <= windowPosition.y;
isVisible = windowPosition.x <= event.x && event.x <= windowPosition.x + WINDOW_WIDTH && windowPosition.y - windowHeight <= event.y && event.y <= windowPosition.y;
}
if (isVisible !== isBorderVisible) {
isBorderVisible = isVisible;
@ -878,8 +901,7 @@ var usersWindow = (function () {
isMirrorDisplay = Menu.isOptionChecked(MIRROR_MENU_ITEM);
isFullscreenMirror = Menu.isOptionChecked(FULLSCREEN_MIRROR_MENU_ITEM);
if (viewport.y !== oldViewport.y || isMirrorDisplay !== oldIsMirrorDisplay
|| isFullscreenMirror !== oldIsFullscreenMirror) {
if (viewport.y !== oldViewport.y || isMirrorDisplay !== oldIsMirrorDisplay || isFullscreenMirror !== oldIsFullscreenMirror) {
calculateWindowHeight();
updateUsersDisplay();
}
@ -1101,6 +1123,11 @@ var usersWindow = (function () {
visible: isVisible && !isMinimized
});
Script.setTimeout(function() {
checkLoggedIn()
}, 0);
Controller.mousePressEvent.connect(onMousePressEvent);
Controller.mouseMoveEvent.connect(onMouseMoveEvent);
Controller.mouseReleaseEvent.connect(onMouseReleaseEvent);