on xenial help sign in
Bring back UbuntuShapeForItem.qml
commitbff9fafe167c9354bff2e84fb233be7b3c95ea87 authorMichał Sawicz <michal.sawicz@canonical.com> dateFri 28 Jun 2013, 14:35 (13 years ago) parentdeb1f8d
2 files changed+58−23
Components/UbuntuShapeForItem.qml+46 Dash/Apps/RunningApplicationTile.qml+12−23
Components/UbuntuShapeForItem.qmlnew file+46
@@ -0,0 +1,46 @@
1+/*
2+ * Copyright (C) 2012 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.0
18+import Ubuntu.Components 0.1
19+
20+/* FIXME: This component is duplicating the UbuntuShape from the SDK, but shapes more
21+ * general (Item-based) components. This ability should be incorporated into the SDK's
22+ * UbuntuShape so this file can be removed.
23+ * Bug: https://bugs.launchpad.net/tavastia/+bug/1089595
24+ */
25+
26+
27+Item {
28+ id: root
29+
30+ property alias radius: shape.radius
31+ property alias image: source.sourceItem
32+
33+ ShaderEffectSource {
34+ id: source
35+ width: 1
36+ height: 1
37+ hideSource: true
38+ }
39+
40+ Shape {
41+ id: shape
42+ image: source
43+
44+ anchors.fill: parent
45+ }
46+}
Dash/Apps/RunningApplicationTile.qml+12−23
@@ -57,41 +57,30 @@ AbstractButton {
5757 applicationImage.updateFromCache();
5858 }
5959
60− // START-FIXME: should use UbuntuShape from SDK, when it can
61− // shape arbitrary items.
62−
63− ShaderEffectSource {
64− id: ses
65− sourceItem: ApplicationImage {
66− id: applicationImage
67− source: application
68− width: shapedApplicationImage.width
69− height: shapedApplicationImage.height
70− fillMode: ApplicationImage.PreserveAspectCrop
71− }
72−
73− width: 1
74− height: 1
75− hideSource: true
76− }
77−
78− Shape {
60+ // FIXME: should use UbuntuShape from SDK
61+ UbuntuShapeForItem {
7962 id: shapedApplicationImage
8063 anchors {
8164 top: parent.top
8265 horizontalCenter: parent.horizontalCenter
8366 }
8467
85− radius: "medium"
86− image: ses
87−
8868 // FIXME: width and height should be defined according to the
8969 // application window's aspect ratio.
9070 width: (application.stage === ApplicationInfo.MainStage && __sideStageEnabled) ?
9171 units.gu(22) : units.gu(11)
9272 height: (__sideStageEnabled) ? units.gu(22) : units.gu(19)
73+ radius: "medium"
74+ image: applicationImage
75+ }
76+
77+ ApplicationImage {
78+ id: applicationImage
79+ source: application
80+ width: shapedApplicationImage.width
81+ height: shapedApplicationImage.height
82+ fillMode: ApplicationImage.PreserveAspectCrop
9383 }
94− // END-FIXME
9584
9685 UbuntuShape {
9786 id: borderPressed