Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- /usr/share/jolla-settings/pages/jolla-camera/SettingsPage.qml 2018-10-22 03:00:00.000000000 +0300
- +++ /usr/share/jolla-settings/pages/jolla-camera/SettingsPage.qml 2018-11-14 22:11:21.800789262 +0200
- @@ -6,6 +6,7 @@
- import org.nemomobile.systemsettings 1.0
- import com.jolla.settings.system 1.0
- import Sailfish.Policy 1.0
- +import com.jolla.gallery.ambience 1.0
- Page {
- onStatusChanged: {
- @@ -19,6 +20,18 @@
- path: "/apps/jolla-camera"
- + ConfigurationGroup {
- + id: customCameraOverlay
- +
- + path: "camera/overlay"
- +
- + property int customOverlay: 6
- + property int baselcolor: 0
- + property int defaultbasel: 0
- + property bool customicon: false
- + property bool timerscreen: false
- + }
- +
- ConfigurationGroup {
- id: primaryImageSettings
- @@ -217,6 +230,249 @@
- }
- }
- }
- +
- + SectionHeader {
- + //% "Camera setting overlay"
- + text: qsTr("Camera setting overlay")
- + }
- +
- + Slider {
- + id: slider
- + width: parent.width
- + maximumValue: 6
- + minimumValue: 0
- + stepSize: 1
- + value: customCameraOverlay.customOverlay
- + onValueChanged: customCameraOverlay.customOverlay = value
- +
- + onPressAndHold: cancel()
- +
- + Label {
- + id: valueLabel
- + //% "%1%"
- + text: {"0." + slider.value}
- +
- + x: slider.leftMargin - width/2
- + anchors.bottom: parent.verticalCenter // assuming slider centers its content vertically
- + anchors.bottomMargin: Theme.paddingSmall + Theme.paddingMedium
- + scale: slider.down ? Theme.fontSizeLarge / Theme.fontSizeMedium : 1.0
- + color: slider.highlighted ? Theme.highlightColor : Theme.primaryColor
- + Behavior on scale { NumberAnimation { duration: 80 } }
- + }
- + }
- +
- + Item {
- + width: parent.width
- + height: -Theme.paddingSmall*5
- + }
- +
- + Label {
- + width: parent.width
- + wrapMode: Text.WordWrap
- + horizontalAlignment: Text.AlignHCenter
- + color: slider.highlighted ? Theme.secondaryHighlightColor : Theme.secondaryColor
- + font.pixelSize: Theme.fontSizeSmall
- + text: "Choose preferred overlay"
- + }
- +
- + Item {
- + width: parent.width
- + height: Theme.paddingLarge
- + }
- +
- + TextSwitch {
- + width: parent.width
- + text: "Timer on viewfinder"
- + checked: customCameraOverlay.timerscreen
- + onClicked: customCameraOverlay.timerscreen = checked
- + }
- +
- + Item {
- + width: parent.width
- + height: Theme.paddingSmall
- + }
- +
- + SectionHeader {
- + //% "Camera bezel color"
- + text: qsTr("Camera bezel color")
- + }
- +
- + ComboBox {
- + width: parent.width
- +
- + label: qsTr("Camera bezel color")
- + currentIndex: updateIndex(customCameraOverlay.defaultbasel)
- +
- + menu: ContextMenu {
- +
- + MenuItem {
- + text: qsTr("Default")
- + onClicked: {
- + customCameraOverlay.defaultbasel = 0
- + }
- + }
- +
- + MenuItem {
- + text: qsTr("Lighter")
- + onClicked: {
- + customCameraOverlay.defaultbasel = 1
- + }
- + }
- +
- + MenuItem {
- + text: qsTr("Darker")
- + onClicked: {
- + customCameraOverlay.defaultbasel = 2
- + }
- + }
- + }
- +
- + function updateIndex(defaultbasel) {
- + if (defaultbasel == 0) {
- + return 0
- + } else if (defaultbasel == 1) {
- + return 1
- + } else if (defaultbasel == 2) {
- + return 2
- + }
- + }
- + }
- +
- + Slider {
- + id: slider2
- + visible: customCameraOverlay.defaultbasel
- + Rectangle {
- + id: background
- + x: slider2.leftMargin
- + z: -1
- + width: slider2._grooveWidth
- + height: Theme.paddingMedium
- + anchors.top: parent.verticalCenter
- + anchors.topMargin: -Theme.paddingLarge*2
- +
- + ShaderEffect {
- + id: rainbow
- + property variant src: background
- + property real saturation: 1.0
- + property real lightness: 0.5
- + property real alpha: 1.0
- +
- + width: parent.width
- + height: parent.height
- +
- + // Fragment shader to create hue color wheel background
- + fragmentShader: "
- + varying highp vec2 coord;
- + varying highp vec2 qt_TexCoord0;
- + uniform sampler2D src;
- + uniform lowp float qt_Opacity;
- + uniform lowp float saturation;
- + uniform lowp float lightness;
- + uniform lowp float alpha;
- +
- + void main() {
- + float r, g, b;
- +
- + float h = qt_TexCoord0.x * 360.0;
- + float s = saturation;
- + float l = lightness;
- +
- + float c = (1.0 - abs(2.0 * l - 1.0)) * s;
- + float hh = h / 60.0;
- + float x = c * (1.0 - abs(mod(hh, 2.0) - 1.0));
- +
- + int i = int( hh );
- +
- + if (i == 0) {
- + r = c; g = x; b = 0.0;
- + } else if (i == 1) {
- + r = x; g = c; b = 0.0;
- + } else if (i == 2) {
- + r = 0.0; g = c; b = x;
- + } else if (i == 3) {
- + r = 0.0; g = x; b = c;
- + } else if (i == 4) {
- + r = x; g = 0.0; b = c;
- + } else if (i == 5) {
- + r = c; g = 0.0; b = x;
- + } else {
- + r = 0.0; g = 0.0; b = 0.0;
- + }
- +
- + float m = l - 0.5 * c;
- +
- + lowp vec4 tex = texture2D(src, qt_TexCoord0);
- + gl_FragColor = vec4(r+m,g+m,b+m,alpha) * qt_Opacity;
- + }"
- + }
- + }
- +
- + width: parent.width
- + minimumValue: 0
- + maximumValue: 100
- + stepSize: 1
- + value: customCameraOverlay.baselcolor
- + valueText: "◭"
- + onValueChanged: customCameraOverlay.baselcolor = value
- + onPressAndHold: cancel()
- +
- + Label {
- + width: parent.width
- + wrapMode: Text.Wrap
- + font.pixelSize: Theme.fontSizeSmall
- + horizontalAlignment: Text.AlignHCenter
- + anchors.top: parent.verticalCenter
- + anchors.topMargin: Theme.paddingMedium*2.8
- + color: customCameraOverlay.defaultbasel == 1 ? Color.toHighlight(Color.fromHsva(customCameraOverlay.baselcolor/100, 1.0, 0.5, 1.0)) : Qt.darker(Color.toHighlight(Color.fromHsva(customCameraOverlay.baselcolor/100, 1.0, 0.5, 1.0)))
- + text: qsTr("Choose bezel color")
- + }
- + }
- +
- + Item {
- + width: parent.width
- + visible: customCameraOverlay.defaultbasel
- + height: Theme.paddingLarge
- + }
- +
- + Rectangle {
- + visible: customCameraOverlay.defaultbasel
- + anchors.horizontalCenter: parent.horizontalCenter
- + //width: Theme.pixelRatio > 1.0 ? 540 : 480
- + //height: Theme.pixelRatio > 1.0 ? 205 : 145
- + width: Theme.pixelRatio < 1.25 ? screen.width/1.1 : (Theme.pixelRatio < 1.5 ? screen.width/1.16 : screen.width/1.7)
- + height: Theme.pixelRatio < 1.25 ? icon.height : (Theme.pixelRatio < 1.5 ? icon.height*1.3 : icon.height*1.6)
- + color: customCameraOverlay.defaultbasel == 1 ? Color.toHighlight(Color.fromHsva(customCameraOverlay.baselcolor/100, 1.0, 0.5, 1.0)) : Qt.darker(Color.toHighlight(Color.fromHsva(customCameraOverlay.baselcolor/100, 1.0, 0.5, 1.0)))
- +
- + Image {
- + id: icon
- + //width: Theme.pixelRatio > 1.0 ? 497 : 437
- + //height: Theme.pixelRatio > 1.0 ? 205 : 145
- + scale: Theme.pixelRatio < 1.25 ? 1.0 : (Theme.pixelRatio < 1.5 ? 1.3 : 1.6)
- + anchors.horizontalCenter: parent.horizontalCenter
- + anchors.bottom: parent.verticalCenter
- + anchors.bottomMargin: Theme.pixelRatio < 1.25 ? -Theme.paddingLarge*3 : (Theme.pixelRatio < 1.5 ? -Theme.paddingLarge*2.2 : -Theme.paddingLarge*1.8)
- + source: customCameraOverlay.customicon ? "image://theme/icon-preview-camerabezel2" : "image://theme/icon-preview-camerabezel"
- + }
- + }
- +
- + Item {
- + width: parent.width
- + visible: customCameraOverlay.defaultbasel
- + height: Theme.paddingLarge
- + }
- +
- + TextSwitch {
- + visible: customCameraOverlay.defaultbasel
- + width: parent.width
- + text: "Use darker icons"
- + checked: customCameraOverlay.customicon
- + onClicked: customCameraOverlay.customicon = checked
- + }
- +
- + Item {
- + width: parent.width
- + height: Theme.paddingLarge*1.5
- + }
- }
- }
- --- /usr/lib/qt5/qml/com/jolla/camera/settings.qml 2018-10-22 03:00:00.000000000 +0300
- +++ /usr/lib/qt5/qml/com/jolla/camera/settings.qml 2018-11-14 22:18:23.000000000 +0200
- @@ -68,6 +68,15 @@
- CameraImageProcessing.WhiteBalanceTungsten
- ]
- + ConfigurationGroup {
- + id: customCameraOverlay
- +
- + path: "/apps/jolla-camera/camera/overlay"
- +
- + property int defaultbasel: 0
- + property bool customicon: false
- + }
- +
- ConfigurationGroup {
- id: modeSettings
- path: globalSettings.cameraDevice + "/" + globalSettings.captureMode
- @@ -101,8 +110,8 @@
- function captureModeIcon(mode) {
- switch (mode) {
- - case "image": return "image://theme/icon-camera-camera-mode"
- - case "video": return "image://theme/icon-camera-video"
- + case "image": return (customCameraOverlay.defaultbasel && customCameraOverlay.customicon && modeSettings.captureMode == Camera.CaptureStillImage ? "image://theme/icon-camera-camera-mode3" : "image://theme/icon-camera-camera-mode")
- + case "video": return (customCameraOverlay.defaultbasel && customCameraOverlay.customicon && modeSettings.captureMode == Camera.CaptureStillImage ? "image://theme/icon-camera-video3" : "image://theme/icon-camera-video")
- default: return ""
- }
- }
- --- /usr/lib/qt5/qml/com/jolla/camera/capture/CaptureOverlay.qml 2018-11-05 23:07:03.000000000 +0200
- +++ /usr/lib/qt5/qml/com/jolla/camera/capture/CaptureOverlay.qml 2018-11-14 22:25:42.000000000 +0200
- @@ -16,6 +16,15 @@
- SettingsOverlay {
- id: settingsOverlay
- + ConfigurationGroup {
- + id: customCameraOverlay
- +
- + path: "/apps/jolla-camera/camera/overlay"
- +
- + property int defaultbasel: 0
- + property bool customicon: false
- + }
- +
- property var captureView
- property var camera
- property Item focusArea
- @@ -202,7 +211,7 @@
- ? "image://theme/icon-camera-video-shutter-off"
- : (camera.captureMode == Camera.CaptureVideo
- ? "image://theme/icon-camera-video-shutter-on"
- - : "image://theme/icon-camera-shutter")
- + : (customCameraOverlay.defaultbasel && customCameraOverlay.customicon ? "image://theme/icon-camera-shutter3" : "image://theme/icon-camera-shutter"))
- }
- Label {
- --- /usr/lib/qt5/qml/com/jolla/camera/settings/SettingsOverlay.qml 2018-11-05 23:07:03.000000000 +0200
- +++ /usr/lib/qt5/qml/com/jolla/camera/settings/SettingsOverlay.qml 2018-11-14 22:38:12.000000000 +0200
- @@ -2,10 +2,22 @@
- import QtMultimedia 5.0
- import Sailfish.Silica 1.0
- import com.jolla.camera 1.0
- +import org.nemomobile.configuration 1.0
- PinchArea {
- id: overlay
- + ConfigurationGroup {
- + id: customCameraOverlay
- +
- + path: "/apps/jolla-camera/camera/overlay"
- +
- + property int customOverlay: 6
- + property int defaultbasel: 0
- + property bool customicon: false
- + property bool timerscreen: false
- + }
- +
- property bool isPortrait
- property real topButtonRowHeight
- property bool open
- @@ -160,7 +172,7 @@
- model: [ "primary", "secondary" ]
- settings: Settings
- property: "cameraDevice"
- - icon: "image://theme/icon-camera-switch"
- + icon: (customCameraOverlay.defaultbasel && customCameraOverlay.customicon && camera.captureMode == Camera.CaptureStillImage ? "image://theme/icon-camera-switch3" : "image://theme/icon-camera-switch")
- opacity: _commonControlOpacity
- visible: opacity > 0.0
- }
- @@ -184,7 +196,7 @@
- height: Theme.itemSizeExtraSmall
- anchors.horizontalCenter: parent.horizontalCenter
- radius: width / 2
- - color: Theme.rgba(_highlightColor, 0.4)
- + color: customCameraOverlay.defaultbasel && customCameraOverlay.customicon && !captureModeMenu.currentIndex ? "grey" : Theme.rgba(_highlightColor, 0.4)
- opacity: y < -captureModeMenu.itemStep ? 1.0 - (captureModeMenu.itemStep + y) / (-captureModeMenu.itemStep/2)
- : (y > 0 ? 1.0 - y/(captureModeMenu.itemStep/2) : 1.0)
- y: {
- @@ -377,7 +389,7 @@
- visible: overlay.expanded
- color: "black"
- - opacity: 0.6 * (1 - container.opacity)
- + opacity: "0." + customCameraOverlay.customOverlay * (1 - container.opacity)
- }
- Row {
- @@ -511,6 +523,31 @@
- }
- }
- + Column {
- + x: exposureSlider.alignment == Qt.AlignRight ? (isPortrait ? 0 : Theme.paddingLarge)
- + : parent.width - width - (isPortrait ? 0 : Theme.paddingLarge*9.9)
- + anchors {
- + verticalCenter: parent.verticalCenter
- + verticalCenterOffset: isPortrait ? Theme.paddingMedium : 0
- + }
- + spacing: Theme.paddingLarge
- +
- + SettingsMenu {
- + id: timerMenu2
- + visible: customCameraOverlay.timerscreen && !overlay.expanded
- + width: overlay._menuWidth
- + title: Settings.timerText
- + header: upperHeader
- + model: [ 0, 3, 10, 15 ]
- + delegate: SettingsMenuItem {
- + settings: Settings.mode
- + property: "timer"
- + value: modelData
- + icon: Settings.timerIcon(modelData)
- + }
- + }
- + }
- +
- Column {
- x: exposureSlider.alignment == Qt.AlignLeft ? (isPortrait ? 0 : Theme.paddingLarge)
- : parent.width - width - (isPortrait ? 0 : Theme.paddingLarge)
- --- /usr/share/jolla-camera/camera.qml 2018-10-22 03:00:00.000000000 +0300
- +++ /usr/share/jolla-camera/camera.qml 2018-11-14 22:43:59.000000000 +0200
- @@ -3,10 +3,21 @@
- import Sailfish.Media 1.0
- import com.jolla.camera 1.0
- import "pages"
- +import org.nemomobile.configuration 1.0
- +import com.jolla.gallery.ambience 1.0
- ApplicationWindow {
- id: window
- + ConfigurationGroup {
- + id: customCameraOverlay
- + path: "/apps/jolla-camera/camera/overlay"
- + property int baselcolor: 0
- + property int defaultbasel: 0
- + property string colorcode: customCameraOverlay.Color.toHighlight(Color.fromHsva(customCameraOverlay.baselcolor/100, 1.0, 0.5, 1.0))
- + property string colorcodedark: Qt.darker(customCameraOverlay.Color.toHighlight(Color.fromHsva(customCameraOverlay.baselcolor/100, 1.0, 0.5, 1.0)))
- + }
- +
- property var captureModel: null
- property bool galleryActive
- property bool galleryVisible
- @@ -29,7 +40,7 @@
- parent: window
- anchors.fill: parent
- z: -1
- - color: "black"
- + color: galleryActive ? "black" : (customCameraOverlay.defaultbasel == 1 ? customCameraOverlay.colorcode : (customCameraOverlay.defaultbasel == 2 ? customCameraOverlay.colorcodedark : "black"))
- visible: pageStack.depth < 2 && !pageStack.busy
- }
- --- /usr/share/jolla-camera/lockscreen.qml 2018-10-22 03:00:00.000000000 +0300
- +++ /usr/share/jolla-camera/lockscreen.qml 2018-11-14 22:48:54.000000000 +0200
- @@ -4,10 +4,21 @@
- import Sailfish.Media 1.0
- import com.jolla.camera 1.0
- import QtMultimedia 5.0
- +import org.nemomobile.configuration 1.0
- +import com.jolla.gallery.ambience 1.0
- ApplicationWindow {
- id: window
- + ConfigurationGroup {
- + id: customCameraOverlay
- + path: "/apps/jolla-camera/camera/overlay"
- + property int baselcolor: 0
- + property int defaultbasel: 0
- + property string colorcode: customCameraOverlay.Color.toHighlight(Color.fromHsva(customCameraOverlay.baselcolor/100, 1.0, 0.5, 1.0))
- + property string colorcodedark: Qt.darker(customCameraOverlay.Color.toHighlight(Color.fromHsva(customCameraOverlay.baselcolor/100, 1.0, 0.5, 1.0)))
- + }
- +
- allowedOrientations: defaultAllowedOrientations
- _defaultPageOrientations: Orientation.All
- _defaultLabelFormat: Text.PlainText
- @@ -40,7 +51,7 @@
- width: window.width
- height: window.height
- - color: "black"
- + color: customCameraOverlay.defaultbasel == 1 ? customCameraOverlay.colorcode : (customCameraOverlay.defaultbasel == 2 ? customCameraOverlay.colorcodedark : "black")
- }
- GStreamerVideoOutput {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement