X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;f=qml%2FCameraToolBar.js;h=8ecb835d79dbfd53533628550946fae0ab1a1cda;hb=f4be72bb30e7cd830c738ae73c4bebea5f18845c;hp=fba19e31b953dde1862af66ee5fd16df0b39bebf;hpb=896d397cb4c88deb70a34d0e757d635c3dcd4c91;p=harmattan%2Fcameraplus diff --git a/qml/CameraToolBar.js b/qml/CameraToolBar.js index fba19e3..8ecb835 100644 --- a/qml/CameraToolBar.js +++ b/qml/CameraToolBar.js @@ -3,7 +3,7 @@ /*! * This file is part of CameraPlus. * - * Copyright (C) 2012 Mohammed Sameer + * Copyright (C) 2012-2013 Mohammed Sameer * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -56,16 +56,24 @@ function show(items) { width += items[x].width; } - var spacing = (tools.width - width - tools.menuWidth) / len; + var totalWidth = tools.width - width; + if (tools.hideBack) { + len -= 1; + } else { + totalWidth -= tools.menuWidth; + } - for (var x = 0; x < len; x++) { + var spacing = totalWidth / len; + + for (var x = 0; x < items.length; x++) { var child = items[x]; if (x != 0) { var prev = items[x - 1]; child.x = prev.x + prev.width + spacing; - } - else { + } else if (tools.hideBack) { + child.x = 0; + } else { child.x = spacing + 80; }