Add maxIconSize option.

This commit is contained in:
Lars Jung 2015-05-15 01:17:00 +02:00
parent 9eb29b5707
commit fe9c7587d8
3 changed files with 6 additions and 6 deletions

View file

@ -25,6 +25,7 @@ Options
- hideFolders: boolean, hide all folders in the main view - hideFolders: boolean, hide all folders in the main view
- hideIf403: boolean, hide files and folders that are not readable by the server - hideIf403: boolean, hide files and folders that are not readable by the server
- hideParentFolder: boolean, hide parent folder links in the main view - hideParentFolder: boolean, hide parent folder links in the main view
- maxIconSize: number, max size for icons in the main view
- modes: array of strings, subset of ["details", "grid", "icons"] - modes: array of strings, subset of ["details", "grid", "icons"]
the first value indicates the default view mode. If only one value the first value indicates the default view mode. If only one value
is given the view mode is fixed and the selector buttons are hidden. is given the view mode is fixed and the selector buttons are hidden.
@ -48,10 +49,11 @@ Options
"hideFolders": false, "hideFolders": false,
"hideIf403": true, "hideIf403": true,
"hideParentFolder": false, "hideParentFolder": false,
"maxIconSize": 40,
"modes": ["details", "grid", "icons"], "modes": ["details", "grid", "icons"],
"modeToggle": false, "modeToggle": false,
"setParentFolderLabels": true, "setParentFolderLabels": true,
"sizes": [20, 40, 60, 80, 100, 150, 200, 250, 300, 350, 400], "sizes": [20, 40, 60, 80, 100, 140, 180, 220, 260, 300],
"theme": "", "theme": "",
"unmanaged": ["index.html", "index.htm", "index.php"], "unmanaged": ["index.html", "index.htm", "index.php"],
"unmanagedInNewWindow": false "unmanagedInNewWindow": false

View file

@ -1,5 +1,4 @@
#view { #view {
@max-icon-size: 32px;
a, a:active, a:visited { a, a:active, a:visited {
display: block; display: block;
@ -41,8 +40,6 @@
text-align: center; text-align: center;
img { img {
max-width: @max-icon-size;
max-height: @max-icon-size;
position: relative; position: relative;
top: 50%; top: 50%;
transform: translateY(-50%); transform: translateY(-50%);

View file

@ -48,8 +48,8 @@ modulejs.define('view/view', ['_', '$', 'core/event', 'core/format', 'core/locat
function createStyles(size) { function createStyles(size) {
var dsize = cropSize(size, 20, 80); var dsize = cropSize(size, 20, 80);
var gsize = cropSize(size, 40, 150); var gsize = cropSize(size, 40, 160);
var isize = cropSize(size, 80, 2000); var isize = cropSize(size, 80, 1000);
var ilsize = Math.round(isize * 4 / 3); var ilsize = Math.round(isize * 4 / 3);
var rules = [ var rules = [
'#view.view-details.view-size-' + size + ' .item .label { line-height: ' + (dsize + 14) + 'px !important; }', '#view.view-details.view-size-' + size + ' .item .label { line-height: ' + (dsize + 14) + 'px !important; }',
@ -75,6 +75,7 @@ modulejs.define('view/view', ['_', '$', 'core/event', 'core/format', 'core/locat
function addCssStyles() { function addCssStyles() {
var styles = _.map(sortedSizes, function (size) { return createStyles(size); }); var styles = _.map(sortedSizes, function (size) { return createStyles(size); });
styles.push('#view .icon img { max-width: ' + settings.maxIconSize + 'px; max-height: ' + settings.maxIconSize + 'px; }');
$('<style/>').text(styles.join('\n')).appendTo('head'); $('<style/>').text(styles.join('\n')).appendTo('head');
} }