use themed timeline colors

This commit is contained in:
rolux 2012-12-28 17:59:34 +01:00
parent 9efb64e620
commit 641a3043cb

View file

@ -80,7 +80,7 @@ Ox.SmallVideoTimelineImage = function(options, self) {
self.imageHeight = self.options.mode == 'player' ? 16 : 18; self.imageHeight = self.options.mode == 'player' ? 16 : 18;
self.imageTop = self.options.mode == 'player' ? 0 : 3; self.imageTop = self.options.mode == 'player' ? 0 : 3;
self.timelineTop = self.options.mode == 'player' ? 0 : 4; self.timelineTop = self.options.mode == 'player' ? 0 : 4;
self.theme = Ox.Theme(); self.themeData = Ox.Theme.getThemeData();
that.css({ that.css({
height: self.height + 'px' height: self.height + 'px'
@ -172,13 +172,13 @@ Ox.SmallVideoTimelineImage = function(options, self) {
), ),
right = Math.round( right = Math.round(
result.out / self.options.duration * width result.out / self.options.duration * width
) + 1; ) + 1,
rgb = self.themeData.videoTimelineResultGradient;
Ox.loop(left, right, function(x) { Ox.loop(left, right, function(x) {
Ox.loop(top, bottom, function(y) { Ox.loop(top, bottom, function(y) {
var alpha = self.options.mode == 'editor' var alpha = self.options.mode == 'editor'
&& (y == top || y == bottom - 1) ? 255 : 128, && (y == top || y == bottom - 1) ? 255 : 128,
color = [2, 3, 6].indexOf(x % 4 + y % 4) > -1 color = rgb[[2, 3, 6].indexOf(x % 4 + y % 4) > -1 ? 0 : 1],
? [0, 0, 0] : [255, 255, 0],
index = x * 4 + y * 4 * width; index = x * 4 + y * 4 * width;
data[index] = color[0]; data[index] = color[0];
data[index + 1] = color[1]; data[index + 1] = color[1];
@ -196,10 +196,12 @@ Ox.SmallVideoTimelineImage = function(options, self) {
) + 1, ) + 1,
top = 0, top = 0,
bottom = height, bottom = height,
rgb = self.options.state == 'editing' ? [[0, 128, 0], [128, 255, 128]] rgb = self.themeData[
: self.options.state == 'editable' ? [[0, 0, 128], [128, 128, 255]] self.options.state == 'editable' ? 'videoTimelineEditableGradient'
: self.options.state == 'selected' ? [[0, 0, 0], [255, 255, 255]] : self.options.state == 'editing' ? 'videoTimelineEditingGradient'
: [[32, 32, 32], [224, 224, 224]]; : self.options.state == 'selected' ? 'videoTimelineSelectedGradient'
: 'videoTimelineDefaultGradient'
];
Ox.loop(left, right, function(x) { Ox.loop(left, right, function(x) {
Ox.loop(top, bottom, function(y) { Ox.loop(top, bottom, function(y) {
var alpha = self.options.mode == 'editor' var alpha = self.options.mode == 'editor'