Merge lp:~artmello/camera-app/camera-app-gridlines into lp:camera-app

Proposed by Arthur Mello
Status: Superseded
Proposed branch: lp:~artmello/camera-app/camera-app-gridlines
Merge into: lp:camera-app
Diff against target: 273 lines (+98/-19)
4 files modified
OptionValueButton.qml (+3/-2)
OptionsOverlay.qml (+15/-10)
ViewFinderOverlay.qml (+53/-5)
ViewFinderView.qml (+27/-2)
To merge this branch: bzr merge lp:~artmello/camera-app/camera-app-gridlines
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Florian Boucault (community) Needs Fixing
Review via email: mp+243092@code.launchpad.net

This proposal has been superseded by a proposal from 2014-12-02.

Commit message

Add gridlines to the viewfinder controlled by a new settings option

Description of the change

Add gridlines to the viewfinder controlled by a new settings option

To post a comment you must log in.
Revision history for this message
Florian Boucault (fboucault) wrote :

- making the grid of options 4 columns does not really solve the problem of too many options long term (especially with your other MR coming in); thankfully this was solved already in another branch's commit. I think we should merge the specific commit that fixes it: commit 428 from lp:~fboucault/camera-app/jpeg_quality
Merge command: bzr merge -c428 lp:~fboucault/camera-app/jpeg_quality
- icon "view-grid-symbolic" is not good enough. I asked Matthieu (tiheum) from design to provide a better one.
- visually the grid should not have lines around the picture, only the 4 lines inside it; these lines outside are not useful and they create a boxing feel to the UI
- no need to use a Binding object (I understand the consistency reason, but it won't work out for other settings)
- better to not instantiate the Rectangles at all when the grid is disabled; "Repeater.model: settings.gridEnabled ? gridlines.columns * gridlines.rows : 0" will do the trick
- using Rectangle.border to draw is slightly more expensive than using Rectangle.color

review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
428. By Arthur Mello

Merged bottom edge UI fixes from lp:~fboucault/camera-app/sdcard

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'OptionValueButton.qml'
--- OptionValueButton.qml 2014-07-09 21:57:43 +0000
+++ OptionValueButton.qml 2014-12-01 01:56:45 +0000
@@ -47,14 +47,15 @@
47 id: label47 id: label
48 anchors {48 anchors {
49 left: icon.name != "" ? icon.right : parent.left49 left: icon.name != "" ? icon.right : parent.left
50 leftMargin: units.gu(2)50 leftMargin: icon.name != "" ? units.gu(2) : icon.anchors.leftMargin
51 right: parent.right51 right: parent.right
52 rightMargin: units.gu(2)52 rightMargin: icon.anchors.leftMargin
53 verticalCenter: parent.verticalCenter53 verticalCenter: parent.verticalCenter
54 }54 }
5555
56 color: "white"56 color: "white"
57 opacity: optionValueButton.selected ? 1.0 : 0.557 opacity: optionValueButton.selected ? 1.0 : 0.5
58 elide: Text.ElideRight
58 }59 }
5960
60 Rectangle {61 Rectangle {
6162
=== modified file 'OptionsOverlay.qml'
--- OptionsOverlay.qml 2014-09-05 12:04:54 +0000
+++ OptionsOverlay.qml 2014-12-01 01:56:45 +0000
@@ -21,12 +21,13 @@
21 id: optionsOverlay21 id: optionsOverlay
2222
23 property list<ListModel> options23 property list<ListModel> options
24 property bool valueSelectorOpened: optionValueSelector.caller != null
2425
25 function closeValueSelector() {26 function closeValueSelector() {
26 optionValueSelector.hide();27 optionValueSelector.hide();
27 }28 }
2829
29 height: optionsGrid.height30 height: optionsGrid.height + optionsGrid.rowSpacing
3031
31 Grid {32 Grid {
32 id: optionsGrid33 id: optionsGrid
@@ -34,9 +35,7 @@
34 horizontalCenter: parent.horizontalCenter35 horizontalCenter: parent.horizontalCenter
35 }36 }
3637
37 columns: 338 rowSpacing: units.gu(4)
38 columnSpacing: units.gu(9.5)
39 rowSpacing: units.gu(9.5)
4039
41 Repeater {40 Repeater {
42 model: optionsOverlay.options41 model: optionsOverlay.options
@@ -44,6 +43,9 @@
44 id: optionButton43 id: optionButton
45 model: modelData44 model: modelData
46 onClicked: optionValueSelector.toggle(model, optionButton)45 onClicked: optionValueSelector.toggle(model, optionButton)
46 enabled: model.available && (!optionValueSelector.caller || optionValueSelector.caller == optionButton)
47 opacity: enabled ? 1.0 : 0.05
48 Behavior on opacity {UbuntuNumberAnimation {duration: UbuntuAnimation.FastDuration}}
47 }49 }
48 }50 }
49 }51 }
@@ -51,11 +53,9 @@
51 Column {53 Column {
52 id: optionValueSelector54 id: optionValueSelector
53 objectName: "optionValueSelector"55 objectName: "optionValueSelector"
54 anchors {56 width: units.gu(16)
55 bottom: optionsGrid.top57
56 bottomMargin: units.gu(2)58 property OptionButton caller
57 }
58 width: units.gu(12)
5959
60 function toggle(model, callerButton) {60 function toggle(model, callerButton) {
61 if (optionValueSelectorVisible && optionsRepeater.model === model) {61 if (optionValueSelectorVisible && optionsRepeater.model === model) {
@@ -66,13 +66,15 @@
66 }66 }
6767
68 function show(model, callerButton) {68 function show(model, callerButton) {
69 optionValueSelector.caller = callerButton;
70 optionsRepeater.model = model;
69 alignWith(callerButton);71 alignWith(callerButton);
70 optionsRepeater.model = model;
71 optionValueSelectorVisible = true;72 optionValueSelectorVisible = true;
72 }73 }
7374
74 function hide() {75 function hide() {
75 optionValueSelectorVisible = false;76 optionValueSelectorVisible = false;
77 optionValueSelector.caller = null;
76 }78 }
7779
78 function alignWith(item) {80 function alignWith(item) {
@@ -90,6 +92,9 @@
90 } else {92 } else {
91 x = centeredX;93 x = centeredX;
92 }94 }
95
96 // vertically position the options above the caller button
97 y = Qt.binding(function() { return optionsGrid.y + item.y - height - units.gu(2) });
93 }98 }
9499
95 visible: opacity !== 0.0100 visible: opacity !== 0.0
96101
=== modified file 'ViewFinderOverlay.qml'
--- ViewFinderOverlay.qml 2014-09-05 12:04:54 +0000
+++ ViewFinderOverlay.qml 2014-12-01 01:56:45 +0000
@@ -20,6 +20,7 @@
20import QtMultimedia 5.020import QtMultimedia 5.0
21import QtPositioning 5.221import QtPositioning 5.2
22import CameraApp 0.122import CameraApp 0.1
23import Qt.labs.settings 1.0
2324
24Item {25Item {
25 id: viewFinderOverlay26 id: viewFinderOverlay
@@ -34,15 +35,15 @@
34 focusRing.show();35 focusRing.show();
35 }36 }
3637
37 QtObject {38 Settings {
38 id: settings39 id: settings
3940
40 property int flashMode: Camera.FlashAuto41 property int flashMode: Camera.FlashAuto
41 property bool gpsEnabled: false42 property bool gpsEnabled: false
42 property bool hdrEnabled: false43 property bool hdrEnabled: false
43 property int videoFlashMode: Camera.FlashOff44 property int videoFlashMode: Camera.FlashOff
4445 property bool gridEnabled: false
45 StateSaver.properties: "flashMode, gpsEnabled, hdrEnabled, videoFlashMode"46 property int encodingQuality: 2 // QMultimedia.NormalQuality
46 }47 }
4748
48 Binding {49 Binding {
@@ -65,6 +66,12 @@
65 value: settings.hdrEnabled66 value: settings.hdrEnabled
66 }67 }
6768
69 Binding {
70 target: gridlines
71 property: "visible"
72 value: settings.gridEnabled
73 }
74
68 Connections {75 Connections {
69 target: camera.imageCapture76 target: camera.imageCapture
70 onReadyChanged: {77 onReadyChanged: {
@@ -77,10 +84,19 @@
77 }84 }
78 }85 }
7986
87 function optionsOverlayClose() {
88 print("optionsOverlayClose")
89 if (optionsOverlayLoader.item.valueSelectorOpened) {
90 optionsOverlayLoader.item.closeValueSelector();
91 } else {
92 bottomEdge.close();
93 }
94 }
95
80 MouseArea {96 MouseArea {
81 id: bottomEdgeClose97 id: bottomEdgeClose
82 anchors.fill: parent98 anchors.fill: parent
83 onClicked: bottomEdge.close()99 onClicked: optionsOverlayClose()
84 }100 }
85101
86 Panel {102 Panel {
@@ -90,9 +106,19 @@
90 left: parent.left106 left: parent.left
91 bottom: parent.bottom107 bottom: parent.bottom
92 }108 }
93 height: units.gu(9)109 height: optionsOverlayLoader.height
94 onOpenedChanged: optionsOverlayLoader.item.closeValueSelector()110 onOpenedChanged: optionsOverlayLoader.item.closeValueSelector()
95111
112 Item {
113 /* Use the 'trigger' feature of Panel so that tapping on the Panel
114 has the same effect as tapping outside of it (bottomEdgeClose) */
115 id: clickReceiver
116 anchors.fill: parent
117 function trigger() {
118 optionsOverlayClose();
119 }
120 }
121
96 property real progress: (bottomEdge.height - bottomEdge.position) / bottomEdge.height122 property real progress: (bottomEdge.height - bottomEdge.position) / bottomEdge.height
97 property list<ListModel> options: [123 property list<ListModel> options: [
98 ListModel {124 ListModel {
@@ -187,6 +213,28 @@
187 label: QT_TR_NOOP("Off")213 label: QT_TR_NOOP("Off")
188 value: false214 value: false
189 }215 }
216 },
217 ListModel {
218 id: gridOptionsModel
219
220 property string settingsProperty: "gridEnabled"
221 property string icon: "view-grid-symbolic"
222 property string label: ""
223 property bool isToggle: true
224 property int selectedIndex: bottomEdge.indexForValue(gridOptionsModel, settings.gridEnabled)
225 property bool available: true
226 property bool visible: true
227
228 ListElement {
229 icon: ""
230 label: QT_TR_NOOP("On")
231 value: true
232 }
233 ListElement {
234 icon: ""
235 label: QT_TR_NOOP("Off")
236 value: false
237 }
190 }238 }
191 ]239 ]
192240
193241
=== modified file 'ViewFinderView.qml'
--- ViewFinderView.qml 2014-10-09 19:14:01 +0000
+++ ViewFinderView.qml 2014-12-01 01:56:45 +0000
@@ -132,7 +132,8 @@
132 Item {132 Item {
133 id: viewFinderSwitcher133 id: viewFinderSwitcher
134 anchors.fill: parent134 anchors.fill: parent
135 135 visible: !viewFinderSwitcherBlurred.visible
136
136 ShaderEffectSource {137 ShaderEffectSource {
137 id: viewFinderGrab138 id: viewFinderGrab
138 live: false139 live: false
@@ -247,6 +248,26 @@
247 viewFinderWidth: viewFinder.width248 viewFinderWidth: viewFinder.width
248 viewFinderOrientation: viewFinder.orientation249 viewFinderOrientation: viewFinder.orientation
249 }250 }
251
252 Grid {
253 id: gridlines
254 anchors.fill: parent
255 visible: false
256 columns: 3
257 property int rows: 3
258
259 Repeater {
260 model: gridlines.columns * gridlines.rows
261
262 Rectangle {
263 width: parent.width / gridlines.columns
264 height: parent.height / gridlines.rows
265 border.width: 1
266 border.color: "gray"
267 color: "transparent"
268 }
269 }
270 }
250 }271 }
251272
252 Rectangle {273 Rectangle {
@@ -274,8 +295,12 @@
274 }295 }
275296
276 FastBlur {297 FastBlur {
298 id: viewFinderSwitcherBlurred
277 anchors.fill: viewFinderSwitcher299 anchors.fill: viewFinderSwitcher
278 radius: photoRollHint.visible ? 64 : viewFinderOverlay.revealProgress * 64300 property real finalRadius: 64
301 property real finalOpacity: 0.7
302 radius: photoRollHint.visible ? finalRadius : viewFinderOverlay.revealProgress * finalRadius
303 opacity: photoRollHint.visible ? finalOpacity : (1.0 - viewFinderOverlay.revealProgress) * finalOpacity + finalOpacity
279 source: radius !== 0 ? viewFinderSwitcher : null304 source: radius !== 0 ? viewFinderSwitcher : null
280 visible: radius !== 0305 visible: radius !== 0
281 }306 }

Subscribers

People subscribed via source and target branches