mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 23:16:50 +02:00
Format fixes, UI logos for collapse/expand toggle
This commit is contained in:
parent
2be95997d1
commit
7805cf4e48
1 changed files with 30 additions and 5 deletions
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
HIFI_PUBLIC_BUCKET = "http://s3.amazonaws.com/hifi-public/";
|
HIFI_PUBLIC_BUCKET = "http://s3.amazonaws.com/hifi-public/";
|
||||||
|
|
||||||
var SCALE = 1000;
|
var SLIDER_RANGE_INCREMENT_SCALE = 1 / 1000;
|
||||||
var THUMB_COLOR = {
|
var THUMB_COLOR = {
|
||||||
red: 150,
|
red: 150,
|
||||||
green: 150,
|
green: 150,
|
||||||
|
@ -59,7 +59,6 @@ var CHECK_MARK_COLOR = {
|
||||||
});
|
});
|
||||||
|
|
||||||
this.thumbSize = thumbSize;
|
this.thumbSize = thumbSize;
|
||||||
|
|
||||||
this.thumbHalfSize = 0.5 * thumbSize;
|
this.thumbHalfSize = 0.5 * thumbSize;
|
||||||
|
|
||||||
this.minThumbX = x + this.thumbHalfSize;
|
this.minThumbX = x + this.thumbHalfSize;
|
||||||
|
@ -128,7 +127,7 @@ var CHECK_MARK_COLOR = {
|
||||||
|
|
||||||
Slider.prototype.updateWithKeys = function(direction) {
|
Slider.prototype.updateWithKeys = function(direction) {
|
||||||
this.range = this.maxThumbX - this.minThumbX;
|
this.range = this.maxThumbX - this.minThumbX;
|
||||||
this.thumbX += direction * (this.range / SCALE);
|
this.thumbX += direction * (this.range * SCALE);
|
||||||
this.updateThumb();
|
this.updateThumb();
|
||||||
this.onValueChanged(this.getValue());
|
this.onValueChanged(this.getValue());
|
||||||
};
|
};
|
||||||
|
@ -211,6 +210,25 @@ var CHECK_MARK_COLOR = {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.setThumbColor = function(color) {
|
||||||
|
Overlays.editOverlay(this.thumb, {
|
||||||
|
backgroundColor: {
|
||||||
|
red: color.x * 255,
|
||||||
|
green: color.y * 255,
|
||||||
|
blue: color.z * 255
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
this.setBackgroundColor = function(color) {
|
||||||
|
Overlays.editOverlay(this.background, {
|
||||||
|
backgroundColor: {
|
||||||
|
red: color.x * 255,
|
||||||
|
green: color.y * 255,
|
||||||
|
blue: color.z * 255
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
Slider.prototype.hide = function() {
|
Slider.prototype.hide = function() {
|
||||||
Overlays.editOverlay(this.background, {
|
Overlays.editOverlay(this.background, {
|
||||||
visible: false
|
visible: false
|
||||||
|
@ -748,7 +766,7 @@ var CHECK_MARK_COLOR = {
|
||||||
green: 255,
|
green: 255,
|
||||||
blue: 255
|
blue: 255
|
||||||
},
|
},
|
||||||
imageURL: HIFI_PUBLIC_BUCKET + 'images/tools/min-max-toggle.svg',
|
imageURL: HIFI_PUBLIC_BUCKET + 'images/tools/expand-ui.svg',
|
||||||
x: x,
|
x: x,
|
||||||
y: y,
|
y: y,
|
||||||
width: rawHeight,
|
width: rawHeight,
|
||||||
|
@ -778,6 +796,7 @@ var CHECK_MARK_COLOR = {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
CollapsablePanelItem.prototype.destroy = function() {
|
CollapsablePanelItem.prototype.destroy = function() {
|
||||||
Overlays.deleteOverlay(this.title);
|
Overlays.deleteOverlay(this.title);
|
||||||
Overlays.deleteOverlay(this.thumb);
|
Overlays.deleteOverlay(this.thumb);
|
||||||
|
@ -1044,6 +1063,7 @@ var CHECK_MARK_COLOR = {
|
||||||
x: event.x,
|
x: event.x,
|
||||||
y: event.y
|
y: event.y
|
||||||
});
|
});
|
||||||
|
|
||||||
this.handleCollapse(clickedOverlay);
|
this.handleCollapse(clickedOverlay);
|
||||||
|
|
||||||
// If the user clicked any of the slider background then...
|
// If the user clicked any of the slider background then...
|
||||||
|
@ -1106,10 +1126,15 @@ var CHECK_MARK_COLOR = {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!item.isCollapsed && item.isCollapsable && clickedOverlay == item.thumb) {
|
if (!item.isCollapsed && item.isCollapsable && clickedOverlay == item.thumb) {
|
||||||
|
Overlays.editOverlay(item.thumb, {
|
||||||
|
imageURL: HIFI_PUBLIC_BUCKET + 'images/tools/expand-right.svg'
|
||||||
|
});
|
||||||
this.collapse(clickedOverlay);
|
this.collapse(clickedOverlay);
|
||||||
item.isCollapsed = true;
|
item.isCollapsed = true;
|
||||||
break;
|
|
||||||
} else if (item.isCollapsed && item.isCollapsable && clickedOverlay == item.thumb) {
|
} else if (item.isCollapsed && item.isCollapsable && clickedOverlay == item.thumb) {
|
||||||
|
Overlays.editOverlay(item.thumb, {
|
||||||
|
imageURL: HIFI_PUBLIC_BUCKET + 'images/tools/expand-ui.svg'
|
||||||
|
});
|
||||||
this.expand(clickedOverlay);
|
this.expand(clickedOverlay);
|
||||||
item.isCollapsed = false;
|
item.isCollapsed = false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue