Merge lp:~unity-team/unity/phablet.more-flexible-previews into lp:unity/phablet

Proposed by Andrea Cimitan
Status: Merged
Approved by: Albert Astals Cid
Approved revision: no longer in the source branch.
Merged at revision: 494
Proposed branch: lp:~unity-team/unity/phablet.more-flexible-previews
Merge into: lp:unity/phablet
Diff against target: 72 lines (+8/-8)
3 files modified
Dash/DashPreview.qml (+4/-4)
Dash/People/PeoplePreview.qml (+3/-3)
Dash/Video/VideoPreview.qml (+1/-1)
To merge this branch: bzr merge lp:~unity-team/unity/phablet.more-flexible-previews
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Albert Astals Cid (community) Approve
Andrea Cimitan (community) Approve
Michael Zanetti (community) Approve
Review via email: mp+150860@code.launchpad.net

Commit message

make the previews more flexible with different screen sizes (by mzanetti)

Description of the change

make the previews more flexible with different screen sizes (by mzanetti)

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote :

yep. still my changes. ok with me of course.

review: Approve
Revision history for this message
Andrea Cimitan (cimi) :
review: Approve
Revision history for this message
Albert Astals Cid (aacid) wrote :

Is there a bug/design request for this?

review: Needs Information
Revision history for this message
MichaƂ Sawicz (saviq) wrote :

Yeah, this makes the previews behave better with GU=30

Revision history for this message
Albert Astals Cid (aacid) wrote :

Makes sense, tests are missing, but this is more a tweak than a new feature, so let's treat it like we are adding tests in separate steps like for the other components

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Dash/DashPreview.qml'
2--- Dash/DashPreview.qml 2013-02-16 02:18:58 +0000
3+++ Dash/DashPreview.qml 2013-02-27 17:28:22 +0000
4@@ -21,14 +21,14 @@
5 id: root
6 property string title: ""
7 property url url: ""
8- property int maxPreviewImageWidth: narrowMode ? width : width / 2
9+ property real previewWidthRatio: 0.5
10 property bool playable: false
11 property bool forceSquare: false
12 property Component buttons
13 property Component caption
14 property Component description
15
16- readonly property bool narrowMode: width <= units.gu(60)
17+ readonly property bool narrowMode: width <= height
18 readonly property int contentSpacing: units.gu(3)
19
20 signal close()
21@@ -128,7 +128,7 @@
22 id: leftFlickable
23 anchors.top: parent.top
24 anchors.bottom: parent.bottom
25- width: Math.min(contentRow.width, root.maxPreviewImageWidth)
26+ width: root.narrowMode ? contentRow.width : contentRow.width * root.previewWidthRatio
27 contentHeight: leftColumn.height
28 clip: true
29
30@@ -203,7 +203,7 @@
31 }
32
33 Loader {
34- parent: rightFlickable.width < units.gu(30) ? leftColumn : rightColumn
35+ parent: root.narrowMode ? leftColumn : rightColumn
36 anchors.left: parent.left
37 anchors.right: parent.right
38 sourceComponent: root.description
39
40=== modified file 'Dash/People/PeoplePreview.qml'
41--- Dash/People/PeoplePreview.qml 2013-02-26 13:51:48 +0000
42+++ Dash/People/PeoplePreview.qml 2013-02-27 17:28:22 +0000
43@@ -28,13 +28,13 @@
44
45 title: model ? model.displayName : ""
46 url: model ? model.avatar : ""
47- maxPreviewImageWidth: units.gu(42)
48+ previewWidthRatio: 0.34
49
50
51 description: Grid {
52 spacing: columns > 1 ? units.gu(2) : 0
53- columns: preview.narrowMode ? 1 : 2
54- property int columnWidth: (width - spacing * (columns - 1)) / columns
55+ columns: preview.narrowMode || width < units.gu(60) ? 1 : 2
56+ property int columnWidth: columns > 1 ? (width - spacing * (columns - 1)) / columns : width
57 anchors {
58 left: parent.left
59 right: parent.right
60
61=== modified file 'Dash/Video/VideoPreview.qml'
62--- Dash/Video/VideoPreview.qml 2013-02-26 13:51:48 +0000
63+++ Dash/Video/VideoPreview.qml 2013-02-27 17:28:22 +0000
64@@ -33,7 +33,7 @@
65
66 title: nfo.ready ? nfo.video.title : ""
67 url: item ? item.column_5.replace(/\.nfo$/, "-fanart.jpg") : ""
68- maxPreviewImageWidth: units.gu(74)
69+ previewWidthRatio: 0.6
70 playable: fileUri != ""
71
72 onPreviewImageClicked: {

Subscribers

People subscribed via source and target branches

to all changes: