X-Git-Url: http://cgit.sxemacs.org/?p=harmattan%2Fcameraplus;a=blobdiff_plain;f=qml%2FVideoTorchButton.qml;h=0f0577355261a0f025be4736ad046ba2ff9468eb;hp=7958d7d9d333b1d59ea3c390fea19987bbbfe6de;hb=c54bd1327085d9e1d8a9ff3236aa805842545a3e;hpb=896d397cb4c88deb70a34d0e757d635c3dcd4c91 diff --git a/qml/VideoTorchButton.qml b/qml/VideoTorchButton.qml index 7958d7d..0f05773 100644 --- a/qml/VideoTorchButton.qml +++ b/qml/VideoTorchButton.qml @@ -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 @@ -20,20 +20,20 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -import QtQuick 1.1 -import com.nokia.meego 1.1 +import QtQuick 2.0 import QtCamera 1.0 -ToolIcon { - id: button - property Camera camera: null +CameraToolIcon { + id: button + property Camera camera: null - iconSource: settings.videoTorchOn ? "image://theme/icon-m-camera-torch-on" : "image://theme/icon-m-camera-torch-off" - onClicked: settings.videoTorchOn = !settings.videoTorchOn + iconSource: settings.videoTorchOn ? cameraTheme.cameraTorchOnIconId : cameraTheme.cameraTorchOffIconId + onClicked: settings.videoTorchOn = !settings.videoTorchOn - Binding { - target: camera.videoTorch - property: "on" - value: settings.videoTorchOn - } + Binding { + target: camera ? camera.videoTorch : null + property: "on" + value: settings.videoTorchOn + when: camera != null + } }