Merge lp:~tpeeters/ubuntu-ui-toolkit/headerFlickableDocs into lp:ubuntu-ui-toolkit/staging

Proposed by Tim Peeters
Status: Merged
Approved by: Tim Peeters
Approved revision: 1838
Merged at revision: 1853
Proposed branch: lp:~tpeeters/ubuntu-ui-toolkit/headerFlickableDocs
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 675 lines (+191/-210)
7 files modified
src/Ubuntu/Components/1.3/AdaptivePageLayout.qml (+76/-53)
src/Ubuntu/Components/1.3/MainView.qml (+23/-33)
src/Ubuntu/Components/1.3/Page.qml (+76/-95)
src/Ubuntu/Components/1.3/PageHeader.qml (+3/-0)
src/Ubuntu/Components/Themes/Ambiance/1.3/MainViewStyle.qml (+2/-0)
src/Ubuntu/Components/plugin/ucheader.cpp (+1/-5)
src/Ubuntu/Components/plugin/ucmainviewbase.cpp (+10/-24)
To merge this branch: bzr merge lp:~tpeeters/ubuntu-ui-toolkit/headerFlickableDocs
Reviewer Review Type Date Requested Status
ubuntu-sdk-build-bot continuous-integration Approve
Zsombor Egri Approve
Review via email: mp+284741@code.launchpad.net

Commit message

Update documentation for MainView, Page, AdaptivePageLayout to use the new PageHeader in all examples. Deprecate old properties.

To post a comment you must log in.
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Zsombor Egri (zsombi) wrote :

Some deprecated warnings should be shown.

review: Needs Fixing
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Zsombor Egri (zsombi) wrote :

Ok, looks much better now :)

review: Approve
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Ubuntu/Components/1.3/AdaptivePageLayout.qml'
2--- src/Ubuntu/Components/1.3/AdaptivePageLayout.qml 2016-02-11 17:19:48 +0000
3+++ src/Ubuntu/Components/1.3/AdaptivePageLayout.qml 2016-02-15 14:22:54 +0000
4@@ -61,8 +61,12 @@
5 primaryPage: page1
6 Page {
7 id: page1
8- title: "Main page"
9+ header: PageHeader {
10+ id: header
11+ title: "Main Page"
12+ }
13 Column {
14+ anchors.top: header.bottom
15 Button {
16 text: "Add Page2 above " + page1.title
17 onClicked: page1.pageStack.addPageToCurrentColumn(page1, page2)
18@@ -75,11 +79,15 @@
19 }
20 Page {
21 id: page2
22- title: "Page #2"
23+ header: PageHeader {
24+ title: "Page #2"
25+ }
26 }
27 Page {
28 id: page3
29- title: "Page #3"
30+ header: PageHeader {
31+ title: "Page #3"
32+ }
33 }
34 }
35 }
36@@ -133,8 +141,12 @@
37 id: page1Component
38 Page {
39 id: page1
40- title: "Main page"
41+ header: PageHeader {
42+ id: header
43+ title: "Main page"
44+ }
45 Column {
46+ anchors.top: header.bottom
47 Button {
48 text: "Add Page2 above " + page1.title
49 onClicked: page1.pageStack.addPageToCurrentColumn(page1, page2)
50@@ -148,11 +160,15 @@
51 }
52 Page {
53 id: page2
54- title: "Page #2"
55+ header: PageHeader {
56+ title: "Page #2"
57+ }
58 }
59 Page {
60 id: page3
61- title: "Page #3"
62+ header: PageHeader {
63+ title: "Page #3"
64+ }
65 }
66 }
67 }
68@@ -237,53 +253,60 @@
69 page opened in the second column is closed. Note, the example must be run
70 on desktop or on a device with at least 90 grid units screen width.
71 \qml
72- import QtQuick 2.4
73- import Ubuntu.Components 1.3
74-
75- MainView {
76- width: units.gu(90)
77- height: units.gu(70)
78-
79- Component {
80- id: page2Component
81- Page {
82- title: "Second Page"
83- Button {
84- text: "Close me"
85- onClicked: pageStack.removePages(pageStack.primaryPage);
86- }
87- }
88- }
89-
90- AdaptivePageLayout {
91- id: pageLayout
92- anchors.fill: parent
93- primaryPage: Page {
94- title: "Primary Page"
95- ListView {
96- id: listView
97- anchors.fill: parent
98- model: 10
99- delegate: ListItem {
100- Label { text: modelData }
101- onClicked: {
102- var incubator = pageLayout.addPageToNextColumn(pageLayout.primaryPage, page2Component);
103- if (incubator && incubator.status == Component.Loading) {
104- incubator.onStatusChanged = function(status) {
105- if (status == Component.Ready) {
106- // connect page's destruction to decrement model
107- incubator.object.Component.destruction.connect(function() {
108- listView.model--;
109- });
110- }
111- }
112- }
113- }
114- }
115- }
116- }
117- }
118- }
119+ import QtQuick 2.4
120+ import Ubuntu.Components 1.3
121+
122+ MainView {
123+ width: units.gu(90)
124+ height: units.gu(70)
125+
126+ Component {
127+ id: page2Component
128+ Page {
129+ header: PageHeader {
130+ id: header
131+ title: "Second Page"
132+ }
133+ Button {
134+ anchors.top: header.bottom
135+ text: "Close me"
136+ onClicked: pageStack.removePages(pageStack.primaryPage);
137+ }
138+ }
139+ }
140+
141+ AdaptivePageLayout {
142+ id: pageLayout
143+ anchors.fill: parent
144+ primaryPage: Page {
145+ header: PageHeader {
146+ title: "Primary Page"
147+ flickable: listView
148+ }
149+ ListView {
150+ id: listView
151+ anchors.fill: parent
152+ model: 10
153+ delegate: ListItem {
154+ Label { text: modelData }
155+ onClicked: {
156+ var incubator = pageLayout.addPageToNextColumn(pageLayout.primaryPage, page2Component);
157+ if (incubator && incubator.status == Component.Loading) {
158+ incubator.onStatusChanged = function(status) {
159+ if (status == Component.Ready) {
160+ // connect page's destruction to decrement model
161+ incubator.object.Component.destruction.connect(function() {
162+ listView.model--;
163+ });
164+ }
165+ }
166+ }
167+ }
168+ }
169+ }
170+ }
171+ }
172+ }
173 \endqml
174
175 \sa {http://doc.qt.io/qt-5/qml-qtqml-component.html#incubateObject-method}{Component.incubateObject}
176
177=== modified file 'src/Ubuntu/Components/1.3/MainView.qml'
178--- src/Ubuntu/Components/1.3/MainView.qml 2016-01-22 13:13:28 +0000
179+++ src/Ubuntu/Components/1.3/MainView.qml 2016-02-15 14:22:54 +0000
180@@ -25,8 +25,6 @@
181 \ingroup ubuntu
182 \inherits StyledItem
183 \brief MainView is the root Item that should be used for all applications.
184- It automatically adds a header and toolbar for its contents and can
185- rotate its content based on the device orientation.
186
187 The simplest way to use a MainView is to include a single \l Page object
188 inside the MainView:
189@@ -39,27 +37,30 @@
190 height: units.gu(60)
191
192 Page {
193- title: "Simple page"
194+ header: PageHeader {
195+ id: pageHeader
196+ title: "Simple page"
197+ }
198 Button {
199- anchors.centerIn: parent
200+ anchors {
201+ horizontalCenter: parent.horizontalCenter
202+ top: pageHeader.bottom
203+ topMargin: units.gu(5)
204+ }
205+ width: units.gu(15)
206 text: "Push me"
207- width: units.gu(15)
208 onClicked: print("Click!")
209 }
210 }
211 }
212 \endqml
213 It is not required to set the anchors of the \l Page as it will automatically fill its parent.
214- The MainView has a header that automatically shows the title of the \l Page.
215-
216- Do not include multiple Pages directly inside the MainView, but use \l Tabs
217- or \l PageStack inside MainView to navigate between several Pages.
218-
219- For the MainView to automatically rotate its content following the orientation
220- of the device, set the \l automaticOrientation property to true.
221-
222- If the \l Page inside the MainView includes a Flickable with enough contents for scrolling,
223- the header will automatically hide and show when the user scrolls up or down:
224+
225+ Do not include multiple Pages directly inside the MainView, but use \l AdaptivePageLayout
226+ inside MainView to navigate between several Pages.
227+
228+ If the \l Page inside the MainView includes a Flickable, set the flickable property of
229+ the PageHeader to automatically hide and show the header when the user scrolls up or down:
230 \qml
231 import QtQuick 2.4
232 import Ubuntu.Components 1.3
233@@ -69,9 +70,13 @@
234 height: units.gu(60)
235
236 Page {
237- title: "Page with Flickable"
238+ header: PageHeader {
239+ title: "Page with Flickable"
240+ flickable: myFlickable
241+ }
242
243 Flickable {
244+ id: myFlickable
245 anchors.fill: parent
246 contentHeight: column.height
247
248@@ -92,20 +97,12 @@
249 example.
250
251 The examples above show how to include a single \l Page inside a MainView, but more
252- advanced application structures are possible using \l PageStack and \l Tabs.
253+ advanced application structures are possible using \l AdaptivePageLayout.
254 */
255 Toolkit.MainViewBase {
256 id: mainView
257
258- /*!
259- \qmlproperty bool MainView::automaticOrientation
260- \deprecated
261-
262- Sets whether the application will be automatically rotating when the
263- device is.
264-
265- This property has no significance anymore as the shell rotates.
266- */
267+ /*! \deprecated */
268 property bool automaticOrientation: false
269
270 /*!
271@@ -235,13 +232,6 @@
272 Used by PageStack. This property only exists in MainView 1.2 and later.
273 */
274 readonly property bool animateHeader: false
275-
276- // FIXME: Currently disabled to prevent bug 1461729
277-// readonly property bool animateHeader: headerItem.__styleInstance &&
278-// headerItem.__styleInstance.hasOwnProperty("animateIn") &&
279-// headerItem.__styleInstance.hasOwnProperty("animateOut") &&
280-// headerItem.__styleInstance.hasOwnProperty("animateInFinished") &&
281-// headerItem.__styleInstance.hasOwnProperty("animateOutFinished")
282 }
283
284 backgroundColor: theme.palette.normal.background
285
286=== modified file 'src/Ubuntu/Components/1.3/Page.qml'
287--- src/Ubuntu/Components/1.3/Page.qml 2015-12-22 09:26:26 +0000
288+++ src/Ubuntu/Components/1.3/Page.qml 2016-02-15 14:22:54 +0000
289@@ -20,55 +20,55 @@
290
291 /*!
292 \qmltype Page
293- \inqmlmodule Ubuntu.Components 1.1
294+ \inqmlmodule Ubuntu.Components 1.3
295 \inherits StyledItem
296 \ingroup ubuntu
297- \brief A page is the basic Item that must be used inside the \l MainView,
298- \l PageStack and \l Tabs.
299+ \brief A page is the basic Item that represents a single view in
300+ an Ubuntu application. It is recommended to use the Page inside
301+ the \l MainView or \l AdaptivePageLayout.
302+
303+ \l MainView provides a header for Pages it includes if no
304+ \l header property was set. However, the application header is deprecated
305+ and it is recommended to set the \l header property instead.
306+
307 Anchors and height of a Page are automatically determined to align with
308 the header of the \l MainView, but can be overridden.
309-
310-
311- \l MainView provides a header for Pages it includes if no
312- \l header property was set.
313- The text and actions of the header are determined by the \l title
314- and \l head properties of the page:
315-
316- \qml
317- import QtQuick 2.4
318- import Ubuntu.Components 1.2
319-
320- MainView {
321- width: units.gu(48)
322- height: units.gu(60)
323-
324- Page {
325- title: i18n.tr("Example page")
326-
327- Label {
328- anchors.centerIn: parent
329- text: i18n.tr("Hello world!")
330+ Page contents does not automatically leave space for the Page \l header,
331+ so this must be taken into account when anchoring the contents of the Page.
332+
333+ Example:
334+ \qml
335+ import QtQuick 2.4
336+ import Ubuntu.Components 1.3
337+
338+ MainView {
339+ width: units.gu(48)
340+ height: units.gu(60)
341+
342+ Page {
343+ header: PageHeader {
344+ id: pageHeader
345+ title: i18n.tr("Example page")
346+
347+ trailingActionBar.actions: [
348+ Action {
349+ iconName: "search"
350+ text: i18n.tr("Search")
351+ }
352+ ]
353+ }
354+
355+ Label {
356+ anchors {
357+ horizontalCenter: parent.horizontalCenter
358+ top: pageHeader.bottom
359+ topMargin: units.gu(5)
360+ }
361+ text: i18n.tr("Hello world!")
362+ }
363 }
364-
365- head.actions: [
366- Action {
367- iconName: "search"
368- text: i18n.tr("Search")
369- },
370- Action {
371- iconName: "contacts"
372- text: i18n.tr("Contacts")
373- }
374- ]
375 }
376- }
377- \endqml
378-
379- The Page automatically anchors to the left and bottom of its parent. The width of the Page
380- will be the full width of its parent \l MainView or \l PageStack or \l Tab,
381- and the height will adapt to leave space for the header when needed. It is possible to
382- use a Page inside a Loader, but in that case do not set the anchors or size of the Loader
383- so that the Page can control its width and height.
384+ \endqml
385 */
386 PageTreeNode {
387 id: page
388@@ -79,6 +79,8 @@
389 // Set width and height so that a parent Loader can be automatically resized
390 // to the size of the loaded Page.
391 width: parentNode ? parentNode.width - page.x : undefined
392+ // FIXME: We no longer need to take the internal header height into account
393+ // when we remove MainView's AppHeader.
394 height: parentNode ? page.flickable ? parentNode.height : parentNode.height - internal.headerHeight : undefined
395
396 /*!
397@@ -101,17 +103,23 @@
398 \qml
399 Page {
400 id: page
401- title: "Page with header"
402 header: PageHeader {
403- title: page.title
404+ title: "Page with header"
405 trailingActionBar.actions: [
406 Action { iconName: "settings" },
407 Action { iconName: "info" }
408 ]
409+ flickable: myFlickable
410 }
411 }
412 \endqml
413- \sa PageHeader
414+ To avoid Page content being occluded by the header, the contents of the Page
415+ should anchor to the bottom of the header. When the Page contents is flickable,
416+ the contents does not need to be anchored to the header, but it is recommended
417+ to use a \l PageHeader or \l Header component as the Page header, and set its
418+ \l Header::flickable property so that the Flickable gets a top-margin that
419+ leaves enough space for the header.
420+ \sa PageHeader, Header
421 */
422 property Item header
423 onHeaderChanged: internal.updateHeader()
424@@ -120,70 +128,43 @@
425 /*! \internal */
426 isLeaf: true
427
428- /*!
429- The title of the page. Will be shown in the header of the \l MainView.
430- If the page is used inside a \l Tab, the default title is the \l Tab title.
431- For a Page not inside a \l Tab, the default title is an empty string.
432- */
433+ /*! \deprecated */
434 property string title: parentNode && parentNode.hasOwnProperty("title") ? parentNode.title : ""
435-
436- /*!
437- Optional flickable that controls the MainView header. This property
438- is automatically set to the first child of the page that is Flickable
439- and anchors to the top of the page or fills the page. For example:
440- \qml
441- import QtQuick 2.4
442- import Ubuntu.Components 1.2
443-
444- MainView {
445- width: units.gu(30)
446- height: units.gu(50)
447- Page {
448- id: page
449- title: "example"
450- //flickable: null // uncomment for a fixed header
451- Flickable {
452- id: content
453- anchors.fill: parent
454- contentHeight: units.gu(70)
455- Label {
456- text: "hello"
457- anchors.centerIn: parent
458- }
459- }
460- }
461- }
462- \endqml
463- In this example, page.flickable will automatically be set to content because it is
464- a Flickable and it fills its parent. Thus, scrolling down in the Flickable will automatically
465- hide the header.
466-
467- Set this property to null to avoid automatic flickable detection, which disables hiding
468- of the header by scrolling in the Flickable. In cases where a flickable should control the header,
469- but it is not automatically detected, the flickable property can be set.
470- */
471+ /*! \deprecated */
472 property Flickable flickable: Utils.getFlickableChild(page)
473-
474- /*!
475- \qmlproperty PageHeadConfiguration Page::head
476- \readonly
477- \deprecated
478- Configuration of the header for this page.
479- Deprecated: This configuration will be replaced by setting the \l header property.
480- */
481+ /*! \deprecated */
482 readonly property alias head: headerConfig
483 PageHeadConfiguration {
484 id: headerConfig
485 title: page.title
486 flickable: page.flickable
487+ onFlickableChanged: internal.printDeprecationWarning()
488+ onTitleChanged: internal.printDeprecationWarning()
489+ onActionsChanged: internal.printDeprecationWarning()
490+ onBackActionChanged: internal.printDeprecationWarning()
491 }
492
493 Object {
494 id: internal
495
496+ property bool showDeprecationWarning: true
497+ function printDeprecationWarning() {
498+ if (internal.showDeprecationWarning) {
499+ var titleStr = page;
500+ if (page.title) {
501+ titleStr += "\"" + page.title + "\"";
502+ }
503+ titleStr += ": "
504+ print(titleStr + "In Ubuntu.Components 1.3, the use of Page.title, Page.flickable and" +
505+ " Page.head is deprecated. Use Page.header and the PageHeader component instead.");
506+ internal.showDeprecationWarning = false;
507+ }
508+ }
509+
510 property Item previousHeader: null
511 property Item previousHeaderParent: null
512 function updateHeader() {
513+ internal.showDeprecationWarning = false;
514 if (internal.previousHeader) {
515 internal.previousHeader.parent = internal.previousHeaderParent;
516 }
517
518=== modified file 'src/Ubuntu/Components/1.3/PageHeader.qml'
519--- src/Ubuntu/Components/1.3/PageHeader.qml 2016-01-13 16:07:58 +0000
520+++ src/Ubuntu/Components/1.3/PageHeader.qml 2016-02-15 14:22:54 +0000
521@@ -36,6 +36,9 @@
522 }
523 }
524 \endqml
525+
526+ See \l Header properties that are inherited by PageHeader to control
527+ the visibility of the header.
528 */
529 Header {
530 id: header
531
532=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/MainViewStyle.qml'
533--- src/Ubuntu/Components/Themes/Ambiance/1.3/MainViewStyle.qml 2016-01-21 12:46:28 +0000
534+++ src/Ubuntu/Components/Themes/Ambiance/1.3/MainViewStyle.qml 2016-02-15 14:22:54 +0000
535@@ -22,6 +22,7 @@
536 id: mainViewStyle
537
538 /*!
539+ \deprecated
540 Color of the header's background.
541
542 \sa backgroundColor, footerColor
543@@ -39,6 +40,7 @@
544 property color backgroundColor: styledItem.backgroundColor
545
546 /*!
547+ \deprecated
548 Color of the footer's background.
549
550 \sa backgroundColor, headerColor
551
552=== modified file 'src/Ubuntu/Components/plugin/ucheader.cpp'
553--- src/Ubuntu/Components/plugin/ucheader.cpp 2016-02-01 21:48:39 +0000
554+++ src/Ubuntu/Components/plugin/ucheader.cpp 2016-02-15 14:22:54 +0000
555@@ -46,11 +46,9 @@
556 width: units.gu(50)
557 height: units.gu(70)
558
559- Header {
560- id: header
561+ header: Header {
562 width: parent.width
563 height: units.gu(6)
564- z: 1 // ensure the header goes on top of the flickable contents
565 flickable: scrollableContent
566
567 Rectangle {
568@@ -71,8 +69,6 @@
569 }
570 \endqml
571
572- The default z-value is 0, so declare the Header after any Items that it should
573- overlay, or set its z-value to be larger than that of the other Items.
574 The initial y-value is 0, but scrolling the flickable or setting \l exposed to
575 false will change the y-value in the range from -height to 0.
576 */
577
578=== modified file 'src/Ubuntu/Components/plugin/ucmainviewbase.cpp'
579--- src/Ubuntu/Components/plugin/ucmainviewbase.cpp 2016-02-04 16:59:49 +0000
580+++ src/Ubuntu/Components/plugin/ucmainviewbase.cpp 2016-02-15 14:22:54 +0000
581@@ -16,6 +16,7 @@
582
583 #include "ucmainviewbase.h"
584 #include "ucmainviewbase_p.h"
585+#include "ucnamespace.h"
586
587 #include "ucactionmanager.h"
588 #include "ucactioncontext.h"
589@@ -166,12 +167,7 @@
590 Q_EMIT anchorToKeyboardChanged(anchorToKeyboard);
591 }
592
593-/*!
594- \qmlproperty color MainView::headerColor
595- Color of the header's background.
596-
597- \sa backgroundColor, footerColor
598-*/
599+// deprecated
600 QColor UCMainViewBase::headerColor() const
601 {
602 return d_func()->m_headerColor;
603@@ -184,32 +180,24 @@
604 //disable binding to background color
605 d->m_flags |= UCMainViewBasePrivate::CustomHeaderColor;
606 d->_q_headerColorBinding(headerColor);
607+ UC_QML_DEPRECATION_WARNING("MainView.headerColor is deprecated in Ubuntu.Components 1.3.")
608 }
609
610 /*!
611 \qmlproperty color MainView::backgroundColor
612 Color of the background.
613
614- The background is usually a single color. However if \l headerColor
615- or \l footerColor are set then a gradient of colors will be drawn.
616-
617- For example, in order for the MainView to draw a color gradient beneath
618- the content:
619+ Example:
620 \qml
621 import QtQuick 2.4
622- import Ubuntu.Components 1.2
623+ import Ubuntu.Components 1.3
624
625 MainView {
626 width: units.gu(40)
627 height: units.gu(60)
628-
629- headerColor: "#343C60"
630- backgroundColor: "#6A69A2"
631- footerColor: "#8896D5"
632+ backgroundColor: UbuntuColors.blue
633 }
634 \endqml
635-
636- \sa footerColor, headerColor
637 */
638 QColor UCMainViewBase::backgroundColor() const
639 {
640@@ -237,12 +225,7 @@
641 d->doAutoTheme();
642 }
643
644-/*!
645- \qmlproperty color MainView::footerColor
646- Color of the footer's background.
647-
648- \sa backgroundColor, headerColor
649-*/
650+// deprecated
651 QColor UCMainViewBase::footerColor() const
652 {
653 return d_func()->m_footerColor;
654@@ -255,11 +238,13 @@
655 //disable binding to background color
656 d->m_flags |= UCMainViewBasePrivate::CustomFooterColor;
657 d->_q_footerColorBinding(footerColor);
658+ UC_QML_DEPRECATION_WARNING("MainView.footerColor is deprecated in Ubuntu.Components 1.3.")
659 }
660
661 /*!
662 \qmlproperty list<Action> MainView::actions
663 \readonly
664+ \deprecated
665
666 A global list of actions that will be available to the system (including HUD)
667 as long as the application is running. For actions that are not always available to the
668@@ -273,6 +258,7 @@
669 /*!
670 \qmlproperty ActionManager MainView::actionManager
671 \readonly
672+ \deprecated
673
674 The ActionManager that supervises the global and local ActionContexts.
675 The \l actions property should be used preferably since it covers most

Subscribers

People subscribed via source and target branches