X-Git-Url: http://cgit.sxemacs.org/?p=harmattan%2Fcameraplus;a=blobdiff_plain;f=qml%2FVideoTorchButton.qml;h=0f0577355261a0f025be4736ad046ba2ff9468eb;hp=07e0688e490f755fdb50021343852b3b38f16a54;hb=b37d0ab04228a193a8302417f0657a73c8fdbd3f;hpb=05e21701ebc9bca101848eea51f454989900dd96 diff --git a/qml/VideoTorchButton.qml b/qml/VideoTorchButton.qml index 07e0688..0f05773 100644 --- a/qml/VideoTorchButton.qml +++ b/qml/VideoTorchButton.qml @@ -1,18 +1,39 @@ // -*- qml -*- -import QtQuick 1.1 -import com.nokia.meego 1.1 + +/*! + * This file is part of CameraPlus. + * + * 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 + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +import QtQuick 2.0 import QtCamera 1.0 -Button { - id: button - width: 56 - height: 56 - opacity: 0.5 +CameraToolIcon { + id: button + property Camera camera: null + + iconSource: settings.videoTorchOn ? cameraTheme.cameraTorchOnIconId : cameraTheme.cameraTorchOffIconId + onClicked: settings.videoTorchOn = !settings.videoTorchOn - iconSource: torch.on ? "/usr/share/themes/blanco/meegotouch/icons/icon-m-camera-torch-on.png" : "/usr/share/themes/blanco/meegotouch/icons/icon-m-camera-torch-off.png" - onClicked: torch.on = !torch.on - VideoTorch { - id: torch - camera: cam - } + Binding { + target: camera ? camera.videoTorch : null + property: "on" + value: settings.videoTorchOn + when: camera != null + } }