Merge lp:~joergberroth/unav/format_fixes_PoiListpage into lp:unav

Proposed by JkB
Status: Superseded
Proposed branch: lp:~joergberroth/unav/format_fixes_PoiListpage
Merge into: lp:unav
Diff against target: 215 lines (+42/-36)
2 files modified
qml/Coordinate.qml (+41/-35)
qml/PoiListPage.qml (+1/-1)
To merge this branch: bzr merge lp:~joergberroth/unav/format_fixes_PoiListpage
Reviewer Review Type Date Requested Status
Nekhelesh Ramananthan Pending
Review via email: mp+290816@code.launchpad.net

This proposal supersedes a proposal from 2016-04-03.

Commit message

*from trailing to last

Description of the change

small format fixes for icon in PoiListpage

To post a comment you must log in.
Revision history for this message
Nekhelesh Ramananthan (nik90) wrote : Posted in a previous version of this proposal

I think the icon size fix is a good idea. I noticed that issue when I was casually testing. Nice catch Joerg!. One thing however, I would keep SlotsLayout.position: SlotsLayout.Last since the icon is meant to be shown last in the listitem.

https://developer.ubuntu.com/api/apps/qml/sdk-15.04.1/Ubuntu.Components.SlotsLayout/

review: Needs Fixing
Revision history for this message
JkB (joergberroth) wrote : Posted in a previous version of this proposal

Yes, but than the icon seems not fixed in position for last and will vary !
So this at least fixes the position and i don't see why trailling should
not do the trick

Best Joerg

Am 2016-04-03 um 11:56 schrieb Nekhelesh Ramananthan:
> Review: Needs Fixing
>
> I think the icon size fix is a good idea. I noticed that issue when I was casually testing. Nice catch Joerg!. One thing however, I would keep SlotsLayout.position: SlotsLayout.Last since the icon is meant to be shown last in the listitem.
>
> https://developer.ubuntu.com/api/apps/qml/sdk-15.04.1/Ubuntu.Components.SlotsLayout/
>

Revision history for this message
Nekhelesh Ramananthan (nik90) wrote : Posted in a previous version of this proposal

Well for starters it should be SlotsLayout.Trailing (with one L). And secondly according to the documentation, SlotsLayout.Last ensures that the icon doesn't move and is always the last item on the listitem. While SlotsLayout.Trailing allows the icon to just be on the trailing slot and move if more elements are added.

In trunk, the icon *appears* to move because of the variable width that I set..not because of the slots positioning.

review: Needs Fixing
Revision history for this message
JkB (joergberroth) wrote : Posted in a previous version of this proposal

So, as long as nothing is added, trailling is fine ;-) and if something
will be added it has to be reevaluated still.
m Sonntag, 3. April 2016 12:14:39 CEST schrieb Nekhelesh Ramananthan
<email address hidden>:
> Review: Needs Fixing
>
> Well for starters it should be SlotsLayout.Trailing (with one
> L). And secondly according to the documentation,
> SlotsLayout.Last ensures that the icon doesn't move and is
> always the last item on the listitem. While SlotsLayout.Trailing
> allows the icon to just be on the trailing slot and move if more
> elements are added.
>
> In trunk, the icon *appears* to move because of the variable
> width that I set..not because of the slots positioning.

--
Versandt, mit Dekko von meinem Ubuntu-Gerät

Revision history for this message
Nekhelesh Ramananthan (nik90) wrote : Posted in a previous version of this proposal

> So, as long as nothing is added, trailling is fine ;-) and if something
> will be added it has to be reevaluated still.
> m Sonntag, 3. April 2016 12:14:39 CEST schrieb Nekhelesh Ramananthan
> <email address hidden>:
> > Review: Needs Fixing
> >
> > Well for starters it should be SlotsLayout.Trailing (with one
> > L). And secondly according to the documentation,
> > SlotsLayout.Last ensures that the icon doesn't move and is
> > always the last item on the listitem. While SlotsLayout.Trailing
> > allows the icon to just be on the trailing slot and move if more
> > elements are added.
> >
> > In trunk, the icon *appears* to move because of the variable
> > width that I set..not because of the slots positioning.
>

Just curious, but what do you have against using SlotsLayouts.Last? By using it, we can ensure the icon is always the last position regardless of any code changes in the future. We do want the icon to be always the last position, no?
>
>
> --
> Versandt, mit Dekko von meinem Ubuntu-Gerät

Revision history for this message
JkB (joergberroth) wrote : Posted in a previous version of this proposal

Am 2016-04-03 um 12:39 schrieb Nekhelesh Ramananthan:
>> So, as long as nothing is added, trailling is fine ;-) and if something
>> will be added it has to be reevaluated still.
>> m Sonntag, 3. April 2016 12:14:39 CEST schrieb Nekhelesh Ramananthan
>> <email address hidden>:
>>> Review: Needs Fixing
>>>
>>> Well for starters it should be SlotsLayout.Trailing (with one
>>> L). And secondly according to the documentation,
>>> SlotsLayout.Last ensures that the icon doesn't move and is
>>> always the last item on the listitem. While SlotsLayout.Trailing
>>> allows the icon to just be on the trailing slot and move if more
>>> elements are added.
>>>
>>> In trunk, the icon *appears* to move because of the variable
>>> width that I set..not because of the slots positioning.
>>
>
> Just curious, but what do you have against using SlotsLayouts.Last? By using it, we can ensure the icon is always the last position regardless of any code changes in the future. We do want the icon to be always the last position, no?
Do you know this, yet? ;-)

For me it looks like this is clear code without having to tweak
anything. if I put last, I have to tweak the main slot to get a fixed
position. Why ever...
and if there will be additional trailing features, you will have to
decide than which trailing will be last as you can not foresee this now.
>>
>>
>> --
>> Versandt, mit Dekko von meinem Ubuntu-Gerät

Revision history for this message
Nekhelesh Ramananthan (nik90) wrote : Posted in a previous version of this proposal

Fine whatever.. Could you atleast then fix the spelling mistake of SlotsLayout.Trailling.

Revision history for this message
Nekhelesh Ramananthan (nik90) wrote : Posted in a previous version of this proposal

FYI you wouldn't have to tweak the main slot positioning. And for 0.58 we know the icon is going to be last always. So yes I know it :)

Revision history for this message
JkB (joergberroth) wrote : Posted in a previous version of this proposal

just changed it to last.
Seems to work "now". Maybe some eye sand in the morning. ;-)

Best Joerg

Am 2016-04-03 um 12:53 schrieb Nekhelesh Ramananthan:
> FYI you wouldn't have to tweak the main slot positioning. And for 0.58 we know the icon is going to be last always. So yes I know it :)
>

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Coordinate.qml'
2--- qml/Coordinate.qml 2016-03-26 18:53:17 +0000
3+++ qml/Coordinate.qml 2016-04-03 11:23:12 +0000
4@@ -14,7 +14,6 @@
5 */
6
7 import QtQuick 2.4
8-import QtQuick.Layouts 1.1
9 import Ubuntu.Components 1.3
10 import Ubuntu.Components.Pickers 1.3
11 import Ubuntu.Components.Popups 1.3
12@@ -22,36 +21,31 @@
13 Page {
14 id: coordPage
15
16- title: i18n.tr("Coordinates")
17- anchors.fill: parent
18-
19- head {
20- id: headPage
21- backAction: Action {
22- iconName: "back"
23- text: i18n.tr("Back")
24- onTriggered: {
25- mainPageStack.pop(coordPage)
26- mainPageStack.push(Qt.resolvedUrl("RoutePage.qml"))
27+ header: PageHeader {
28+ title: i18n.tr("Coordinates")
29+ extension: Sections {
30+ id: typeSections
31+ anchors {
32+ left: parent.left
33+ bottom: parent.bottom
34 }
35- }
36- sections {
37+
38 model: [i18n.tr("Decimal"), i18n.tr("Sexagesimal")]
39 selectedIndex: 0
40 }
41 }
42-
43+ anchors.fill: parent
44
45 Column {
46 id: colCoordDec
47- visible: !coordPage.head.sections.selectedIndex
48+ visible: !typeSections.selectedIndex
49 anchors.horizontalCenter: parent.horizontalCenter
50 anchors.verticalCenter: parent.verticalCenter
51 width: units.gu(28)
52 height: units.gu(10)
53-
54+
55 spacing: units.gu(2)
56-
57+
58 Row {
59 spacing: units.gu(1)
60 Label {
61@@ -59,7 +53,7 @@
62 text: i18n.tr("Lat:")
63 width: units.gu(5)
64 }
65-
66+
67 TextField {
68 id: lat1
69 anchors.verticalCenter: parent.verticalCenter
70@@ -69,7 +63,7 @@
71 placeholderText: '51.506177'
72 }
73 }
74-
75+
76 Row {
77 spacing: units.gu(1)
78 Label {
79@@ -77,7 +71,7 @@
80 text: i18n.tr("Long:")
81 width: units.gu(5)
82 }
83-
84+
85 TextField {
86 id: lng1
87 anchors.verticalCenter: parent.verticalCenter
88@@ -87,7 +81,7 @@
89 placeholderText: '-0.100236'
90 }
91 }
92-
93+
94 Button {
95 id: showCoordDec
96 text: i18n.tr("Show on Map")
97@@ -96,6 +90,9 @@
98 anchors.horizontalCenter: parent.horizontalCenter
99 color: UbuntuColors.green
100 onClicked: {
101+ lng1.text === "" ? lng1.text = lng1.placeholderText : undefined
102+ lat1.text === "" ? lat1.text = lat1.placeholderText : undefined
103+
104 try {
105 var aux_lat = lat1.text;
106 var aux_lng = lng1.text;
107@@ -106,8 +103,8 @@
108 mainPageStack.center_onpos = 1;
109 mainPageStack.pop(coordPage);
110 mainPageStack.executeJavaScript(
111- "ui.markers_POI_set([{title: '', lat: " + mainPageStack.clickedLat + ", lng: " + mainPageStack.clickedLng + "}]);"
112- );
113+ "ui.markers_POI_set([{title: '', lat: " + mainPageStack.clickedLat + ", lng: " + mainPageStack.clickedLng + "}]);"
114+ );
115 mainPageStack.favPopup = false;
116 goThereActionPopover.show();
117 }
118@@ -128,8 +125,8 @@
119 title: i18n.tr("Coordinates are not valid")
120 text: i18n.tr("Enter valid decimal coordinates\n\nExpected format is:") + "\n51.506177\n-0.100236"
121 Button {
122- text: i18n.tr("Close")
123- onClicked: PopupUtils.close(dialogue)
124+ text: i18n.tr("Close")
125+ onClicked: PopupUtils.close(dialogue)
126 }
127 }
128 }
129@@ -138,14 +135,14 @@
130
131 Column {
132 id: colCoordPolar
133- visible: coordPage.head.sections.selectedIndex
134+ visible: typeSections.selectedIndex
135 anchors.horizontalCenter: parent.horizontalCenter
136 anchors.verticalCenter: parent.verticalCenter
137 width: units.gu(35)
138 height: units.gu(10)
139-
140+
141 spacing: units.gu(2)
142-
143+
144 Row {
145 Label {
146 anchors.verticalCenter: parent.verticalCenter
147@@ -205,7 +202,7 @@
148 width: units.gu(2)
149 }
150 }
151-
152+
153 Row {
154 Label {
155 anchors.verticalCenter: parent.verticalCenter
156@@ -274,6 +271,15 @@
157 anchors.horizontalCenter: parent.horizontalCenter
158 color: UbuntuColors.green
159 onClicked: {
160+ lng2a.text === "" ? lng2a.text = lng2a.placeholderText : undefined
161+ lat2a.text === "" ? lat2a.text = lat2a.placeholderText : undefined
162+ lng2b.text === "" ? lng2b.text = lng2b.placeholderText : undefined
163+ lat2b.text === "" ? lat2b.text = lat2b.placeholderText : undefined
164+ lng2c.text === "" ? lng2c.text = lng2c.placeholderText : undefined
165+ lat2c.text === "" ? lat2c.text = lat2c.placeholderText : undefined
166+ lng2d.text === "" ? lng2d.text = lng2d.placeholderText : undefined
167+ lat2d.text === "" ? lat2d.text = lat2d.placeholderText : undefined
168+
169 try {
170 var aux_lat_day = parseInt(lat2a.text);
171 var aux_lat_min = parseFloat(lat2b.text);
172@@ -285,7 +291,7 @@
173 var aux_lng_dir = lng2d.text.toUpperCase();
174
175 if ((!isNaN(aux_lat_day) && !isNaN(aux_lat_min) && !isNaN(aux_lat_sec) && (aux_lat_dir === 'S' || aux_lat_dir === 'N')) &&
176- (!isNaN(aux_lng_day) && !isNaN(aux_lng_min) && !isNaN(aux_lng_sec) && (aux_lng_dir === 'W' || aux_lng_dir === 'E'))) {
177+ (!isNaN(aux_lng_day) && !isNaN(aux_lng_min) && !isNaN(aux_lng_sec) && (aux_lng_dir === 'W' || aux_lng_dir === 'E'))) {
178 var aux_lat = aux_lat_day + aux_lat_min/60 + aux_lat_sec/(60*60);
179 if (aux_lat_dir === "S" || aux_lat_dir === "W")
180 aux_lat = aux_lat * -1;
181@@ -301,8 +307,8 @@
182 mainPageStack.center_onpos = 1;
183 mainPageStack.pop(coordPage);
184 mainPageStack.executeJavaScript(
185- "ui.markers_POI_set([{title: '', lat: " + mainPageStack.clickedLat + ", lng: " + mainPageStack.clickedLng + "}]);"
186- );
187+ "ui.markers_POI_set([{title: '', lat: " + mainPageStack.clickedLat + ", lng: " + mainPageStack.clickedLng + "}]);"
188+ );
189 mainPageStack.favPopup = false;
190 goThereActionPopover.show();
191 }
192@@ -327,8 +333,8 @@
193 title: i18n.tr("Coordinates are not valid")
194 text: i18n.tr("Enter valid sexagesimal coordinates\n\nExpected format is:") + "\n51° 30' 22.23'' N\n0° 6' 0.84'' W"
195 Button {
196- text: i18n.tr("Close")
197- onClicked: PopupUtils.close(dialogue)
198+ text: i18n.tr("Close")
199+ onClicked: PopupUtils.close(dialogue)
200 }
201 }
202 }
203
204=== modified file 'qml/PoiListPage.qml'
205--- qml/PoiListPage.qml 2016-03-28 19:36:52 +0000
206+++ qml/PoiListPage.qml 2016-04-03 11:23:12 +0000
207@@ -334,7 +334,7 @@
208 id: acessibilityIcon
209 name: "preferences-desktop-accessibility-symbolic"
210 visible: model.wheelchair === "yes" || model.wheelchair === "limited" // is limited enough as criteria?
211- width: parent.height / 2
212+ width: units.gu(2)
213 SlotsLayout.position: SlotsLayout.Last
214 }
215 }

Subscribers

People subscribed via source and target branches