=== modified file 'Components/Tile.qml'
--- Components/Tile.qml 2013-08-05 15:02:05 +0000
+++ Components/Tile.qml 2013-10-03 19:16:07 +0000
@@ -18,70 +18,14 @@
import Ubuntu.Components 0.1
AbstractButton {
- id: root
- property alias source: image.source
- property alias fillMode: image.fillMode
- property alias horizontalAlignment: image.horizontalAlignment
- property alias verticalAlignment: image.verticalAlignment
- property alias text: label.text
+ property url source
+ property int fillMode: Image.PreserveAspectCrop
+ property int horizontalAlignment: Image.AlignHCenter
+ property int verticalAlignment: Image.AlignVCenter
+ property string text
property int imageWidth
property int imageHeight
-
- UbuntuShape {
- id: icon
- anchors {
- top: parent.top
- horizontalCenter: parent.horizontalCenter
- }
- radius: "medium"
- width: imageWidth
- height: imageHeight
- image: Image {
- id: image
- objectName: "image"
- sourceSize { width: icon.width; height: icon.height }
- asynchronous: true
- cache: false
- }
- }
-
- UbuntuShape {
- id: borderPressed
- objectName: "borderPressed"
-
- anchors.fill: icon
- radius: "medium"
- borderSource: "radius_pressed.sci"
- opacity: root.pressed ? 1.0 : 0.0
- Behavior on opacity { NumberAnimation { duration: 200; easing.type: Easing.OutQuint } }
- }
-
- Item {
- anchors {
- left: parent.left
- right: parent.right
- top: icon.bottom
- }
- height: units.gu(2)
-
- Label {
- id: label
- objectName: "label"
- anchors {
- baseline: parent.bottom
- left: parent.left
- right: parent.right
- leftMargin: units.gu(1)
- rightMargin: units.gu(1)
- }
-
- color: Theme.palette.selected.backgroundText
- opacity: 0.9
- style: Text.Raised
- styleColor: "black"
- fontSize: "small"
- elide: Text.ElideMiddle
- horizontalAlignment: Text.AlignHCenter
- }
- }
+ property int maximumLineCount: 1
+
+ style: TileStyle {}
}
=== added file 'Components/TileStyle.qml'
--- Components/TileStyle.qml 1970-01-01 00:00:00 +0000
+++ Components/TileStyle.qml 2013-10-03 19:16:07 +0000
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 2013 Canonical, Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+import QtQuick 2.0
+import Ubuntu.Components 0.1
+
+Item {
+ id: tile
+
+ anchors.fill: parent
+
+ UbuntuShape {
+ id: icon
+ anchors {
+ top: parent.top
+ horizontalCenter: parent.horizontalCenter
+ }
+ radius: "medium"
+ width: styledItem.imageWidth
+ height: styledItem.imageHeight
+ image: Image {
+ id: image
+ objectName: "image"
+ sourceSize { width: icon.width; height: icon.height }
+ asynchronous: true
+ cache: false
+ source: styledItem.source
+ fillMode: styledItem.fillMode
+ horizontalAlignment: styledItem.horizontalAlignment
+ verticalAlignment: styledItem.verticalAlignment
+ }
+ }
+
+ UbuntuShape {
+ id: borderPressed
+ objectName: "borderPressed"
+
+ anchors.fill: icon
+ radius: "medium"
+ borderSource: "radius_pressed.sci"
+ opacity: styledItem.pressed ? 1.0 : 0.0
+ Behavior on opacity { NumberAnimation { duration: 200; easing.type: Easing.OutQuint } }
+ }
+
+ Label {
+ id: label
+ objectName: "label"
+ anchors {
+ baseline: icon.bottom
+ baselineOffset: units.gu(2)
+ left: parent.left
+ right: parent.right
+ leftMargin: units.gu(1)
+ rightMargin: units.gu(1)
+ }
+
+ color: Theme.palette.selected.backgroundText
+ opacity: 0.9
+ style: Text.Raised
+ styleColor: "black"
+ fontSize: "small"
+ elide: Text.ElideMiddle
+ horizontalAlignment: Text.AlignHCenter
+ text: styledItem.text
+ maximumLineCount: styledItem.maximumLineCount
+ }
+}
=== added file 'Dash/Apps/DashPluginFilterGrid.qml'
--- Dash/Apps/DashPluginFilterGrid.qml 1970-01-01 00:00:00 +0000
+++ Dash/Apps/DashPluginFilterGrid.qml 2013-10-03 19:16:07 +0000
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2013 Canonical, Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+import QtQuick 2.0
+import Ubuntu.Components 0.1
+import "../../Components"
+import "../Generic"
+
+GenericFilterGrid {
+ id: filtergrid
+
+ delegate: Tile {
+ id: tile
+ objectName: "delegate" + index
+ width: filtergrid.cellWidth
+ height: filtergrid.cellHeight
+ text: model.title
+ imageWidth: filtergrid.iconWidth
+ imageHeight: filtergrid.iconHeight
+ source: model.icon
+
+ style: FlatTileStyle {
+ disabled: model.rendererHints['scope_disabled'] === 1;
+ }
+
+ onClicked: {
+ var data = { model: model }
+ filtergrid.clicked(index, data, tile.y)
+ }
+
+ onPressAndHold: {
+ var data = { model: model }
+ filtergrid.pressAndHold(index, data, tile.y)
+ }
+ }
+}
=== added file 'Dash/Generic/FlatTileStyle.qml'
--- Dash/Generic/FlatTileStyle.qml 1970-01-01 00:00:00 +0000
+++ Dash/Generic/FlatTileStyle.qml 2013-10-03 19:16:07 +0000
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2013 Canonical, Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+import QtQuick 2.0
+import Ubuntu.Components 0.1
+
+Item {
+ id: tile
+
+ property bool disabled: false
+
+ anchors.fill: parent
+
+ Image {
+ id: icon
+ objectName: "image"
+ width: styledItem.imageWidth
+ height: styledItem.imageHeight
+
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ sourceSize { width: width; height: height }
+ asynchronous: true
+ cache: false
+ source: styledItem.source
+ fillMode: styledItem.fillMode
+ opacity: tile.disabled ? 0.3 : 1.0
+ horizontalAlignment: styledItem.horizontalAlignment
+ verticalAlignment: styledItem.verticalAlignment
+ }
+
+ UbuntuShape {
+ id: borderPressed
+ objectName: "borderPressed"
+
+ anchors.fill: icon
+ radius: "medium"
+ borderSource: "radius_pressed.sci"
+ opacity: styledItem.pressed ? 1.0 : 0.0
+ Behavior on opacity { NumberAnimation { duration: 200; easing.type: Easing.OutQuint } }
+ }
+
+ Label {
+ id: label
+ objectName: "label"
+ anchors {
+ baseline: icon.bottom
+ baselineOffset: units.gu(2)
+ left: parent.left
+ right: parent.right
+ leftMargin: units.gu(1)
+ rightMargin: units.gu(1)
+ }
+
+ color: Theme.palette.selected.backgroundText
+ opacity: 0.9
+ style: Text.Raised
+ styleColor: "black"
+ fontSize: "small"
+ elide: Text.ElideMiddle
+ horizontalAlignment: Text.AlignHCenter
+ text: styledItem.text
+ maximumLineCount: styledItem.maximumLineCount
+ }
+}
=== modified file 'Dash/Generic/GenericFilterGrid.qml'
--- Dash/Generic/GenericFilterGrid.qml 2013-09-05 10:02:00 +0000
+++ Dash/Generic/GenericFilterGrid.qml 2013-10-03 19:16:07 +0000
@@ -39,11 +39,8 @@
text: model.title
imageWidth: filtergrid.iconWidth
imageHeight: filtergrid.iconHeight
-
source: model.icon
- fillMode: Image.PreserveAspectCrop
-
onClicked: {
var data = { model: model }
filtergrid.clicked(index, data, tile.y)
=== added file 'Dash/Generic/WeatherFilterGrid.qml'
--- Dash/Generic/WeatherFilterGrid.qml 1970-01-01 00:00:00 +0000
+++ Dash/Generic/WeatherFilterGrid.qml 2013-10-03 19:16:07 +0000
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2013 Canonical, Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+import QtQuick 2.0
+import Ubuntu.Components 0.1
+import "../../Components"
+
+GenericFilterGrid {
+ id: filtergrid
+
+ delegateHeight: units.gu(11.5)
+
+ delegate: Tile {
+ id: tile
+ objectName: "delegate" + index
+ width: filtergrid.cellWidth
+ height: filtergrid.cellHeight
+ text: model.title
+ imageWidth: filtergrid.iconWidth
+ imageHeight: filtergrid.iconHeight
+ source: model.icon
+ maximumLineCount: 2
+
+ style: FlatTileStyle {}
+
+ onClicked: {
+ var data = { model: model }
+ filtergrid.clicked(index, data, tile.y)
+ }
+
+ onPressAndHold: {
+ var data = { model: model }
+ filtergrid.pressAndHold(index, data, tile.y)
+ }
+ }
+}
=== modified file 'Dash/GenericScopeView.qml'
--- Dash/GenericScopeView.qml 2013-10-03 19:16:06 +0000
+++ Dash/GenericScopeView.qml 2013-10-03 19:16:07 +0000
@@ -209,6 +209,13 @@
switch (contentType) {
case "video": return "Generic/GenericFilterGridPotrait.qml";
case "music": return "Music/MusicFilterGrid.qml";
+ case "apps": {
+ if (rendererHint == "toggled")
+ return "Apps/DashPluginFilterGrid.qml";
+ else
+ return "Generic/GenericFilterGrid.qml";
+ }
+ case "weather": return "Generic/WeatherFilterGrid.qml";
default: return "Generic/GenericFilterGrid.qml";
}
}