on xenial help sign in
Add DashBackground
commit0ae6ba3877b98b98008ce393a017d671d8d827c1 authorAlbert Astals <albert.astals@canonical.com> dateFri 11 Jul 2014, 15:22 (12 years ago) parent369734f
5 files changed+33−22
qml/Dash/Dash.qml+2−5 qml/Dash/DashBackground.qml+24 qml/Dash/DashContent.qml+1−5 qml/Dash/ScopesOverview.qml+6−11 qml/Dash/ScopesOverviewAll.qml−1
qml/Dash/Dash.qml+2−5
@@ -154,12 +154,9 @@ Showable {
154154 }
155155 }
156156
157− Image {
157+ DashBackground
158+ {
158159 anchors.fill: scopeItem
159− source: parent.width > parent.height ? "graphics/paper_landscape.png" : "graphics/paper_portrait.png"
160− fillMode: Image.PreserveAspectCrop
161− horizontalAlignment: Image.AlignRight
162− verticalAlignment: Image.AlignTop
163160 }
164161
165162 GenericScopeView {
qml/Dash/DashBackground.qmlnew file+24
@@ -0,0 +1,24 @@
1+/*
2+ * Copyright (C) 2013, 2014 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+
19+Image {
20+ source: anchors.fill.width > anchors.fill.height ? "graphics/paper_landscape.png" : "graphics/paper_portrait.png"
21+ fillMode: Image.PreserveAspectCrop
22+ horizontalAlignment: Image.AlignRight
23+ verticalAlignment: Image.AlignTop
24+}
qml/Dash/DashContent.qml+1−5
@@ -85,12 +85,8 @@ Item {
8585
8686 anchors.fill: parent
8787
88− Image {
88+ DashBackground {
8989 anchors.fill: parent
90− source: parent.width > parent.height ? "graphics/paper_landscape.png" : "graphics/paper_portrait.png"
91− fillMode: Image.PreserveAspectCrop
92− horizontalAlignment: Image.AlignRight
93− verticalAlignment: Image.AlignTop
9490 }
9591
9692 ListView {
qml/Dash/ScopesOverview.qml+6−11
@@ -29,18 +29,13 @@ Item {
2929 signal favoriteSelected(int index)
3030 signal allSelected(var scope)
3131
32− Image {
32+ DashBackground {
3333 anchors.fill: parent
34− source: parent.width > parent.height ? "graphics/paper_landscape.png" : "graphics/paper_portrait.png"
35− fillMode: Image.PreserveAspectCrop
36− horizontalAlignment: Image.AlignRight
37− verticalAlignment: Image.AlignTop
38− }
39−
40− Rectangle {
41− color: "black"
42− anchors.fill: parent
43− opacity: 0.6
34+ Rectangle {
35+ color: "black"
36+ anchors.fill: parent
37+ opacity: 0.6
38+ }
4439 }
4540
4641 Item {
qml/Dash/ScopesOverviewAll.qml−1
@@ -38,7 +38,6 @@ Flickable {
3838 }
3939
4040 onClicked: {
41− console.log(model);
4241 root.clicked(index, result);
4342 }
4443 onPressAndHold: {