Move all icon ids used in .qml files into CameraTheme and create a harmattan theme
authorMohammed Sameer <msameer@foolab.org>
Wed, 31 Jul 2013 20:16:19 +0000 (23:16 +0300)
committerMohammed Sameer <msameer@foolab.org>
Wed, 31 Jul 2013 20:16:19 +0000 (23:16 +0300)
16 files changed:
qml/CameraToolBar.qml
qml/ImageEvCompButton.qml
qml/ImageOverlay.qml
qml/MainPage.qml
qml/ModeButton.qml
qml/PostCaptureItem.qml
qml/PostCaptureView.qml
qml/RecordingDurationLabel.qml
qml/Standby.qml
qml/VideoEvCompButton.qml
qml/VideoMuteButton.qml
qml/VideoOverlay.qml
qml/VideoPlayerPage.qml
qml/VideoTorchButton.qml
qml/harmattan/CameraTheme.qml [new file with mode: 0644]
qml/harmattan/harmattan.qrc

index 143bc98..52b50ee 100644 (file)
@@ -48,7 +48,7 @@ Rectangle {
         visible: !parent.hideBack
         id: menu
         anchors.verticalCenter: parent.verticalCenter
         visible: !parent.hideBack
         id: menu
         anchors.verticalCenter: parent.verticalCenter
-        iconId: "icon-m-toolbar-back-white"
+        iconId: cameraTheme.cameraToolBarMenuIcon
         onClicked: {
             if (tools.manualBack) {
                 tools.clicked()
         onClicked: {
             if (tools.manualBack) {
                 tools.clicked()
index 2dbaf33..0f6ba56 100644 (file)
@@ -26,7 +26,7 @@ import QtCamera 1.0
 CameraToolIcon {
     id: button
 
 CameraToolIcon {
     id: button
 
-    iconId: settings.imageEvComp == 0 ? "icon-m-camera-manual-exposure" : ""
+    iconId: settings.imageEvComp == 0 ? cameraTheme.cameraManualExposureIconId : ""
 
     CameraLabel {
         anchors.fill: parent
 
     CameraLabel {
         anchors.fill: parent
index c016cc4..fe01b37 100644 (file)
@@ -73,7 +73,7 @@ Item {
         anchors.right: parent.right
         anchors.rightMargin: 20
         anchors.verticalCenter: parent.verticalCenter
         anchors.right: parent.right
         anchors.rightMargin: 20
         anchors.verticalCenter: parent.verticalCenter
-        iconId: "icon-m-camera-shutter"
+        iconId: cameraTheme.captureButtonImageIconId
         width: 75
         height: 75
         opacity: 0.5
         width: 75
         height: 75
         opacity: 0.5
@@ -193,7 +193,7 @@ Item {
             Indicator {
                 id: gpsIndicator
                 visible: settings.useGps
             Indicator {
                 id: gpsIndicator
                 visible: settings.useGps
-                source: "image://theme/icon-m-camera-location"
+                source: cameraTheme.gpsIndicatorIcon
 
                 PropertyAnimation on opacity  {
                     easing.type: Easing.OutSine
 
                 PropertyAnimation on opacity  {
                     easing.type: Easing.OutSine
@@ -209,7 +209,7 @@ Item {
             Indicator {
                 id: faceDetectionIndicator
                 visible: settings.faceDetectionEnabled
             Indicator {
                 id: faceDetectionIndicator
                 visible: settings.faceDetectionEnabled
-                source: "image://theme/icon-m-camera-face-detection-screen"
+                source: cameraTheme.faceDetectionIndicatorIcon
             }
 
         }
             }
 
         }
index c1ca7bc..3b51009 100644 (file)
@@ -29,6 +29,10 @@ import CameraPlus 1.0
 CameraPage {
     id: root
 
 CameraPage {
     id: root
 
+    CameraTheme {
+        id: cameraTheme
+    }
+
     VisualItemModel {
         id: mainModel
 
     VisualItemModel {
         id: mainModel
 
index f25664c..74dcde3 100644 (file)
@@ -29,8 +29,7 @@ CaptureButton {
     height: 55
     opacity: 0.5
 
     height: 55
     opacity: 0.5
 
-    iconId: settings.mode == Camera.VideoMode ? "icon-m-viewfinder-camera" : "icon-m-camera-video"
-
+    iconId: settings.mode == Camera.VideoMode ? cameraTheme.cameraImageIconId : cameraTheme.cameraVideoIconId
     onClicked: {
         if (settings.mode == Camera.VideoMode) {
             settings.mode = Camera.ImageMode
     onClicked: {
         if (settings.mode == Camera.VideoMode) {
             settings.mode = Camera.ImageMode
index cc0e2f9..c190075 100644 (file)
@@ -92,7 +92,7 @@ Item {
             CameraToolIcon {
                 id: playIcon
                 anchors.horizontalCenter: parent.horizontalCenter
             CameraToolIcon {
                 id: playIcon
                 anchors.horizontalCenter: parent.horizontalCenter
-                iconId: "icon-m-toolbar-mediacontrol-play-white"
+                iconId: cameraTheme.videoPlayIconId
                 visible: isVideo
                 onClicked: startPlayback()
             }
                 visible: isVideo
                 onClicked: startPlayback()
             }
index de8c016..603798b 100644 (file)
@@ -119,28 +119,28 @@ Item {
 
         items: [
             CameraToolIcon {
 
         items: [
             CameraToolIcon {
-                iconId: !available ? "icon-m-toolbar-favorite-mark-dimmed-white" : view.currentItem.itemData.favorite ? "icon-m-toolbar-favorite-mark-white" : "icon-m-toolbar-favorite-unmark-white"
+                iconId: !available ? cameraTheme.favoriteDisabledIconId : view.currentItem.itemData.favorite ? cameraTheme.favoriteMarkIconId : cameraTheme.favoriteUnmarkIconId
                 onClicked: {
                     addOrRemoveFavorite()
                     restartTimer()
                 }
             },
             CameraToolIcon {
                 onClicked: {
                     addOrRemoveFavorite()
                     restartTimer()
                 }
             },
             CameraToolIcon {
-                iconId: available ? "icon-m-toolbar-share-white" : "icon-m-toolbar-share-dimmed-white"
+                iconId: available ? cameraTheme.shareEnabledIconId : cameraTheme.shareDisabledIconId
                 onClicked: {
                     shareCurrentItem()
                     restartTimer()
                 }
             },
             CameraToolIcon {
                 onClicked: {
                     shareCurrentItem()
                     restartTimer()
                 }
             },
             CameraToolIcon {
-                iconId: available ? "icon-m-toolbar-delete-white" : "icon-m-toolbar-delete-dimmed-white"
+                iconId: available ? cameraTheme.deleteEnabledIconId : cameraTheme.deleteDisabledIconId
                 onClicked: {
                     deleteCurrentItem()
                     restartTimer()
                 }
             },
             CameraToolIcon {
                 onClicked: {
                     deleteCurrentItem()
                     restartTimer()
                 }
             },
             CameraToolIcon {
-                iconId: "icon-m-toolbar-view-menu-white"
+                iconId: cameraTheme.menuIconId
                 onClicked: {
                     menu.open()
                     restartTimer()
                 onClicked: {
                     menu.open()
                     restartTimer()
index 8362195..274d266 100644 (file)
@@ -37,7 +37,7 @@ Rectangle {
 
     Image {
         id: recordingIcon
 
     Image {
         id: recordingIcon
-        source: "image://theme/icon-m-camera-ongoing-recording"
+        source: cameraTheme.recordingDurationIcon
         width: 20
         height: 20
         anchors.verticalCenter: parent.verticalCenter
         width: 20
         height: 20
         anchors.verticalCenter: parent.verticalCenter
index f3f0229..757f1c7 100644 (file)
@@ -46,7 +46,7 @@ Rectangle {
 
     Image {
         id: icon
 
     Image {
         id: icon
-        source: "image://theme/icon-l-camera-standby"
+        source: cameraTheme.standbyIcon
         anchors.centerIn: parent
     }
 
         anchors.centerIn: parent
     }
 
index a799f67..50cdaeb 100644 (file)
@@ -26,7 +26,7 @@ import QtCamera 1.0
 CameraToolIcon {
     id: button
 
 CameraToolIcon {
     id: button
 
-    iconId: settings.videoEvComp == 0 ? "icon-m-camera-manual-exposure" : ""
+    iconId: settings.videoEvComp == 0 ? cameraTheme.cameraManualExposureIconId : ""
 
     CameraLabel {
         anchors.fill: parent
 
     CameraLabel {
         anchors.fill: parent
index dafe895..c480dc6 100644 (file)
@@ -23,7 +23,6 @@
 import QtQuick 2.0
 
 CameraToolIcon {
 import QtQuick 2.0
 
 CameraToolIcon {
-    iconId: settings.videoMuted ? "icon-m-toolbar-volume-off-white-selected"
-        : "icon-m-toolbar-volume-white-selected"
+    iconId: settings.videoMuted ? cameraTheme.soundMuteOnIconId : cameraTheme.soundMuteOffIconId
     onClicked: settings.videoMuted = !settings.videoMuted
 }
     onClicked: settings.videoMuted = !settings.videoMuted
 }
index 9e9add1..b8274e9 100644 (file)
@@ -80,7 +80,7 @@ Item {
         anchors.right: parent.right
         anchors.rightMargin: 20
         anchors.verticalCenter: parent.verticalCenter
         anchors.right: parent.right
         anchors.rightMargin: 20
         anchors.verticalCenter: parent.verticalCenter
-        iconId: overlay.recording ? "icon-m-camera-video-record" : "icon-m-camera-video-record"
+        iconId: overlay.recording ? cameraTheme.captureButtonRecordingIconId : cameraTheme.captureButtonVideoIconId
         width: 75
         height: 75
         opacity: 0.5
         width: 75
         height: 75
         opacity: 0.5
@@ -162,7 +162,7 @@ Item {
             Indicator {
                 id: gpsIndicator
                 visible: settings.useGps
             Indicator {
                 id: gpsIndicator
                 visible: settings.useGps
-                source: "image://theme/icon-m-camera-location"
+                source: cameraTheme.gpsIndicatorIcon
 
                 PropertyAnimation on opacity  {
                     easing.type: Easing.OutSine
 
                 PropertyAnimation on opacity  {
                     easing.type: Easing.OutSine
index 9b6ec4f..5e80ffa 100644 (file)
@@ -105,7 +105,7 @@ Item {
 
         items: [
             CameraToolIcon {
 
         items: [
             CameraToolIcon {
-                iconId: "icon-m-toolbar-mediacontrol-stop-white"
+                iconId: cameraTheme.videoStopIconId
                 onClicked: video.stop()
             },
             CameraSlider {
                 onClicked: video.stop()
             },
             CameraSlider {
@@ -131,8 +131,7 @@ Item {
             },
             CameraToolIcon {
                 id: control
             },
             CameraToolIcon {
                 id: control
-                iconId: !video.paused ? "icon-m-toolbar-mediacontrol-pause-white"
-                    : "icon-m-toolbar-mediacontrol-play-white"
+                iconId: !video.paused ? cameraTheme.videoPauseIconId : cameraTheme.videoPlayIconId
                 onClicked: {
                     video.toggle()
                     hideTimer.restart()
                 onClicked: {
                     video.toggle()
                     hideTimer.restart()
index 1f91966..1392bad 100644 (file)
@@ -27,7 +27,7 @@ CameraToolIcon {
     id: button
     property Camera camera: null
 
     id: button
     property Camera camera: null
 
-    iconId: settings.videoTorchOn ? "icon-m-camera-torch-on" : "icon-m-camera-torch-off"
+    iconId: settings.videoTorchOn ? cameraTheme.cameraTorchOnIconId : cameraTheme.cameraTorchOffIconId
     onClicked: settings.videoTorchOn = !settings.videoTorchOn
 
     Binding {
     onClicked: settings.videoTorchOn = !settings.videoTorchOn
 
     Binding {
diff --git a/qml/harmattan/CameraTheme.qml b/qml/harmattan/CameraTheme.qml
new file mode 100644 (file)
index 0000000..3ab34d2
--- /dev/null
@@ -0,0 +1,74 @@
+// -*- qml -*-
+
+/*!
+ * This file is part of CameraPlus.
+ *
+ * Copyright (C) 2012-2013 Mohammed Sameer <msameer@foolab.org>
+ *
+ * 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 1.1
+
+QtObject {
+    property string standbyIcon: "image://theme/icon-l-camera-standby"
+
+    property string gpsIndicatorIcon: "image://theme/icon-m-camera-location"
+    property string faceDetectionIndicatorIcon: "image://theme/icon-m-camera-face-detection-screen"
+
+    property string recordingDurationIcon: "image://theme/icon-m-camera-ongoing-recording"
+    property string cameraTorchOnIconId: "icon-m-camera-torch-on"
+    property string cameraTorchOffIconId: "icon-m-camera-torch-off"
+    property string soundMuteOnIconId: "icon-m-toolbar-volume-off-white-selected"
+    property string soundMuteOffIconId: "icon-m-toolbar-volume-white-selected"
+    property string videoStopIconId: "icon-m-toolbar-mediacontrol-stop-white"
+    property string videoPauseIconId: "icon-m-toolbar-mediacontrol-pause-white"
+    property string videoPlayIconId: "icon-m-toolbar-mediacontrol-play-white"
+    property string cameraManualExposureIconId: "icon-m-camera-manual-exposure"
+    property string cameraVideoIconId: "icon-m-camera-video"
+    property string cameraImageIconId: "icon-m-viewfinder-camera"
+    property string captureButtonImageIconId: "icon-m-camera-shutter"
+    property string captureButtonVideoIconId: "icon-m-camera-video-record"
+    property string captureButtonRecordingIconId: "icon-m-camera-video-record"
+    property string cameraToolBarMenuIcon: "icon-m-toolbar-back-white"
+    property string deleteEnabledIconId: "icon-m-toolbar-delete-white"
+    property string deleteDisabledIconId: "icon-m-toolbar-delete-dimmed-white"
+    property string shareEnabledIconId: "icon-m-toolbar-share-white"
+    property string shareDisabledIconId: "icon-m-toolbar-share-dimmed-white"
+    property string favoriteDisabledIconId: "icon-m-toolbar-favorite-mark-dimmed-white"
+    property string favoriteMarkIconId: "icon-m-toolbar-favorite-mark-white"
+    property string favoriteUnmarkIconId: "icon-m-toolbar-favorite-unmark-white"
+    property string menuIconId: "icon-m-toolbar-view-menu-white"
+
+/*
+
+    property string 
+    property string 
+    property string 
+    property string 
+    property string 
+    property string 
+    property string 
+    property string 
+    property string 
+    property string 
+    property string 
+    property string 
+    property string 
+    property string 
+    property string 
+    property string 
+*/
+}
\ No newline at end of file
index acfe87f..c5c2b34 100644 (file)
@@ -17,5 +17,6 @@
        <file>FullScreenThumbnail.qml</file>
        <file>CameraPositionSource.qml</file>
        <file>CameraPage.qml</file>
        <file>FullScreenThumbnail.qml</file>
        <file>CameraPositionSource.qml</file>
        <file>CameraPage.qml</file>
+       <file>CameraTheme.qml</file>
     </qresource>
 </RCC>
     </qresource>
 </RCC>