From 9299fa292ded077de6e80532f3cfc79c523d7d8f Mon Sep 17 00:00:00 2001 From: Mohammed Sameer Date: Tue, 23 Jul 2013 00:45:40 +0300 Subject: [PATCH] Kill com.nokia.meego importing in the ui. We have a set of components underneath qml/harmattan implementing harmattan specific functionality. The rest should be more or less generic. --- qml/CameraSettings.qml | 5 ++-- qml/CameraToolBar.qml | 3 +- qml/CaptureButton.qml | 5 ++-- qml/CheckButton.qml | 3 +- qml/FlashButton.qml | 5 ++-- qml/ImageColorFilterButton.qml | 5 ++-- qml/ImageEvCompButton.qml | 9 +++--- qml/ImageIsoButton.qml | 15 +++++----- qml/ImageOverlay.qml | 1 - qml/ImageResolutionSettings.qml | 9 +++--- qml/ImageSceneButton.qml | 5 ++-- qml/ImageSettings.qml | 3 +- qml/ImageWhiteBalanceButton.qml | 5 ++-- qml/PostCaptureItem.qml | 6 ++-- qml/PostCaptureView.qml | 35 +++++++++++------------ qml/PreviewImage.qml | 1 - qml/RecordingDurationLabel.qml | 3 +- qml/SectionHeader.qml | 3 +- qml/Standby.qml | 3 +- qml/TextSwitch.qml | 10 ++----- qml/VideoColorFilterButton.qml | 5 ++-- qml/VideoEvCompButton.qml | 9 +++--- qml/VideoMuteButton.qml | 3 +- qml/VideoOverlay.qml | 1 - qml/VideoPlayerPage.qml | 13 ++++----- qml/VideoResolutionSettings.qml | 5 ++-- qml/VideoSceneButton.qml | 5 ++-- qml/VideoSettings.qml | 3 +- qml/VideoTorchButton.qml | 3 +- qml/VideoWhiteBalanceButton.qml | 5 ++-- qml/ZoomCaptureButton.qml | 1 - qml/ZoomCaptureCancel.qml | 3 +- qml/ZoomSlider.qml | 9 ++---- qml/harmattan/CameraButton.qml | 28 ++++++++++++++++++ qml/harmattan/CameraButtonRow.qml | 28 ++++++++++++++++++ qml/harmattan/CameraButtonStyle.qml | 27 ++++++++++++++++++ qml/harmattan/CameraInfoBanner.qml | 27 ++++++++++++++++++ qml/harmattan/CameraLabel.qml | 28 ++++++++++++++++++ qml/harmattan/CameraMenu.qml | 44 +++++++++++++++++++++++++++++ qml/harmattan/CameraMenuAction.qml | 30 ++++++++++++++++++++ qml/harmattan/CameraQueryDialog.qml | 29 +++++++++++++++++++ qml/harmattan/CameraSlider.qml | 35 +++++++++++++++++++++++ qml/harmattan/CameraSwitch.qml | 28 ++++++++++++++++++ qml/harmattan/CameraTextField.qml | 28 ++++++++++++++++++ qml/harmattan/CameraToolIcon.qml | 28 ++++++++++++++++++ qml/harmattan/CameraWindow.qml | 31 ++++++++++++++++++++ qml/harmattan/harmattan.qrc | 18 ++++++++++++ qml/main.qml | 18 ++---------- src/src.pro | 6 ++++ 49 files changed, 495 insertions(+), 137 deletions(-) create mode 100644 qml/harmattan/CameraButton.qml create mode 100644 qml/harmattan/CameraButtonRow.qml create mode 100644 qml/harmattan/CameraButtonStyle.qml create mode 100644 qml/harmattan/CameraInfoBanner.qml create mode 100644 qml/harmattan/CameraLabel.qml create mode 100644 qml/harmattan/CameraMenu.qml create mode 100644 qml/harmattan/CameraMenuAction.qml create mode 100644 qml/harmattan/CameraQueryDialog.qml create mode 100644 qml/harmattan/CameraSlider.qml create mode 100644 qml/harmattan/CameraSwitch.qml create mode 100644 qml/harmattan/CameraTextField.qml create mode 100644 qml/harmattan/CameraToolIcon.qml create mode 100644 qml/harmattan/CameraWindow.qml create mode 100644 qml/harmattan/harmattan.qrc diff --git a/qml/CameraSettings.qml b/qml/CameraSettings.qml index 9a67ba1..062044c 100644 --- a/qml/CameraSettings.qml +++ b/qml/CameraSettings.qml @@ -21,14 +21,13 @@ */ @IMPORT_QT_QUICK@ -import com.nokia.meego 1.1 Column { id: col spacing: 10 width: parent.width - Label { + CameraLabel { font.pixelSize: 36 text: qsTr("Camera settings") width: parent.width @@ -49,7 +48,7 @@ Column { width: parent.width } - TextField { + CameraTextField { placeholderText: qsTr("Name or copyright") width: parent.width text: settings.creatorName diff --git a/qml/CameraToolBar.qml b/qml/CameraToolBar.qml index c0e5366..f75a789 100644 --- a/qml/CameraToolBar.qml +++ b/qml/CameraToolBar.qml @@ -21,7 +21,6 @@ */ @IMPORT_QT_QUICK@ -import com.nokia.meego 1.1 import "CameraToolBar.js" as Layout Rectangle { @@ -44,7 +43,7 @@ Rectangle { PropertyAnimation { duration: 100 } } - ToolIcon { + CameraToolIcon { property bool __isMenu: true visible: !parent.hideBack id: menu diff --git a/qml/CaptureButton.qml b/qml/CaptureButton.qml index 6dc99a3..9f0dde5 100644 --- a/qml/CaptureButton.qml +++ b/qml/CaptureButton.qml @@ -21,13 +21,12 @@ */ @IMPORT_QT_QUICK@ -import com.nokia.meego 1.1 Item { id: button property url iconSource - property Style platformStyle: ButtonStyle {} + property CameraButtonStyle platformStyle: CameraButtonStyle {} property alias pressed: mouse.pressed property alias mouseX: mouse.mouseX @@ -61,4 +60,4 @@ Item { source: button.iconSource visible: source != "" } -} \ No newline at end of file +} diff --git a/qml/CheckButton.qml b/qml/CheckButton.qml index 8aa8eb0..f00fff8 100644 --- a/qml/CheckButton.qml +++ b/qml/CheckButton.qml @@ -21,9 +21,8 @@ */ @IMPORT_QT_QUICK@ -import com.nokia.meego 1.1 -ToolIcon { +CameraToolIcon { id: button property string normalIcon: "" property string checkedIcon: "" diff --git a/qml/FlashButton.qml b/qml/FlashButton.qml index bf6cc51..b6ae252 100644 --- a/qml/FlashButton.qml +++ b/qml/FlashButton.qml @@ -21,17 +21,16 @@ */ @IMPORT_QT_QUICK@ -import com.nokia.meego 1.1 import QtCamera 1.0 import "data.js" as Data -ToolIcon { +CameraToolIcon { id: button iconSource: "image://theme/" + Data.flashIcon(settings.imageFlashMode) property list items: [ - Label { + CameraLabel { height: parent ? parent.height : 0 text: qsTr("Flash") verticalAlignment: Text.AlignVCenter diff --git a/qml/ImageColorFilterButton.qml b/qml/ImageColorFilterButton.qml index c28a54e..2b9eb5a 100644 --- a/qml/ImageColorFilterButton.qml +++ b/qml/ImageColorFilterButton.qml @@ -21,16 +21,15 @@ */ @IMPORT_QT_QUICK@ -import com.nokia.meego 1.1 import QtCamera 1.0 import "data.js" as Data -ToolIcon { +CameraToolIcon { id: button iconSource: "image://theme/" + Data.cfIcon(settings.imageColorFilter) property list items: [ - Label { + CameraLabel { height: parent ? parent.height : 0 text: qsTr("Filter") verticalAlignment: Text.AlignVCenter diff --git a/qml/ImageEvCompButton.qml b/qml/ImageEvCompButton.qml index 0a12cf7..02b0f0d 100644 --- a/qml/ImageEvCompButton.qml +++ b/qml/ImageEvCompButton.qml @@ -21,15 +21,14 @@ */ @IMPORT_QT_QUICK@ -import com.nokia.meego 1.1 import QtCamera 1.0 -ToolIcon { +CameraToolIcon { id: button iconSource: settings.imageEvComp == 0 ? "image://theme/icon-m-camera-manual-exposure" : "" - Label { + CameraLabel { anchors.fill: parent verticalAlignment: Text.AlignVCenter visible: settings.imageEvComp != 0 @@ -37,12 +36,12 @@ ToolIcon { } property list items: [ - Label { + CameraLabel { height: parent ? parent.height : 0 text: qsTr("EV") verticalAlignment: Text.AlignVCenter }, - Slider { + CameraSlider { id: slider width: 500 orientation: Qt.Horizontal diff --git a/qml/ImageIsoButton.qml b/qml/ImageIsoButton.qml index 7cccff7..a4d5f2f 100644 --- a/qml/ImageIsoButton.qml +++ b/qml/ImageIsoButton.qml @@ -21,22 +21,21 @@ */ @IMPORT_QT_QUICK@ -import com.nokia.meego 1.1 import QtCamera 1.0 import "data.js" as Data -ToolIcon { +CameraToolIcon { id: button iconSource: "image://theme/" + Data.isoIcon(settings.imageIso) property list items: [ - Label { + CameraLabel { height: parent ? parent.height : 0 text: qsTr("ISO") verticalAlignment: Text.AlignVCenter }, - Button { + CameraButton { property int value: 0 onClicked: settings.imageIso = value text: qsTr("Auto") @@ -44,7 +43,7 @@ ToolIcon { checked: settings.imageIso == value anchors.verticalCenter: parent ? parent.verticalCenter : undefined }, - Button { + CameraButton { property int value: 100 onClicked: settings.imageIso = value text: value @@ -52,7 +51,7 @@ ToolIcon { checked: settings.imageIso == value anchors.verticalCenter: parent ? parent.verticalCenter : undefined }, - Button { + CameraButton { property int value: 200 onClicked: settings.imageIso = value text: value @@ -60,7 +59,7 @@ ToolIcon { checked: settings.imageIso == value anchors.verticalCenter: parent ? parent.verticalCenter : undefined }, - Button { + CameraButton { property int value: 400 onClicked: settings.imageIso = value text: value @@ -68,7 +67,7 @@ ToolIcon { checked: settings.imageIso == value anchors.verticalCenter: parent ? parent.verticalCenter : undefined }, - Button { + CameraButton { property int value: 800 onClicked: settings.imageIso = value text: value diff --git a/qml/ImageOverlay.qml b/qml/ImageOverlay.qml index 9875ab4..7589e53 100644 --- a/qml/ImageOverlay.qml +++ b/qml/ImageOverlay.qml @@ -21,7 +21,6 @@ */ @IMPORT_QT_QUICK@ -import com.nokia.meego 1.1 import QtCamera 1.0 import CameraPlus 1.0 import "data.js" as Data diff --git a/qml/ImageResolutionSettings.qml b/qml/ImageResolutionSettings.qml index 3c78458..17ad2cf 100644 --- a/qml/ImageResolutionSettings.qml +++ b/qml/ImageResolutionSettings.qml @@ -21,7 +21,6 @@ */ @IMPORT_QT_QUICK@ -import com.nokia.meego 1.1 Column { spacing: 10 @@ -30,7 +29,7 @@ Column { text: qsTr("Aspect ratio") } - ButtonRow { + CameraButtonRow { id: aspectRatioRow width: parent.width enabled: cam.idle @@ -38,7 +37,7 @@ Column { Repeater { model: imageSettings.aspectRatios - delegate: Button { + delegate: CameraButton { text: qsTr(modelData) checked: settings.imageAspectRatio == modelData onClicked: settings.imageAspectRatio = modelData @@ -50,7 +49,7 @@ Column { text: qsTr("Resolution") } - ButtonRow { + CameraButtonRow { id: resolutionsRow width: parent.width enabled: cam.idle @@ -67,7 +66,7 @@ Column { model: imageSettings.resolutions.aspectRatio == settings.imageAspectRatio ? imageSettings.resolutions : undefined - delegate: Button { + delegate: CameraButton { font.capitalization: Font.Capitalize text: qsTr("%1 %2 Mpx").arg(resolutionName).arg(megaPixels) checked: settings.imageResolution == resolutionName diff --git a/qml/ImageSceneButton.qml b/qml/ImageSceneButton.qml index 226be62..5750f58 100644 --- a/qml/ImageSceneButton.qml +++ b/qml/ImageSceneButton.qml @@ -21,17 +21,16 @@ */ @IMPORT_QT_QUICK@ -import com.nokia.meego 1.1 import QtCamera 1.0 import "data.js" as Data -ToolIcon { +CameraToolIcon { id: button iconSource: "image://theme/" + Data.ismIcon(settings.imageSceneMode) property list items: [ - Label { + CameraLabel { height: parent ? parent.height : 0 text: qsTr("Scene") verticalAlignment: Text.AlignVCenter diff --git a/qml/ImageSettings.qml b/qml/ImageSettings.qml index 220f226..a5b07fb 100644 --- a/qml/ImageSettings.qml +++ b/qml/ImageSettings.qml @@ -21,7 +21,6 @@ */ @IMPORT_QT_QUICK@ -import com.nokia.meego 1.1 import QtCamera 1.0 Flickable { @@ -34,7 +33,7 @@ Flickable { width: parent.width spacing: 10 - Label { + CameraLabel { font.pixelSize: 36 text: qsTr("Image settings") } diff --git a/qml/ImageWhiteBalanceButton.qml b/qml/ImageWhiteBalanceButton.qml index 55290e9..2cbf7c5 100644 --- a/qml/ImageWhiteBalanceButton.qml +++ b/qml/ImageWhiteBalanceButton.qml @@ -21,17 +21,16 @@ */ @IMPORT_QT_QUICK@ -import com.nokia.meego 1.1 import QtCamera 1.0 import "data.js" as Data -ToolIcon { +CameraToolIcon { id: button iconSource: "image://theme/" + Data.wbIcon(settings.imageWhiteBalance) property list items: [ - Label { + CameraLabel { height: parent ? parent.height : 0 text: qsTr("WB") verticalAlignment: Text.AlignVCenter diff --git a/qml/PostCaptureItem.qml b/qml/PostCaptureItem.qml index f9c4a85..b2911fe 100644 --- a/qml/PostCaptureItem.qml +++ b/qml/PostCaptureItem.qml @@ -21,7 +21,6 @@ */ @IMPORT_QT_QUICK@ -import com.nokia.meego 1.1 import CameraPlus 1.0 Item { @@ -57,6 +56,7 @@ Item { onFinished: loader.source = "" } +// TODO: rotation QuillItem { id: image width: parent.width - 10 @@ -65,7 +65,7 @@ Item { Component.onCompleted: initialize(itemData.url, itemData.mimetype) visible: loader.source == "" - Label { + CameraLabel { anchors.fill: parent visible: image.error text: qsTr("Failed to load preview") @@ -81,7 +81,7 @@ Item { onClicked: postCaptureItem.clicked() } - ToolIcon { + CameraToolIcon { // TODO: this is overlapping with error. id: playIcon anchors.centerIn: parent diff --git a/qml/PostCaptureView.qml b/qml/PostCaptureView.qml index a1c0e06..ea5b700 100644 --- a/qml/PostCaptureView.qml +++ b/qml/PostCaptureView.qml @@ -22,7 +22,6 @@ @IMPORT_QT_QUICK@ import CameraPlus 1.0 -import com.nokia.meego 1.1 import QtCamera 1.0 Item { @@ -108,10 +107,8 @@ Item { anchors.leftMargin: 20 opacity: 0.8 - property bool show: deleteDialog.status == DialogStatus.Open || - deleteDialog.status == DialogStatus.Opening || - hideTimer.running || menu.status == DialogStatus.Open || - menu.status == DialogStatus.Opening || + property bool show: deleteDialog.isOpen || deleteDialog.isOpening || + hideTimer.running || menu.isOpen || menu.isOpening || (view.currentItem && view.currentItem.error) && !view.currentItem.playing Behavior on anchors.bottomMargin { @@ -119,28 +116,28 @@ Item { } items: [ - ToolIcon { + 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" onClicked: { addOrRemoveFavorite() restartTimer() } }, - ToolIcon { + CameraToolIcon { iconId: available ? "icon-m-toolbar-share-white" : "icon-m-toolbar-share-dimmed-white" onClicked: { shareCurrentItem() restartTimer() } }, - ToolIcon { + CameraToolIcon { iconId: available ? "icon-m-toolbar-delete-white" : "icon-m-toolbar-delete-dimmed-white" onClicked: { deleteCurrentItem() restartTimer() } }, - ToolIcon { + CameraToolIcon { iconId: "icon-m-toolbar-view-menu-white" onClicked: { menu.open() @@ -150,7 +147,7 @@ Item { ] } - QueryDialog { + CameraQueryDialog { id: deleteDialog titleText: qsTr("Delete item?"); acceptButtonText: qsTr("Yes"); @@ -171,22 +168,22 @@ Item { } } - Menu { + CameraMenu { id: menu onStatusChanged: restartTimer() - MenuLayout { - MenuItem { + actions: [ + CameraMenuAction { text: qsTr("Captures in gallery") onClicked: launchGallery() - } - - MenuItem { + }, + CameraMenuAction { + // TODO: this is not working... text: qsTr("View in gallery") enabled: available onClicked: showInGallery() } - } + ] } Rectangle { @@ -212,7 +209,7 @@ Item { x: 20 height: parent.height - Label { + CameraLabel { text: view.currentItem ? view.currentItem.itemData.title : "" width: parent.width / 2 height: parent.height @@ -221,7 +218,7 @@ Item { horizontalAlignment: Text.AlignLeft } - Label { + CameraLabel { text: view.currentItem ? view.currentItem.itemData.created : "" width: parent.width / 2 height: parent.height diff --git a/qml/PreviewImage.qml b/qml/PreviewImage.qml index 52a32f3..4850bd2 100644 --- a/qml/PreviewImage.qml +++ b/qml/PreviewImage.qml @@ -21,7 +21,6 @@ */ @IMPORT_QT_QUICK@ -import com.nokia.meego 1.1 import QtCamera 1.0 Image { diff --git a/qml/RecordingDurationLabel.qml b/qml/RecordingDurationLabel.qml index 8ab644c..4bd5cb7 100644 --- a/qml/RecordingDurationLabel.qml +++ b/qml/RecordingDurationLabel.qml @@ -21,7 +21,6 @@ */ @IMPORT_QT_QUICK@ -import com.nokia.meego 1.1 Rectangle { property int duration @@ -48,7 +47,7 @@ Rectangle { sourceSize.height: 20 } - Label { + CameraLabel { function formatDuration(dur) { var secs = parseInt(recordingDuration.duration) var minutes = Math.floor(secs / 60) diff --git a/qml/SectionHeader.qml b/qml/SectionHeader.qml index 51f6ee3..0fc9e47 100644 --- a/qml/SectionHeader.qml +++ b/qml/SectionHeader.qml @@ -21,7 +21,6 @@ */ @IMPORT_QT_QUICK@ -import com.nokia.meego 1.1 Row { id: root @@ -34,7 +33,7 @@ Row { property alias text: label.text - Label { + CameraLabel { id: label verticalAlignment: Text.AlignVCenter } diff --git a/qml/Standby.qml b/qml/Standby.qml index 471a099..845b489 100644 --- a/qml/Standby.qml +++ b/qml/Standby.qml @@ -21,7 +21,6 @@ */ @IMPORT_QT_QUICK@ -import com.nokia.meego 1.0 Rectangle { id: standby @@ -51,7 +50,7 @@ Rectangle { anchors.centerIn: parent } - Label { + CameraLabel { anchors.top: icon.bottom anchors.right: parent.right anchors.left: parent.left diff --git a/qml/TextSwitch.qml b/qml/TextSwitch.qml index 74e042b..c19665d 100644 --- a/qml/TextSwitch.qml +++ b/qml/TextSwitch.qml @@ -21,7 +21,6 @@ */ @IMPORT_QT_QUICK@ -import com.nokia.meego 1.1 Item { property alias text: label.text @@ -29,18 +28,13 @@ Item { width: parent.width height: switchComponent.height - Text { - property Style platformStyle: LabelStyle {} - + CameraLabel { id: label anchors.left: parent.left - font.family: platformStyle.fontFamily - font.pixelSize: platformStyle.fontPixelSize - color: platformStyle.textColor wrapMode: Text.Wrap } - Switch { + CameraSwitch { id: switchComponent anchors.right: parent.right } diff --git a/qml/VideoColorFilterButton.qml b/qml/VideoColorFilterButton.qml index cf864d6..46a5bb4 100644 --- a/qml/VideoColorFilterButton.qml +++ b/qml/VideoColorFilterButton.qml @@ -21,17 +21,16 @@ */ @IMPORT_QT_QUICK@ -import com.nokia.meego 1.1 import QtCamera 1.0 import "data.js" as Data -ToolIcon { +CameraToolIcon { id: button iconSource: "image://theme/" + Data.cfIcon(settings.videoColorFilter) property list items: [ - Label { + CameraLabel { height: parent ? parent.height : 0 text: qsTr("Filter") verticalAlignment: Text.AlignVCenter diff --git a/qml/VideoEvCompButton.qml b/qml/VideoEvCompButton.qml index b012c17..6721b4d 100644 --- a/qml/VideoEvCompButton.qml +++ b/qml/VideoEvCompButton.qml @@ -21,15 +21,14 @@ */ @IMPORT_QT_QUICK@ -import com.nokia.meego 1.1 import QtCamera 1.0 -ToolIcon { +CameraToolIcon { id: button iconSource: settings.videoEvComp == 0 ? "image://theme/icon-m-camera-manual-exposure" : "" - Label { + CameraLabel { anchors.fill: parent verticalAlignment: Text.AlignVCenter visible: settings.videoEvComp != 0 @@ -37,12 +36,12 @@ ToolIcon { } property list items: [ - Label { + CameraLabel { height: parent ? parent.height : 0 text: qsTr("EV") verticalAlignment: Text.AlignVCenter }, - Slider { + CameraSlider { id: slider width: 500 orientation: Qt.Horizontal diff --git a/qml/VideoMuteButton.qml b/qml/VideoMuteButton.qml index ada6812..a5728ce 100644 --- a/qml/VideoMuteButton.qml +++ b/qml/VideoMuteButton.qml @@ -21,9 +21,8 @@ */ @IMPORT_QT_QUICK@ -import com.nokia.meego 1.1 -ToolIcon { +CameraToolIcon { iconSource: settings.videoMuted ? "image://theme/icon-m-toolbar-volume-off-white-selected" : "image://theme/icon-m-toolbar-volume-white-selected" onClicked: settings.videoMuted = !settings.videoMuted diff --git a/qml/VideoOverlay.qml b/qml/VideoOverlay.qml index 735833d..07e55f8 100644 --- a/qml/VideoOverlay.qml +++ b/qml/VideoOverlay.qml @@ -21,7 +21,6 @@ */ @IMPORT_QT_QUICK@ -import com.nokia.meego 1.1 import QtCamera 1.0 import CameraPlus 1.0 import "data.js" as Data diff --git a/qml/VideoPlayerPage.qml b/qml/VideoPlayerPage.qml index dbe7274..2b700c0 100644 --- a/qml/VideoPlayerPage.qml +++ b/qml/VideoPlayerPage.qml @@ -21,7 +21,6 @@ */ @IMPORT_QT_QUICK@ -import com.nokia.meego 1.1 import CameraPlus 1.0 import QtCamera 1.0 import QtCameraExtras 1.0 @@ -105,19 +104,17 @@ Item { } items: [ - ToolIcon { + CameraToolIcon { iconId: "icon-m-toolbar-mediacontrol-stop-white" onClicked: video.stop() }, - Slider { + CameraSlider { id: slider height: toolBar.height anchors.verticalCenter: parent.verticalCenter - platformStyle: SliderStyle { - handleBackground: "" - handleBackgroundPressed: "" - } + handleBackground: "" + handleBackgroundPressed: "" minimumValue: 0 maximumValue: video.duration @@ -132,7 +129,7 @@ Item { hideTimer.restart() } }, - ToolIcon { + CameraToolIcon { id: control iconId: !video.paused ? "icon-m-toolbar-mediacontrol-pause-white" : "icon-m-toolbar-mediacontrol-play-white" diff --git a/qml/VideoResolutionSettings.qml b/qml/VideoResolutionSettings.qml index 718ee7d..9be1a10 100644 --- a/qml/VideoResolutionSettings.qml +++ b/qml/VideoResolutionSettings.qml @@ -21,7 +21,6 @@ */ @IMPORT_QT_QUICK@ -import com.nokia.meego 1.1 Column { spacing: 10 @@ -30,7 +29,7 @@ Column { text: qsTr("Resolution") } - ButtonRow { + CameraButtonRow { width: parent.width enabled: cam.idle exclusive: false @@ -40,7 +39,7 @@ Column { model: videoSettings.resolutions - delegate: Button { + delegate: CameraButton { font.capitalization: Font.Capitalize text: qsTr("%1 %2").arg(resolutionName).arg(resolution) checked: settings.videoResolution == resolutionName diff --git a/qml/VideoSceneButton.qml b/qml/VideoSceneButton.qml index 96e6fd1..4d59a24 100644 --- a/qml/VideoSceneButton.qml +++ b/qml/VideoSceneButton.qml @@ -21,17 +21,16 @@ */ @IMPORT_QT_QUICK@ -import com.nokia.meego 1.1 import QtCamera 1.0 import "data.js" as Data -ToolIcon { +CameraToolIcon { id: button iconSource: "image://theme/" + Data.vsmIcon(settings.videoSceneMode) property list items: [ - Label { + CameraLabel { height: parent ? parent.height : 0 text: qsTr("Scene") verticalAlignment: Text.AlignVCenter diff --git a/qml/VideoSettings.qml b/qml/VideoSettings.qml index e0f90fd..7df57e0 100644 --- a/qml/VideoSettings.qml +++ b/qml/VideoSettings.qml @@ -21,7 +21,6 @@ */ @IMPORT_QT_QUICK@ -import com.nokia.meego 1.1 import QtCamera 1.0 Flickable { @@ -34,7 +33,7 @@ Flickable { width: parent.width spacing: 10 - Label { + CameraLabel { font.pixelSize: 36 text: qsTr("Video settings") } diff --git a/qml/VideoTorchButton.qml b/qml/VideoTorchButton.qml index e813ac6..05d8290 100644 --- a/qml/VideoTorchButton.qml +++ b/qml/VideoTorchButton.qml @@ -21,10 +21,9 @@ */ @IMPORT_QT_QUICK@ -import com.nokia.meego 1.1 import QtCamera 1.0 -ToolIcon { +CameraToolIcon { id: button property Camera camera: null diff --git a/qml/VideoWhiteBalanceButton.qml b/qml/VideoWhiteBalanceButton.qml index 353619b..d5e73d3 100644 --- a/qml/VideoWhiteBalanceButton.qml +++ b/qml/VideoWhiteBalanceButton.qml @@ -21,17 +21,16 @@ */ @IMPORT_QT_QUICK@ -import com.nokia.meego 1.1 import QtCamera 1.0 import "data.js" as Data -ToolIcon { +CameraToolIcon { id: button iconSource: "image://theme/" + Data.wbIcon(settings.videoWhiteBalance) property list items: [ - Label { + CameraLabel { height: parent ? parent.height : 0 text: qsTr("WB") verticalAlignment: Text.AlignVCenter diff --git a/qml/ZoomCaptureButton.qml b/qml/ZoomCaptureButton.qml index ed10da3..54ef205 100644 --- a/qml/ZoomCaptureButton.qml +++ b/qml/ZoomCaptureButton.qml @@ -21,7 +21,6 @@ */ @IMPORT_QT_QUICK@ -import com.nokia.meego 1.1 import CameraPlus 1.0 Item { diff --git a/qml/ZoomCaptureCancel.qml b/qml/ZoomCaptureCancel.qml index b85966a..25fc786 100644 --- a/qml/ZoomCaptureCancel.qml +++ b/qml/ZoomCaptureCancel.qml @@ -21,7 +21,6 @@ */ @IMPORT_QT_QUICK@ -import com.nokia.meego 1.1 import CameraPlus 1.0 MouseArea { @@ -54,7 +53,7 @@ MouseArea { PropertyAnimation { duration: 100; } } - Label { + CameraLabel { id: label anchors.verticalCenter: parent.verticalCenter width: parent.width diff --git a/qml/ZoomSlider.qml b/qml/ZoomSlider.qml index 13609f0..92fd688 100644 --- a/qml/ZoomSlider.qml +++ b/qml/ZoomSlider.qml @@ -21,17 +21,14 @@ */ @IMPORT_QT_QUICK@ -import com.nokia.meego 1.1 import QtCamera 1.0 -Slider { +CameraSlider { id: slider property Camera camera: null - platformStyle: SliderStyle { - handleBackground: "" - handleBackgroundPressed: "" - } + handleBackground: "" + handleBackgroundPressed: "" Binding { target: camera ? camera.zoom : null diff --git a/qml/harmattan/CameraButton.qml b/qml/harmattan/CameraButton.qml new file mode 100644 index 0000000..10d140f --- /dev/null +++ b/qml/harmattan/CameraButton.qml @@ -0,0 +1,28 @@ +// -*- qml -*- + +/*! + * 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 1.1 +import com.nokia.meego 1.1 + +Button { + +} diff --git a/qml/harmattan/CameraButtonRow.qml b/qml/harmattan/CameraButtonRow.qml new file mode 100644 index 0000000..dd48ca6 --- /dev/null +++ b/qml/harmattan/CameraButtonRow.qml @@ -0,0 +1,28 @@ +// -*- qml -*- + +/*! + * 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 1.1 +import com.nokia.meego 1.1 + +ButtonRow { + +} diff --git a/qml/harmattan/CameraButtonStyle.qml b/qml/harmattan/CameraButtonStyle.qml new file mode 100644 index 0000000..ce0d9e7 --- /dev/null +++ b/qml/harmattan/CameraButtonStyle.qml @@ -0,0 +1,27 @@ +// -*- qml -*- + +/*! + * 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 1.1 +import com.nokia.meego 1.1 + +ButtonStyle { +} diff --git a/qml/harmattan/CameraInfoBanner.qml b/qml/harmattan/CameraInfoBanner.qml new file mode 100644 index 0000000..bb16045 --- /dev/null +++ b/qml/harmattan/CameraInfoBanner.qml @@ -0,0 +1,27 @@ +// -*- qml -*- + +/*! + * 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 1.1 +import com.nokia.extras 1.1 + +InfoBanner { +} diff --git a/qml/harmattan/CameraLabel.qml b/qml/harmattan/CameraLabel.qml new file mode 100644 index 0000000..452ea74 --- /dev/null +++ b/qml/harmattan/CameraLabel.qml @@ -0,0 +1,28 @@ +// -*- qml -*- + +/*! + * 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 1.1 +import com.nokia.meego 1.1 + +Label { + +} diff --git a/qml/harmattan/CameraMenu.qml b/qml/harmattan/CameraMenu.qml new file mode 100644 index 0000000..ec8afd0 --- /dev/null +++ b/qml/harmattan/CameraMenu.qml @@ -0,0 +1,44 @@ +// -*- qml -*- + +/*! + * 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 1.1 +import com.nokia.meego 1.1 + +Menu { + id: menu + + property bool isOpen: status == DialogStatus.Open + property bool isOpening: status == DialogStatus.Opening + + property list actions + + MenuLayout { + Repeater { + model: menu.actions + delegate: MenuItem { + text: modelData.text + enabled: modelData.enabled + onClicked: modelData.clicked() + } + } + } +} diff --git a/qml/harmattan/CameraMenuAction.qml b/qml/harmattan/CameraMenuAction.qml new file mode 100644 index 0000000..a7d32ad --- /dev/null +++ b/qml/harmattan/CameraMenuAction.qml @@ -0,0 +1,30 @@ +// -*- qml -*- + +/*! + * 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 1.1 +import com.nokia.meego 1.1 + +QtObject { + property string text + property bool enabled: true + signal clicked +} diff --git a/qml/harmattan/CameraQueryDialog.qml b/qml/harmattan/CameraQueryDialog.qml new file mode 100644 index 0000000..b15eece --- /dev/null +++ b/qml/harmattan/CameraQueryDialog.qml @@ -0,0 +1,29 @@ +// -*- qml -*- + +/*! + * 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 1.1 +import com.nokia.meego 1.1 + +QueryDialog { + property bool isOpen: status == DialogStatus.Open + property bool isOpening: status == DialogStatus.Opening +} diff --git a/qml/harmattan/CameraSlider.qml b/qml/harmattan/CameraSlider.qml new file mode 100644 index 0000000..9b66b11 --- /dev/null +++ b/qml/harmattan/CameraSlider.qml @@ -0,0 +1,35 @@ +// -*- qml -*- + +/*! + * 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 1.1 +import com.nokia.meego 1.1 + +Slider { + property alias handleBackground: sliderStyle.handleBackground + property alias handleBackgroundPressed: sliderStyle.handleBackgroundPressed + + SliderStyle { + id: sliderStyle + } + + platformStyle: sliderStyle +} diff --git a/qml/harmattan/CameraSwitch.qml b/qml/harmattan/CameraSwitch.qml new file mode 100644 index 0000000..b11ab09 --- /dev/null +++ b/qml/harmattan/CameraSwitch.qml @@ -0,0 +1,28 @@ +// -*- qml -*- + +/*! + * 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 1.1 +import com.nokia.meego 1.1 + +Switch { + +} diff --git a/qml/harmattan/CameraTextField.qml b/qml/harmattan/CameraTextField.qml new file mode 100644 index 0000000..e8e6caf --- /dev/null +++ b/qml/harmattan/CameraTextField.qml @@ -0,0 +1,28 @@ +// -*- qml -*- + +/*! + * 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 1.1 +import com.nokia.meego 1.1 + +TextField { + +} diff --git a/qml/harmattan/CameraToolIcon.qml b/qml/harmattan/CameraToolIcon.qml new file mode 100644 index 0000000..1385924 --- /dev/null +++ b/qml/harmattan/CameraToolIcon.qml @@ -0,0 +1,28 @@ +// -*- qml -*- + +/*! + * 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 1.1 +import com.nokia.meego 1.1 + +ToolIcon { + +} diff --git a/qml/harmattan/CameraWindow.qml b/qml/harmattan/CameraWindow.qml new file mode 100644 index 0000000..b1e513d --- /dev/null +++ b/qml/harmattan/CameraWindow.qml @@ -0,0 +1,31 @@ +// -*- qml -*- + +/*! + * 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 1.1 +import com.nokia.meego 1.1 + +Window { + Component.onCompleted: { + screen.setAllowedOrientations(Screen.Landscape) + theme.inverted = true + } +} diff --git a/qml/harmattan/harmattan.qrc b/qml/harmattan/harmattan.qrc new file mode 100644 index 0000000..ad84166 --- /dev/null +++ b/qml/harmattan/harmattan.qrc @@ -0,0 +1,18 @@ + + + + CameraLabel.qml + CameraTextField.qml + CameraToolIcon.qml + CameraButton.qml + CameraSlider.qml + CameraSwitch.qml + CameraButtonRow.qml + CameraQueryDialog.qml + CameraWindow.qml + CameraInfoBanner.qml + CameraButtonStyle.qml + CameraMenu.qml + CameraMenuAction.qml + + diff --git a/qml/main.qml b/qml/main.qml index e3dce6c..efae4d4 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -21,15 +21,13 @@ */ @IMPORT_QT_QUICK@ -import com.nokia.meego 1.1 -import com.nokia.extras 1.1 import QtCamera 1.0 import CameraPlus 1.0 import QtMobility.location 1.2 // TODO: flash not ready (battery low or flash not ready message) -Window { +CameraWindow { id: root property alias camera: cam @@ -67,8 +65,6 @@ Window { } Component.onCompleted: { - screen.setAllowedOrientations(Screen.Landscape) - theme.inverted = true platformSettings.init() // TODO: hardcoding device id root.resetCamera(0, settings.mode) @@ -101,16 +97,6 @@ Window { property alias dimmer: camDimmer - PageStack { - id: pageStack - anchors.fill: parent - } - - MouseArea { - anchors.fill: parent - enabled: pageStack.busy - } - PositionSource { // NOTE: The source will not reset the position when we lose the signal. // This shouldn't be a big problem as we are course enough. @@ -169,7 +155,7 @@ Window { id: fileSystem } - InfoBanner { + CameraInfoBanner { id: error } diff --git a/src/src.pro b/src/src.pro index 036e8d8..e082679 100644 --- a/src/src.pro +++ b/src/src.pro @@ -31,5 +31,11 @@ contains(CONFIG, qmljsdebug) { include(../qmljsdebugger/qmljsdebugger-src.pri) } +contains(MEEGO_EDITION, "harmattan") { + message("Building for harmattan") + DEFINES += HARMATTAN + RESOURCES += ../qml/harmattan/harmattan.qrc +} + target.path = /usr/bin/ INSTALLS += target -- 2.25.1