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
=== modified file 'Dash/DashPreview.qml'
--- Dash/DashPreview.qml 2013-02-16 02:18:58 +0000
+++ Dash/DashPreview.qml 2013-02-27 17:28:22 +0000
@@ -21,14 +21,14 @@
21 id: root21 id: root
22 property string title: ""22 property string title: ""
23 property url url: ""23 property url url: ""
24 property int maxPreviewImageWidth: narrowMode ? width : width / 224 property real previewWidthRatio: 0.5
25 property bool playable: false25 property bool playable: false
26 property bool forceSquare: false26 property bool forceSquare: false
27 property Component buttons27 property Component buttons
28 property Component caption28 property Component caption
29 property Component description29 property Component description
3030
31 readonly property bool narrowMode: width <= units.gu(60)31 readonly property bool narrowMode: width <= height
32 readonly property int contentSpacing: units.gu(3)32 readonly property int contentSpacing: units.gu(3)
3333
34 signal close()34 signal close()
@@ -128,7 +128,7 @@
128 id: leftFlickable128 id: leftFlickable
129 anchors.top: parent.top129 anchors.top: parent.top
130 anchors.bottom: parent.bottom130 anchors.bottom: parent.bottom
131 width: Math.min(contentRow.width, root.maxPreviewImageWidth)131 width: root.narrowMode ? contentRow.width : contentRow.width * root.previewWidthRatio
132 contentHeight: leftColumn.height132 contentHeight: leftColumn.height
133 clip: true133 clip: true
134134
@@ -203,7 +203,7 @@
203 }203 }
204204
205 Loader {205 Loader {
206 parent: rightFlickable.width < units.gu(30) ? leftColumn : rightColumn206 parent: root.narrowMode ? leftColumn : rightColumn
207 anchors.left: parent.left207 anchors.left: parent.left
208 anchors.right: parent.right208 anchors.right: parent.right
209 sourceComponent: root.description209 sourceComponent: root.description
210210
=== modified file 'Dash/People/PeoplePreview.qml'
--- Dash/People/PeoplePreview.qml 2013-02-26 13:51:48 +0000
+++ Dash/People/PeoplePreview.qml 2013-02-27 17:28:22 +0000
@@ -28,13 +28,13 @@
2828
29 title: model ? model.displayName : ""29 title: model ? model.displayName : ""
30 url: model ? model.avatar : ""30 url: model ? model.avatar : ""
31 maxPreviewImageWidth: units.gu(42)31 previewWidthRatio: 0.34
3232
3333
34 description: Grid {34 description: Grid {
35 spacing: columns > 1 ? units.gu(2) : 035 spacing: columns > 1 ? units.gu(2) : 0
36 columns: preview.narrowMode ? 1 : 236 columns: preview.narrowMode || width < units.gu(60) ? 1 : 2
37 property int columnWidth: (width - spacing * (columns - 1)) / columns37 property int columnWidth: columns > 1 ? (width - spacing * (columns - 1)) / columns : width
38 anchors {38 anchors {
39 left: parent.left39 left: parent.left
40 right: parent.right40 right: parent.right
4141
=== modified file 'Dash/Video/VideoPreview.qml'
--- Dash/Video/VideoPreview.qml 2013-02-26 13:51:48 +0000
+++ Dash/Video/VideoPreview.qml 2013-02-27 17:28:22 +0000
@@ -33,7 +33,7 @@
3333
34 title: nfo.ready ? nfo.video.title : ""34 title: nfo.ready ? nfo.video.title : ""
35 url: item ? item.column_5.replace(/\.nfo$/, "-fanart.jpg") : ""35 url: item ? item.column_5.replace(/\.nfo$/, "-fanart.jpg") : ""
36 maxPreviewImageWidth: units.gu(74)36 previewWidthRatio: 0.6
37 playable: fileUri != ""37 playable: fileUri != ""
3838
39 onPreviewImageClicked: {39 onPreviewImageClicked: {

Subscribers

People subscribed via source and target branches

to all changes: