on xenial help sign in
Move Title under Icon.
4c43d6eYing-Chun Liu
Dash/Apps/AppPreview.qml+18−2
@@ -26,8 +26,6 @@ DashPreview {
26
26
27 signal sendUserReview(string review)
27 signal sendUserReview(string review)
28
28
29− title: root.previewData.title
30−
31 header: ListView {
29 header: ListView {
32 spacing: units.gu(1)
30 spacing: units.gu(1)
33 orientation: ListView.Horizontal
31 orientation: ListView.Horizontal
@@ -57,6 +55,24 @@ DashPreview {
57 }
55 }
58 }
56 }
59
57
58+ title: Label {
59+ id: title
60+ objectName: "titleLabel"
61+ anchors {
62+ left: parent.left
63+ right: parent.right
64+ }
65+
66+ elide: Text.ElideRight
67+ fontSize: "x-large"
68+ font.weight: Font.Light
69+ color: Theme.palette.selected.backgroundText
70+ opacity: 0.9
71+ text: root.previewData.title
72+ style: Text.Raised
73+ styleColor: "black"
74+ }
75+
60 Component {
76 Component {
61 id: buttonsComponent
77 id: buttonsComponent
62
78
Dash/DashPreview.qml+28−59
@@ -23,10 +23,10 @@ Rectangle {
23 property int keyboardSize: Qt.inputMethod.visible ? Qt.inputMethod.keyboardRectangle.height : 0
23 property int keyboardSize: Qt.inputMethod.visible ? Qt.inputMethod.keyboardRectangle.height : 0
24 property var previewData
24 property var previewData
25
25
26− property string title: ""
27 property real previewWidthRatio: 0.5
26 property real previewWidthRatio: 0.5
28
27
29 property Component header
28 property Component header
29+ property Component title
30 property Component buttons
30 property Component buttons
31 property Component body
31 property Component body
32
32
@@ -62,64 +62,39 @@ Rectangle {
62 }
62 }
63
63
64 Item {
64 Item {
65− id: headerRow
65+ id: headerIcon
66− height: units.gu(4)
67 anchors {
66 anchors {
68− top: parent.top
69 left: parent.left
67 left: parent.left
70 right: parent.right
68 right: parent.right
69+ top: parent.top
70+ leftMargin: root.contentSpacing
71+ topMargin: root.contentSpacing
71− margins: root.contentSpacing
72+ rightMargin: root.contentSpacing
72 }
73 }
73−
74+ height: childrenRect.height
74− MouseArea {
75+ Loader {
75− anchors {
76+ id: headerLoader
76− fill: parent
77+ anchors.left: parent.left
77− leftMargin: -root.contentSpacing
78+ anchors.right: parent.right
78− rightMargin: -root.contentSpacing
79+ sourceComponent: root.header
79− topMargin: -root.contentSpacing
80− }
81−
82− onClicked: root.close();
83 }
80 }
81+ }
84
82
85− Item {
83+ Item {
86− id: labelItem
84+ id: headerRow
85+ height: childrenRect.height
87− anchors {
86+ anchors {
87+ top: headerIcon.bottom
88+ left: parent.left
88− fill: parent
89+ right: parent.right
89− rightMargin: closePreviewImage.width + spacing
90+ leftMargin: root.contentSpacing
91+ rightMargin: root.contentSpacing
90− }
92+ }
91−
93+ Loader {
92− property int spacing: units.gu(2)
94+ id: titleLoader
93−
94− Label {
95− id: title
96− objectName: "titleLabel"
97− anchors {
98− left: parent.left
95+ anchors.left: parent.left
99− right: parent.right
96+ anchors.right: parent.right
100− }
101−
102− elide: Text.ElideRight
103− fontSize: "x-large"
104− font.weight: Font.Light
105− color: Theme.palette.selected.backgroundText
106− opacity: 0.9
107− text: root.title
97+ sourceComponent: root.title
108− style: Text.Raised
109− styleColor: "black"
110− }
111− Image {
112− id: closePreviewImage
113− source: "graphics/tablet/icon_close_preview.png"
114− width: units.gu(4)
115− height: units.gu(1.5)
116− anchors {
117− bottom: title.bottom
118− bottomMargin: units.dp(7)
119− left: parent.left
120− leftMargin: title.paintedWidth + labelItem.spacing
121− }
122− }
123 }
98 }
124 }
99 }
125
100
@@ -157,12 +132,6 @@ Rectangle {
157 height: childrenRect.height
132 height: childrenRect.height
158 spacing: units.gu(1)
133 spacing: units.gu(1)
159
134
160− Loader {
161− id: headerLoader
162− anchors.left: parent.left
163− anchors.right: parent.right
164− sourceComponent: root.header
165− }
166 Loader {
135 Loader {
167 id: buttonLoader
136 id: buttonLoader
168 anchors.left: parent.left
137 anchors.left: parent.left
Dash/Generic/GenericPreview.qml+23−1
@@ -23,7 +23,6 @@ import ".."
23DashPreview {
23DashPreview {
24 id: genericPreview
24 id: genericPreview
25
25
26− title: previewData.title
27 previewWidthRatio: 0.6
26 previewWidthRatio: 0.6
28
27
29 property url url: previewData.image
28 property url url: previewData.image
@@ -42,6 +41,28 @@ DashPreview {
42 }
41 }
43 }
42 }
44
43
44+ title: Label {
45+ id: title
46+ objectName: "titleLabel"
47+ anchors {
48+ top: parent.top
49+ topMargin: units.gu(2)
50+ left: parent.left
51+ right: parent.right
52+ }
53+
54+ elide: Text.ElideRight
55+ fontSize: "x-large"
56+ font.weight: Font.Light
57+ color: Theme.palette.selected.backgroundText
58+ opacity: 0.9
59+ text: previewData.title
60+ style: Text.Raised
61+ styleColor: "black"
62+ maximumLineCount: 2
63+ wrapMode: Text.WordWrap
64+ }
65+
45 buttons: GridView {
66 buttons: GridView {
46 id: buttons
67 id: buttons
47 model: genericPreview.previewData.actions
68 model: genericPreview.previewData.actions
@@ -69,6 +90,7 @@ DashPreview {
69 }
90 }
70 focus: false
91 focus: false
71 }
92 }
93+
72 body: Column {
94 body: Column {
73 spacing: units.gu(2)
95 spacing: units.gu(2)
74
96
Dash/Video/VideoPreview.qml+18−1
@@ -33,7 +33,6 @@ DashPreview {
33 source: item ? item.nfoUri : ""
33 source: item ? item.nfoUri : ""
34 }
34 }
35
35
36− title: nfo.ready ? nfo.video.title : ""
37 previewWidthRatio: 0.6
36 previewWidthRatio: 0.6
38
37
39 onPreviewImageClicked: {
38 onPreviewImageClicked: {
@@ -74,6 +73,24 @@ DashPreview {
74 }
73 }
75 }
74 }
76
75
76+ title: Label {
77+ id: title
78+ objectName: "titleLabel"
79+ anchors {
80+ left: parent.left
81+ right: parent.right
82+ }
83+
84+ elide: Text.ElideRight
85+ fontSize: "x-large"
86+ font.weight: Font.Light
87+ color: Theme.palette.selected.backgroundText
88+ opacity: 0.9
89+ text: nfo.ready ? nfo.video.title : ""
90+ style: Text.Raised
91+ styleColor: "black"
92+ }
93+
77 buttons: Row {
94 buttons: Row {
78 spacing: units.gu(2)
95 spacing: units.gu(2)
79
96