Unverified Commit 7ca4bd3a authored by Jonah Brüchert's avatar Jonah Brüchert 🌳

A few more drawer fixes

only list parsing into Kirigami Actions missing now
parent 577d572b
...@@ -139,10 +139,11 @@ Kirigami.Page { ...@@ -139,10 +139,11 @@ Kirigami.Page {
Camera { Camera {
id: camera id: camera
captureMode: Camera.CaptureStillImage captureMode: Camera.CaptureStillImage
imageProcessing.whiteBalanceMode: CameraImageProcessing.WhiteBalanceFlash imageProcessing.whiteBalanceMode: settings.whiteBalanceMode
imageCapture { imageCapture {
id: imageCapture id: imageCapture
resolution: settings.photoResolution
} }
videoRecorder { videoRecorder {
......
...@@ -59,7 +59,8 @@ Kirigami.GlobalDrawer { ...@@ -59,7 +59,8 @@ Kirigami.GlobalDrawer {
text: qsTr("Video resolution") text: qsTr("Video resolution")
iconName: "ratiocrop" iconName: "ratiocrop"
DelegateModel { DelegateModel {
model: applicationWindow().cameraPage.camera.videoRecorder.supportedResolutions model: CameraRecorder.supportedResolutions
delegate: Kirigami.Action { delegate: Kirigami.Action {
text: model text: model
onTriggered: settings.videoResolution = text; onTriggered: settings.videoResolution = text;
...@@ -70,7 +71,7 @@ Kirigami.GlobalDrawer { ...@@ -70,7 +71,7 @@ Kirigami.GlobalDrawer {
text: qsTr("Photo resolution") text: qsTr("Photo resolution")
iconName: "ratiocrop" iconName: "ratiocrop"
DelegateModel { DelegateModel {
model: applicationWindow().cameraPage.camera.imageCapture.supportedResolutions model: CameraCapture.supportedResolutions
delegate: Kirigami.Action { delegate: Kirigami.Action {
text: model text: model
onTriggered: settings.photoResolution = text; onTriggered: settings.photoResolution = text;
...@@ -80,42 +81,31 @@ Kirigami.GlobalDrawer { ...@@ -80,42 +81,31 @@ Kirigami.GlobalDrawer {
Kirigami.Action { Kirigami.Action {
text: qsTr("White balance") text: qsTr("White balance")
iconName: "whitebalance" iconName: "whitebalance"
DelegateModel { Kirigami.Action {
model: ListModel { iconName: "images/camera_auto_mode.png"
ListElement { onTriggered: settings.whiteBalanceMode = CameraImageProcessing.WhiteBalanceAuto
icon: "images/camera_auto_mode.png"
value: CameraImageProcessing.WhiteBalanceAuto
text: "Auto" text: "Auto"
} }
ListElement { Kirigami.Action {
icon: "images/camera_white_balance_sunny.png" iconName: "images/camera_white_balance_sunny.png"
value: CameraImageProcessing.WhiteBalanceSunlight onTriggered: settings.whiteBalanceMode = CameraImageProcessing.WhiteBalanceSunlight
text: "Sunlight" text: "Sunlight"
} }
ListElement { Kirigami.Action {
icon: "images/camera_white_balance_cloudy.png" iconName: "images/camera_white_balance_cloudy.png"
value: CameraImageProcessing.WhiteBalanceCloudy onTriggered: settings.whiteBalanceMode = CameraImageProcessing.WhiteBalanceCloudy
text: "Cloudy" text: "Cloudy"
} }
ListElement { Kirigami.Action {
icon: "images/camera_white_balance_incandescent.png" iconName: "images/camera_white_balance_incandescent.png"
value: CameraImageProcessing.WhiteBalanceTungsten onTriggered: settings.whiteBalanceMode = CameraImageProcessing.WhiteBalanceTungsten
text: "Tungsten" text: "Tungsten"
} }
ListElement { Kirigami.Action {
icon: "images/camera_white_balance_flourescent.png" iconName: "images/camera_white_balance_flourescent.png"
value: CameraImageProcessing.WhiteBalanceFluorescent onTriggered: settings.whiteBalanceMode = CameraImageProcessing.WhiteBalanceFluorescent
text: "Fluorescent" text: "Fluorescent"
} }
} }
delegate: Kirigami.Action {
text: model.text
iconName: model.icon
onTriggered: {
applicationWindow().cameraPage.camera.imageProcessing.whiteBalanceMode = value
}
}
}
}
] ]
} }
...@@ -40,15 +40,17 @@ ...@@ -40,15 +40,17 @@
import QtQuick 2.7 import QtQuick 2.7
import org.kde.kirigami 2.2 as Kirigami import org.kde.kirigami 2.2 as Kirigami
import Qt.labs.settings 1.0 import Qt.labs.settings 1.0
import QtMultimedia 5.8
Kirigami.ApplicationWindow { Kirigami.ApplicationWindow {
Settings { Settings {
id: settings id: settings
// Default settings // Default settings
property string videoResolution: "640x480" property size videoResolution: Qt.size(640, 480)
property string photoResolution property size photoResolution
property string cameraDeviceId property int cameraDeviceId
property int whiteBalanceMode: CameraImageProcessing.WhiteBalanceAuto
} }
Component {id: cameraPage; CameraPage {}} Component {id: cameraPage; CameraPage {}}
...@@ -57,6 +59,5 @@ Kirigami.ApplicationWindow { ...@@ -57,6 +59,5 @@ Kirigami.ApplicationWindow {
title: qsTr("Camera") title: qsTr("Camera")
globalDrawer: GlobalDrawer {} globalDrawer: GlobalDrawer {}
Component.onCompleted: pageStack.push(cameraPage) pageStack.initialPage: cameraPage
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment