on xenial help sign in
add subtitle support
e07f589Albert Astals
qml/Dash/ScopesListCategory.qml+1
@@ -75,6 +75,7 @@ Item {
75
75
76 icon: model.art || ""
76 icon: model.art || ""
77 text: model.title || ""
77 text: model.title || ""
78+ subtext: model.subtitle || ""
78 showStar: model.scopeId != "clickscope" && (root.isFavoritesFeed || root.isOtherFeed)
79 showStar: model.scopeId != "clickscope" && (root.isFavoritesFeed || root.isOtherFeed)
79 isFavorite: root.isFavoritesFeed
80 isFavorite: root.isFavoritesFeed
80
81
qml/Dash/ScopesListCategoryItem.qml+21−7
@@ -14,7 +14,8 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
15 */
16
16
17−import QtQuick 2.0
17+import QtQuick 2.3
18+import QtQuick.Layouts 1.1
18import Ubuntu.Components 1.1
19import Ubuntu.Components 1.1
19
20
20MouseArea {
21MouseArea {
@@ -22,6 +23,7 @@ MouseArea {
22
23
23 property alias icon: shapeImage.source
24 property alias icon: shapeImage.source
24 property alias text: titleLabel.text
25 property alias text: titleLabel.text
26+ property alias subtext: subtitleLabel.text
25 property alias showStar: star.visible
27 property alias showStar: star.visible
26
28
27 property bool isFavorite: false
29 property bool isFavorite: false
@@ -41,8 +43,8 @@ MouseArea {
41 fillMode: Image.PreserveAspectCrop
43 fillMode: Image.PreserveAspectCrop
42 }
44 }
43 }
45 }
44− Label {
46+
45− id: titleLabel
47+ ColumnLayout {
46 anchors {
48 anchors {
47 left: shape.right
49 left: shape.right
48 leftMargin: units.gu(1)
50 leftMargin: units.gu(1)
@@ -50,10 +52,22 @@ MouseArea {
50 rightMargin: units.gu(1)
52 rightMargin: units.gu(1)
51 verticalCenter: parent.verticalCenter
53 verticalCenter: parent.verticalCenter
52 }
54 }
55+ Label {
56+ id: titleLabel
53− elide: Text.ElideRight
57+ elide: Text.ElideRight
54− wrapMode: Text.Wrap
58+ wrapMode: Text.Wrap
55− maximumLineCount: 1
59+ maximumLineCount: 1
60+ verticalAlignment: Text.AlignHCenter
61+ }
62+ Label {
63+ id: subtitleLabel
64+ elide: Text.ElideRight
65+ fontSize: "xx-small"
66+ wrapMode: Text.Wrap
67+ maximumLineCount: 1
56− verticalAlignment: Text.AlignHCenter
68+ verticalAlignment: Text.AlignHCenter
69+ visible: text != ""
70+ }
57 }
71 }
58 MouseArea {
72 MouseArea {
59 id: starArea
73 id: starArea
tests/mocks/Unity/fake_scopesoverview.cpp+2
@@ -304,6 +304,8 @@ QVariant ScopesOverviewResultsModel::data(const QModelIndex& index, int role) co
304 return scope ? scope->id() : QString("Result.%1.%2").arg(categoryId()).arg(index.row());
304 return scope ? scope->id() : QString("Result.%1.%2").arg(categoryId()).arg(index.row());
305 case RoleTitle:
305 case RoleTitle:
306 return scope ? scope->name() : QString("Title.%1.%2").arg(categoryId()).arg(index.row());
306 return scope ? scope->name() : QString("Title.%1.%2").arg(categoryId()).arg(index.row());
307+ case RoleSubtitle:
308+ return scope && scope->name() == "Videos" ? "tube, movies, cinema" : QString();
307 case RoleArt:
309 case RoleArt:
308 return qmlDirectory() + "graphics/applicationIcons/dash.png";
310 return qmlDirectory() + "graphics/applicationIcons/dash.png";
309 case RoleMascot:
311 case RoleMascot: