Merge lp:~mzanetti/ubuntu-docviewer-app/fix-layouts-with-icons into lp:ubuntu-docviewer-app/trunk

Proposed by Michael Zanetti
Status: Rejected
Rejected by: Stefano Verzegnassi
Proposed branch: lp:~mzanetti/ubuntu-docviewer-app/fix-layouts-with-icons
Merge into: lp:ubuntu-docviewer-app/trunk
Prerequisite: lp:~verzegnassi-stefano/ubuntu-docviewer-app/attempt-fix-zooming-1
Diff against target: 28 lines (+4/-3) (has conflicts)
2 files modified
src/app/qml/documentPage/DocumentGridDelegate.qml (+2/-1)
src/app/qml/documentPage/DocumentListDelegate.qml (+2/-2)
Text conflict in po/com.ubuntu.docviewer.pot
To merge this branch: bzr merge lp:~mzanetti/ubuntu-docviewer-app/fix-layouts-with-icons
Reviewer Review Type Date Requested Status
Stefano Verzegnassi Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Needs Fixing
Review via email: mp+254072@code.launchpad.net

Commit message

properly set icon sizes inside layouts

Description of the change

QtQuick.Layouts ignore width/height and only act on implicitWidth/implicitHeight. Given that the implicit size of an Icon does not necessarily match the requested width/height (for example if the icon loads a png which simply isn't available in the requested size) this can badly mess up the layout and even end up in a loop reloading the image.

sizes in Layouts should always be set using Layout.preferredWidth/preferredHeight.

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Stefano Verzegnassi (verzegnassi-stefano) wrote :

Hi Michael,
Thank you for the patch!

I wonder if you intentionally chose lp:~verzegnassi-stefano/ubuntu-docviewer-app/attempt-fix-zooming-1 as prerequisite branch.
Also, it seems there's a conflict with the translation template.

review: Needs Information
Revision history for this message
Michael Zanetti (mzanetti) wrote :

Hi Stefano.

No, I was asked by Alan to have a look at your branch and had to do those changes to make it work with Qt 5.5 and my High-resolution screen, otherwise it would end up in a loop requesting those images over and over again at startup.

While the root cause for that loop is a bug in Qt, fixing the layout usage is a good idea anyways. As I did those changes already I just pushed the branch so the fix isn't lost.

Revision history for this message
Stefano Verzegnassi (verzegnassi-stefano) wrote :

I had that doubt because the patch didn't seem to be related to the prerequisite branch. In this case it's OK for me.

Thank you again for giving a look at the branch. :D

review: Approve
Revision history for this message
David Planella (dpm) wrote :

Did this branch ever land?

It's marked as Approved instead of Merged, so it appears in the list of branches to review. If it landed, could it be marked as Merged, or alternatively as Rejected?

Thanks!

Revision history for this message
Stefano Verzegnassi (verzegnassi-stefano) wrote :

This branch has been proposed against a development branch that still requires some work.
Probably there are other QtQuick.Layouts in the app that may need the fix proposed here.

During the weekend I'll open a branch that refers to lp:ubuntu-docviewer-app and will include this MP.

Revision history for this message
Stefano Verzegnassi (verzegnassi-stefano) wrote :

Proposed for merging a new branch, depending on trunk and including the changes made by Michael Zanetti.
For this reason, I mark this MP as rejected.

Ref.
https://code.launchpad.net/~verzegnassi-stefano/ubuntu-docviewer-app/fix-layout-with-icons-2/+merge/263369

Unmerged revisions

99. By Michael Zanetti

fix layouts

98. By Stefano Verzegnassi

Attempt to fix bad zooming behaviour

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/app/qml/documentPage/DocumentGridDelegate.qml'
2--- src/app/qml/documentPage/DocumentGridDelegate.qml 2015-03-04 19:38:48 +0000
3+++ src/app/qml/documentPage/DocumentGridDelegate.qml 2015-03-25 11:45:29 +0000
4@@ -79,7 +79,8 @@
5 anchors.centerIn: parent
6 anchors.verticalCenterOffset: - infoColumn.height * 0.3
7
8- width: units.gu(8); height: width
9+ Layout.preferredWidth: units.gu(8);
10+ Layout.preferredHeight: width
11
12 // At the moment the suru icon theme doesn't have much icons.
13 // Just some note for the future:
14
15=== modified file 'src/app/qml/documentPage/DocumentListDelegate.qml'
16--- src/app/qml/documentPage/DocumentListDelegate.qml 2015-03-04 17:44:36 +0000
17+++ src/app/qml/documentPage/DocumentListDelegate.qml 2015-03-25 11:45:29 +0000
18@@ -59,8 +59,8 @@
19 spacing: units.gu(2)
20
21 Icon {
22- width: height
23- height: units.gu(5)
24+ Layout.preferredWidth: height
25+ Layout.preferredHeight: units.gu(5)
26
27 // At the moment the suru icon theme doesn't have much icons.
28 name: {

Subscribers

People subscribed via source and target branches