Merge lp:~uriboni/camera-app/rotate-popovers into lp:camera-app/staging

Proposed by Ugo Riboni
Status: Merged
Approved by: Florian Boucault
Approved revision: 614
Merged at revision: 614
Proposed branch: lp:~uriboni/camera-app/rotate-popovers
Merge into: lp:camera-app/staging
Diff against target: 119 lines (+23/-9)
4 files modified
DeleteDialog.qml (+1/-3)
GalleryView.qml (+1/-0)
PhotogridView.qml (+11/-4)
SlideshowView.qml (+10/-2)
To merge this branch: bzr merge lp:~uriboni/camera-app/rotate-popovers
Reviewer Review Type Date Requested Status
Florian Boucault (community) Needs Fixing
Review via email: mp+278685@code.launchpad.net

Commit message

Correctly rotate the share and delete dialogs by parenting them to the views that trigger them

Description of the change

Correctly rotate the share and delete dialogs by parenting them to the views that trigger them

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

PopupUtils.open(sharePopoverComponent).parent = photogridView

2 non obvious things in one line, please make it 2 lines

review: Needs Fixing
614. By Ugo Riboni

Make code more readable

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'DeleteDialog.qml'
2--- DeleteDialog.qml 2015-11-17 10:38:00 +0000
3+++ DeleteDialog.qml 2015-11-26 13:45:48 +0000
4@@ -33,9 +33,7 @@
5
6 text: i18n.tr("Delete")
7 color: UbuntuColors.red
8- onClicked: {
9- PopupUtils.close(deleteDialog);
10- }
11+ onClicked: PopupUtils.close(deleteDialog)
12 }
13
14 Button {
15
16=== modified file 'GalleryView.qml'
17--- GalleryView.qml 2015-10-26 13:19:14 +0000
18+++ GalleryView.qml 2015-11-26 13:45:48 +0000
19@@ -107,6 +107,7 @@
20 model.toggleSelected(index);
21 }
22 onExitUserSelectionMode: galleryView.exitUserSelectionMode()
23+ onToggleHeader: header.toggle()
24 }
25
26 // FIXME: it would be better to use the standard header from the toolkit
27
28=== modified file 'PhotogridView.qml'
29--- PhotogridView.qml 2015-11-03 14:23:10 +0000
30+++ PhotogridView.qml 2015-11-26 13:45:48 +0000
31@@ -30,6 +30,7 @@
32 signal photoPressAndHold(int index)
33 signal photoSelectionAreaClicked(int index)
34 signal exitUserSelectionMode
35+ signal toggleHeader()
36 property real headerHeight
37 property bool inView
38 property bool inSelectionMode
39@@ -41,16 +42,20 @@
40 iconName: "share"
41 enabled: model.selectedFiles.length <= 1
42 onTriggered: {
43- if (model.selectedFiles.length > 0)
44- PopupUtils.open(sharePopoverComponent)
45+ if (model.selectedFiles.length > 0) {
46+ var dialog = PopupUtils.open(sharePopoverComponent)
47+ dialog.parent = photogridView
48+ }
49 }
50 },
51 Action {
52 text: i18n.tr("Delete")
53 iconName: "delete"
54 onTriggered: {
55- if (model.selectedFiles.length > 0)
56- PopupUtils.open(deleteDialogComponent);
57+ if (model.selectedFiles.length > 0) {
58+ var dialog = PopupUtils.open(deleteDialogComponent)
59+ dialog.parent = photogridView
60+ }
61 }
62 }
63 ]
64@@ -194,6 +199,7 @@
65 id: sharePopover
66
67 onContentPeerSelected: photogridView.exitUserSelectionMode();
68+ onVisibleChanged: photogridView.toggleHeader()
69
70 transferContentType: MimeTypeMapper.mimeTypeToContentType(model.get(model.selectedFiles[0], "fileType"));
71 transferItems: model.selectedFiles.map(function(row) {
72@@ -216,6 +222,7 @@
73 model.deleteSelectedFiles();
74 photogridView.exitUserSelectionMode();
75 }
76+ onVisibleChanged: photogridView.toggleHeader()
77 }
78 }
79 }
80
81=== modified file 'SlideshowView.qml'
82--- SlideshowView.qml 2015-10-22 12:24:15 +0000
83+++ SlideshowView.qml 2015-11-26 13:45:48 +0000
84@@ -49,12 +49,18 @@
85 Action {
86 text: i18n.tr("Share")
87 iconName: "share"
88- onTriggered: PopupUtils.open(sharePopoverComponent)
89+ onTriggered: {
90+ var dialog = PopupUtils.open(sharePopoverComponent)
91+ dialog.parent = slideshowView
92+ }
93 },
94 Action {
95 text: i18n.tr("Delete")
96 iconName: "delete"
97- onTriggered: PopupUtils.open(deleteDialogComponent)
98+ onTriggered: {
99+ var dialog = PopupUtils.open(deleteDialogComponent)
100+ dialog.parent = slideshowView
101+ }
102 }
103 ]
104
105@@ -323,6 +329,7 @@
106 contentItem.url = slideshowView.model.get(slideshowView.currentIndex, "filePath");
107 transferItems = [contentItem];
108 }
109+ onVisibleChanged: toggleHeader()
110
111 transferContentType: MimeTypeMapper.mimeTypeToContentType(slideshowView.model.get(slideshowView.currentIndex, "fileType"));
112 }
113@@ -350,6 +357,7 @@
114 var currentFilePath = slideshowView.model.get(toBeDeleted, "filePath");
115 fileOperations.remove(currentFilePath);
116 }
117+ onVisibleChanged: toggleHeader()
118 }
119 }
120

Subscribers

People subscribed via source and target branches