X-Git-Url: http://cgit.sxemacs.org/?p=harmattan%2Fcameraplus;a=blobdiff_plain;f=qml%2FVideoTorchButton.qml;h=dda5a2ba6383daa0354c2dba394a56bcd4bbc62d;hp=786e94b0ba56ae787126ed490e1969f98b91bd45;hb=d9f0af7e2ceb416fd44a0ca14d20df8604754dd1;hpb=8fda608e8809c2b5c1b0db2a10e6099b73759ce8 diff --git a/qml/VideoTorchButton.qml b/qml/VideoTorchButton.qml index 786e94b..dda5a2b 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,21 @@ * 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 -Button { - id: button - width: 56 - height: 56 - opacity: 0.5 +CameraToolIcon { + id: button + property Camera camera: null - iconSource: torch.on ? "image://theme/icon-m-camera-torch-on" : "image://theme/icon-m-camera-torch-off" - onClicked: torch.on = !torch.on - VideoTorch { - id: torch - camera: cam - } + iconSource: settings.videoTorchOn ? "image://theme/icon-m-camera-torch-on" + : "image://theme/icon-m-camera-torch-off" + onClicked: settings.videoTorchOn = !settings.videoTorchOn + + Binding { + target: camera ? camera.videoTorch : null + property: "on" + value: settings.videoTorchOn + when: camera != null + } }