update files dialog

This commit is contained in:
rolux 2013-03-24 12:30:56 +00:00
parent c4fd2fb48c
commit 2aabb6f69a

View file

@ -6,7 +6,7 @@ pandora.ui.filesDialog = function() {
var dialogHeight = Math.round((window.innerHeight - 48) * 0.9), var dialogHeight = Math.round((window.innerHeight - 48) * 0.9),
dialogWidth = Math.round(window.innerWidth * 0.9), dialogWidth = Math.round(window.innerWidth * 0.9),
itemWidth = 256, itemWidth = 272 + Ox.UI.SCROLLBAR_SIZE,
selected = null, selected = null,
$findSelect = Ox.Select({ $findSelect = Ox.Select({
@ -140,7 +140,7 @@ pandora.ui.filesDialog = function() {
$itemLabel = Ox.Label({ $itemLabel = Ox.Label({
textAlign: 'center', textAlign: 'center',
title: 'No file selected', title: 'No file selected',
width: 248 width: itemWidth - 8
}) })
.css({margin: '4px'}), .css({margin: '4px'}),
@ -213,8 +213,12 @@ pandora.ui.filesDialog = function() {
resize: setWidth resize: setWidth
}), }),
resizable: true, resizable: true,
resize: [256, 384, 512], resize: [
size: 256 272 + Ox.UI.SCROLLBAR_SIZE,
400 + Ox.UI.SCROLLBAR_SIZE,
528 + Ox.UI.SCROLLBAR_SIZE
],
size: 272 + Ox.UI.SCROLLBAR_SIZE
} }
], ],
orientation: 'horizontal' orientation: 'horizontal'
@ -271,15 +275,10 @@ pandora.ui.filesDialog = function() {
} }
function getPreviewSize() { function getPreviewSize() {
var left = 0, var ratio = $list.value(selected, 'ratio'),
ratio = $list.value(selected, 'ratio'), height = ratio < 1 ? 256 : 256 / ratio,
width = itemWidth - 16 - Ox.UI.SCROLLBAR_SIZE, width = ratio >= 1 ? 256 : 256 * ratio,
height = Math.round(width / ratio);
if (height > 256) {
height = 256;
width = Math.round(height * ratio);
left = Math.floor((itemWidth - 16 - Ox.UI.SCROLLBAR_SIZE - width) / 2); left = Math.floor((itemWidth - 16 - Ox.UI.SCROLLBAR_SIZE - width) / 2);
}
return { return {
height: height, height: height,
// fixme: CSS gets applied twice, to image and enclosing element // fixme: CSS gets applied twice, to image and enclosing element
@ -328,6 +327,14 @@ pandora.ui.filesDialog = function() {
value: Ox.formatValue(file.size, 'B'), value: Ox.formatValue(file.size, 'B'),
width: itemWidth - 16 - Ox.UI.SCROLLBAR_SIZE width: itemWidth - 16 - Ox.UI.SCROLLBAR_SIZE
}), }),
Ox.Input({
disabled: true,
id: 'matches',
label: 'Matches',
labelWidth: 80,
value: file.matches,
width: itemWidth - 16 - Ox.UI.SCROLLBAR_SIZE
}),
Ox.Input({ Ox.Input({
disabled: !editable, disabled: !editable,
height: 256, height: 256,