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

Proposed by Tim Peeters on 2015-12-15
Status: Merged
Approved by: Zsombor Egri on 2015-12-16
Approved revision: 1756
Merged at revision: 1772
Proposed branch: lp:~tpeeters/ubuntu-ui-toolkit/20-toolbar
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 753 lines (+210/-182)
16 files modified
components.api (+5/-0)
examples/ubuntu-ui-toolkit-gallery/PageHeaders.qml (+137/-0)
examples/ubuntu-ui-toolkit-gallery/WidgetsModel.qml (+5/-0)
src/Ubuntu/Components/1.2/DeprecatedToolbar.qml (+1/-1)
src/Ubuntu/Components/1.2/MainView.qml (+2/-2)
src/Ubuntu/Components/1.2/PageTreeNode.qml (+1/-1)
src/Ubuntu/Components/1.3/PageHeader.qml (+1/-0)
src/Ubuntu/Components/1.3/Toolbar.qml (+0/-147)
src/Ubuntu/Components/ComponentModule.pro (+2/-2)
src/Ubuntu/Components/Styles/1.3/ToolbarStyle.qml (+32/-0)
src/Ubuntu/Components/Styles/Styles.pro (+1/-0)
src/Ubuntu/Components/Styles/qmldir (+1/-0)
src/Ubuntu/Components/Themes/Ambiance/1.3/ToolbarStyle.qml (+17/-26)
src/Ubuntu/Components/Themes/Ambiance/Ambiance.pro (+1/-1)
src/Ubuntu/Components/Themes/Ambiance/qmldir (+2/-1)
src/Ubuntu/Components/qmldir (+2/-1)
To merge this branch: bzr merge lp:~tpeeters/ubuntu-ui-toolkit/20-toolbar
Reviewer Review Type Date Requested Status
Zsombor Egri (community) 2015-12-15 Approve on 2015-12-16
PS Jenkins bot continuous-integration Approve on 2015-12-15
Review via email: mp+280596@code.launchpad.net

Commit Message

Introduce the new Toolbar component for the header edit mode.

Description of the Change

The functionality of the Toolbar is already tested in the unit tests for ActionBar, because the Toolbar is basically just two ActionBars. In autopilot tests, simply use toolbar.leadingActionBar and toolbar.trailingActionBar, for which we have an ActionBar CPO.

To post a comment you must log in.
1752. By Tim Peeters on 2015-12-15

clean

1753. By Tim Peeters on 2015-12-15

remove tst_toolbar.qml

1754. By Tim Peeters on 2015-12-15

update components.api

1755. By Tim Peeters on 2015-12-15

use Component instead of Item for delegate type in example code.

Zsombor Egri (zsombi) wrote :

1.2 ToolbarStyle should not affect the 1.3 Toolbar component. Theme.createStyleComponent() will always use 1.2 style to look for the style.

review: Needs Fixing
1756. By Tim Peeters on 2015-12-15

remove FIXME from example code

Tim Peeters (tpeeters) wrote :

I couldn't keep 1.2/Toolbar.qml because then the qmldir has an internal and a 1.3 Toolbar component defined. I changed the name of ToolbarStyle as well to avoid confusion.

Zsombor Egri (zsombi) wrote :

Ok, fair point for renaming the old internal ToolbarStyle. For the unit tests, make sure you create one once additional functionality will be needed that differs from the ActionBar.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'components.api'
2--- components.api 2015-12-08 21:08:31 +0000
3+++ components.api 2015-12-15 15:11:22 +0000
4@@ -1434,6 +1434,9 @@
5 readonly property ThemeSettings parentTheme
6 Ubuntu.Components.ListItems.ThinDivider 1.0 0.1: Rectangle
7 Ubuntu.Components.ListItems.ThinDivider 1.3: Rectangle
8+Ubuntu.Components.Toolbar 1.3: StyledItem
9+ readonly property ActionBar leadingActionBar
10+ readonly property ActionBar trailingActionBar
11 Ubuntu.Components.ToolbarButton 1.0 0.1: StyledItem
12 property Action action
13 property string iconName
14@@ -1462,6 +1465,8 @@
15 property bool locked
16 property bool opened
17 property Item pageStack
18+Ubuntu.Components.Styles.ToolbarStyle 1.3: Item
19+ property Component defaultDelegate
20 Ubuntu.Components.UCApplication 1.0 0.1: QtObject
21 property string applicationName
22 property QtObject inputMethod
23
24=== added file 'examples/ubuntu-ui-toolkit-gallery/PageHeaders.qml'
25--- examples/ubuntu-ui-toolkit-gallery/PageHeaders.qml 1970-01-01 00:00:00 +0000
26+++ examples/ubuntu-ui-toolkit-gallery/PageHeaders.qml 2015-12-15 15:11:22 +0000
27@@ -0,0 +1,137 @@
28+/*
29+ * Copyright (C) 2015 Canonical Ltd.
30+ *
31+ * This program is free software; you can redistribute it and/or modify
32+ * it under the terms of the GNU Lesser General Public License as published by
33+ * the Free Software Foundation; version 3.
34+ *
35+ * This program is distributed in the hope that it will be useful,
36+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
37+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
38+ * GNU Lesser General Public License for more details.
39+ *
40+ * You should have received a copy of the GNU Lesser General Public License
41+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
42+ */
43+
44+import QtQuick 2.4
45+import Ubuntu.Components 1.3
46+
47+Template {
48+ id: page
49+ header: standardHeader
50+
51+ TemplateSection {
52+ title: "Page Header"
53+ className: "PageHeader"
54+
55+ Label {
56+ text: "Use the icons in the header."
57+ }
58+ }
59+
60+ PageHeader {
61+ id: standardHeader
62+ visible: page.header === standardHeader
63+ title: "Default title"
64+ trailingActionBar.actions: [
65+ Action {
66+ iconName: "search"
67+ text: "Search"
68+ onTriggered: page.header = searchHeader
69+ },
70+ Action {
71+ iconName: "edit"
72+ text: "Edit"
73+ onTriggered: page.header = editHeader
74+ }
75+ ]
76+ }
77+
78+ PageHeader {
79+ id: searchHeader
80+ visible: page.header === searchHeader
81+ leadingActionBar.actions: [
82+ Action {
83+ iconName: "back"
84+ text: "Back"
85+ onTriggered: page.header = standardHeader
86+ }
87+ ]
88+ contents: TextField {
89+ anchors {
90+ left: parent.left
91+ right: parent.right
92+ verticalCenter: parent.verticalCenter
93+ }
94+ placeholderText: "Search..."
95+ }
96+ }
97+
98+ PageHeader {
99+ id: editHeader
100+ visible: page.header === editHeader
101+ property Component delegate: Component {
102+ // FIXME: Replace this delegate with the new
103+ // text button when it becomes available.
104+ // Also update example code in Toolbar.qml.
105+ AbstractButton {
106+ id: button
107+ action: modelData
108+ width: label.width + units.gu(4)
109+ height: parent.height
110+ Rectangle {
111+ color: UbuntuColors.darkGrey
112+ opacity: 0.1
113+ anchors.fill: parent
114+ visible: button.pressed
115+ }
116+ Label {
117+ anchors.centerIn: parent
118+ id: label
119+ text: action.text
120+ font.weight: text === "Confirm" ? Font.Normal : Font.Light
121+ }
122+ }
123+ }
124+
125+ leadingActionBar {
126+ anchors.leftMargin: 0
127+ actions: Action {
128+ text: "Cancel"
129+ iconName: "close"
130+ onTriggered: page.header = standardHeader
131+ }
132+ delegate: editHeader.delegate
133+ }
134+ trailingActionBar {
135+ anchors.rightMargin: 0
136+ actions: Action {
137+ text: "Confirm"
138+ iconName: "tick"
139+ onTriggered: page.header = standardHeader
140+ }
141+ delegate: editHeader.delegate
142+ }
143+
144+ extension: Toolbar {
145+ anchors {
146+ left: parent.left
147+ right: parent.right
148+ bottom: parent.bottom
149+ }
150+ trailingActionBar.actions: [
151+ Action { iconName: "bookmark-new" },
152+ Action { iconName: "add" },
153+ Action { iconName: "edit-select-all" },
154+ Action { iconName: "edit-copy" },
155+ Action { iconName: "select" }
156+ ]
157+ leadingActionBar.actions: Action {
158+ iconName: "delete"
159+ text: "delete"
160+ onTriggered: print("Delete action triggered")
161+ }
162+ }
163+ }
164+}
165
166=== modified file 'examples/ubuntu-ui-toolkit-gallery/WidgetsModel.qml'
167--- examples/ubuntu-ui-toolkit-gallery/WidgetsModel.qml 2015-11-12 09:38:37 +0000
168+++ examples/ubuntu-ui-toolkit-gallery/WidgetsModel.qml 2015-12-15 15:11:22 +0000
169@@ -72,6 +72,11 @@
170 source: "ProgressBars.qml"
171 }
172 ListElement {
173+ objectName: "pageHeaderElement"
174+ label: "Page header"
175+ source: "PageHeaders.qml"
176+ }
177+ ListElement {
178 objectName: "sectionsElement"
179 label: "Sections"
180 source: "Sections.qml"
181
182=== renamed file 'src/Ubuntu/Components/1.2/Toolbar.qml' => 'src/Ubuntu/Components/1.2/DeprecatedToolbar.qml'
183--- src/Ubuntu/Components/1.2/Toolbar.qml 2015-04-30 08:32:44 +0000
184+++ src/Ubuntu/Components/1.2/DeprecatedToolbar.qml 2015-12-15 15:11:22 +0000
185@@ -135,7 +135,7 @@
186 property bool opened: toolbar.opened
187 property bool animating: toolbar.animating
188
189- style: Theme.createStyleComponent("ToolbarStyle.qml", background)
190+ style: Theme.createStyleComponent("DeprecatedToolbarStyle.qml", background)
191 }
192
193 Item {
194
195=== modified file 'src/Ubuntu/Components/1.2/MainView.qml'
196--- src/Ubuntu/Components/1.2/MainView.qml 2015-07-29 18:19:51 +0000
197+++ src/Ubuntu/Components/1.2/MainView.qml 2015-12-15 15:11:22 +0000
198@@ -99,7 +99,7 @@
199
200 Component {
201 id: toolbarComponent
202- Toolbar {
203+ DeprecatedToolbar {
204 parent: canvas
205 onPressedChanged: {
206 if (!pressed) return;
207@@ -264,7 +264,7 @@
208 \deprecated
209 The toolbar that will be propagated to the children in the page tree node.
210 */
211- property Toolbar toolbar: toolbarLoader.item
212+ property DeprecatedToolbar toolbar: toolbarLoader.item
213
214 /*!
215 \internal
216
217=== modified file 'src/Ubuntu/Components/1.2/PageTreeNode.qml'
218--- src/Ubuntu/Components/1.2/PageTreeNode.qml 2015-05-06 10:32:20 +0000
219+++ src/Ubuntu/Components/1.2/PageTreeNode.qml 2015-12-15 15:11:22 +0000
220@@ -53,7 +53,7 @@
221 The toolbar of the node. Propagates down from the root node.
222 This property is DEPRECATED.
223 */
224- property Toolbar toolbar: node.__propagated && node.__propagated.hasOwnProperty("toolbar")
225+ property DeprecatedToolbar toolbar: node.__propagated && node.__propagated.hasOwnProperty("toolbar")
226 ? node.__propagated.toolbar : null
227
228 /*!
229
230=== modified file 'src/Ubuntu/Components/1.3/PageHeader.qml'
231--- src/Ubuntu/Components/1.3/PageHeader.qml 2015-11-30 12:46:01 +0000
232+++ src/Ubuntu/Components/1.3/PageHeader.qml 2015-12-15 15:11:22 +0000
233@@ -230,6 +230,7 @@
234 }
235 }
236 \endqml
237+ See \l Toolbar and \l Sections.
238 */
239 property Item extension
240
241
242=== added file 'src/Ubuntu/Components/1.3/Toolbar.qml'
243--- src/Ubuntu/Components/1.3/Toolbar.qml 1970-01-01 00:00:00 +0000
244+++ src/Ubuntu/Components/1.3/Toolbar.qml 2015-12-15 15:11:22 +0000
245@@ -0,0 +1,168 @@
246+/*
247+ * Copyright 2015 Canonical Ltd.
248+ *
249+ * This program is free software; you can redistribute it and/or modify
250+ * it under the terms of the GNU Lesser General Public License as published by
251+ * the Free Software Foundation; version 3.
252+ *
253+ * This program is distributed in the hope that it will be useful,
254+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
255+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
256+ * GNU Lesser General Public License for more details.
257+ *
258+ * You should have received a copy of the GNU Lesser General Public License
259+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
260+ */
261+
262+import QtQuick 2.4
263+import Ubuntu.Components 1.3
264+
265+// FIXME: In the example code below, replace the delegate
266+// by the new text button when it becomes available.
267+/*!
268+ \qmltype Toolbar
269+ \inqmlmodule Ubuntu.Components 1.3
270+ \ingroup ubuntu
271+ \brief Toolbar that can be used as an extension for the edit mode header.
272+ Example:
273+ \qml
274+ PageHeader {
275+ id: editHeader
276+ property Component delegate: Component {
277+ AbstractButton {
278+ id: button
279+ action: modelData
280+ width: label.width + units.gu(4)
281+ height: parent.height
282+ Rectangle {
283+ color: UbuntuColors.darkGrey
284+ opacity: 0.1
285+ anchors.fill: parent
286+ visible: button.pressed
287+ }
288+ Label {
289+ anchors.centerIn: parent
290+ id: label
291+ text: action.text
292+ font.weight: text === "Confirm" ? Font.Normal : Font.Light
293+ }
294+ }
295+ }
296+
297+ leadingActionBar {
298+ anchors.leftMargin: 0
299+ actions: Action {
300+ text: "Cancel"
301+ iconName: "close"
302+ }
303+ delegate: editHeader.delegate
304+ }
305+ trailingActionBar {
306+ anchors.rightMargin: 0
307+ actions: Action {
308+ text: "Confirm"
309+ iconName: "tick"
310+ }
311+ delegate: editHeader.delegate
312+ }
313+
314+ extension: Toolbar {
315+ anchors {
316+ left: parent.left
317+ right: parent.right
318+ bottom: parent.bottom
319+ }
320+ trailingActionBar.actions: [
321+ Action { iconName: "bookmark-new" },
322+ Action { iconName: "add" },
323+ Action { iconName: "edit-select-all" },
324+ Action { iconName: "edit-copy" },
325+ Action { iconName: "select" }
326+ ]
327+ leadingActionBar.actions: Action {
328+ iconName: "delete"
329+ text: "delete"
330+ onTriggered: print("Delete action triggered")
331+ }
332+ }
333+ }
334+ \endqml
335+ See \l PageHeader.
336+*/
337+StyledItem {
338+ id: toolbar
339+ styleName: "ToolbarStyle"
340+
341+ /*!
342+ \qmlproperty ActionBar leadingActionBar
343+ The leading ActionBar that should hold at most one action.
344+ Recommneded for the delete action.
345+ Example:
346+ \qml
347+ Toolbar {
348+ leadingActionBar.actions: [
349+ Action {
350+ iconName: "delete"
351+ text: "Delete"
352+ onTriggered: print("delete!")
353+ }
354+ ]
355+ }
356+ \endqml
357+ See \l ActionBar.
358+ */
359+ readonly property alias leadingActionBar: leading
360+ ActionBar {
361+ id: leading
362+ anchors {
363+ left: parent.left
364+ top: parent.top
365+ bottom: parent.bottom
366+ leftMargin: units.gu(1)
367+ }
368+ numberOfSlots: 1
369+ delegate: toolbar.__styleInstance.defaultDelegate
370+ Component.onCompleted: {
371+ if (actions && actions.length > 1) {
372+ print("WARNING: Toolbar with more than one leading actions is not supported.");
373+ }
374+ }
375+ }
376+
377+ /*!
378+ \qmlproperty ActionBar trailingActionBar
379+ The \l ActionBar with trailing actions.
380+ Example:
381+ \qml
382+ Toolbar {
383+ trailingActionBar.actions: [
384+ Action { iconName: "bookmark-new" },
385+ Action { iconName: "add" },
386+ Action { iconName: "edit-select-all" },
387+ Action { iconName: "edit-copy" }
388+ ]
389+ }
390+ \endqml
391+ The trailing ActionBar may contain up to 8 actions.
392+ Scrolling and support for more than 8 actions will be added in the near future.
393+ See \l ActionBar.
394+ */
395+ readonly property alias trailingActionBar: trailing
396+ ActionBar {
397+ id: trailing
398+ anchors {
399+ right: parent.right
400+ top: parent.top
401+ bottom: parent.bottom
402+ rightMargin: units.gu(1)
403+ }
404+ numberOfSlots: 8
405+ delegate: toolbar.__styleInstance.defaultDelegate
406+ Component.onCompleted: {
407+ if (actions && actions.length > 8) {
408+ print("WARNING: Toolbar with more than one leading actions is not supported.");
409+ }
410+ }
411+
412+ }
413+}
414
415=== removed file 'src/Ubuntu/Components/1.3/Toolbar.qml'
416--- src/Ubuntu/Components/1.3/Toolbar.qml 2015-09-28 14:36:54 +0000
417+++ src/Ubuntu/Components/1.3/Toolbar.qml 1970-01-01 00:00:00 +0000
418@@ -1,147 +0,0 @@
419-/*
420- * Copyright (C) 2015 Canonical Ltd.
421- *
422- * This program is free software; you can redistribute it and/or modify
423- * it under the terms of the GNU Lesser General Public License as published by
424- * the Free Software Foundation; version 3.
425- *
426- * This program is distributed in the hope that it will be useful,
427- * but WITHOUT ANY WARRANTY; without even the implied warranty of
428- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
429- * GNU Lesser General Public License for more details.
430- *
431- * You should have received a copy of the GNU Lesser General Public License
432- * along with this program. If not, see <http://www.gnu.org/licenses/>.
433- */
434-
435-import QtQuick 2.4
436-import Ubuntu.Components 1.3 as Toolkit
437-
438-/*!
439- \internal
440- \qmltype Toolbar
441- \inqmlmodule Ubuntu.Components 1.1
442- \ingroup ubuntu
443- \brief Application toolbar. This class is not exposed because it will
444- be automatically added when a Page defines tools.
445-*/
446-Panel {
447- id: toolbar
448- anchors {
449- left: parent ? parent.left : undefined
450- right: parent ? parent.right : undefined
451- bottom: parent ? parent.bottom : undefined
452- }
453- height: background.height
454-
455- LayoutMirroring.enabled: Qt.application.layoutDirection == Qt.RightToLeft
456- LayoutMirroring.childrenInherit: true
457-
458- // Closing of the toolbar on app contents interaction is handled by the Page.
459- __closeOnContentsClicks: false
460-
461- // Open toolbar on hover (for desktop only)
462- __openOnHover: true
463-
464- /*!
465- The list of \l Actions to be shown on the toolbar
466- */
467- property Item tools: null
468-
469- hideTimeout: 5000
470-
471- /*! \internal */
472- onToolsChanged: {
473- internal.updateVisibleTools();
474- if (tools) {
475- if (tools && tools.hasOwnProperty("locked")) locked = tools.locked;
476- // open the toolbar, except when it is locked in closed position
477- if (tools && tools.hasOwnProperty("locked") && tools.hasOwnProperty("opened")
478- && !tools.opened && tools.locked) {
479- // toolbar is locked in closed state
480- toolbar.close();
481- } else {
482- toolbar.open();
483- }
484-
485- if (tools && tools.hasOwnProperty("opened")) {
486- tools.opened = toolbar.opened;
487- }
488- } else { // no tools
489- locked = true;
490- toolbar.close();
491- }
492- }
493-
494- // if tools is not specified, lock the toolbar in closed position
495- locked: tools && tools.hasOwnProperty("locked") ? tools.locked : false
496-
497- onOpenedChanged: {
498- if (tools && tools.hasOwnProperty("opened")) {
499- tools.opened = toolbar.opened;
500- }
501- }
502-
503- Connections {
504- target: tools
505- ignoreUnknownSignals: true
506- onOpenedChanged: {
507- if (tools.opened) {
508- toolbar.open();
509- } else {
510- toolbar.close();
511- }
512- }
513- onLockedChanged: {
514- toolbar.locked = tools.locked;
515- // open the toolbar when it becomes unlocked
516- // (may be because a new page was pushed to the page stack)
517- if (!toolbar.locked) toolbar.open();
518- }
519- }
520-
521- QtObject {
522- id: internal
523- property Item visibleTools: tools
524- function updateVisibleTools() {
525- if (internal.visibleTools !== toolbar.tools) {
526- if (internal.visibleTools) internal.visibleTools.parent = null;
527- internal.visibleTools = toolbar.tools;
528- }
529- if (internal.visibleTools) internal.visibleTools.parent = visibleToolsContainer;
530- }
531- }
532-
533- onAnimatingChanged: {
534- if (!animating && !opened) {
535- internal.updateVisibleTools();
536- }
537- }
538-
539- Toolkit.StyledItem {
540- // FIXME:
541- // All theming items go into the background because only the children
542- // of the Panel are being shown/hidden while the toolbar
543- // itself may stay in place.
544- id: background
545- anchors {
546- left: parent.left
547- right: parent.right
548- bottom: parent.bottom
549- }
550- height: units.gu(8)
551-
552- // The values of opened and animated properties are used in the style
553- property bool opened: toolbar.opened
554- property bool animating: toolbar.animating
555-
556- styleName: "ToolbarStyle"
557- }
558-
559- Item {
560- id: visibleToolsContainer
561- anchors {
562- fill: background
563- }
564- }
565-}
566
567=== modified file 'src/Ubuntu/Components/ComponentModule.pro'
568--- src/Ubuntu/Components/ComponentModule.pro 2015-12-07 17:02:28 +0000
569+++ src/Ubuntu/Components/ComponentModule.pro 2015-12-15 15:11:22 +0000
570@@ -72,7 +72,7 @@
571 1.2/TextInputPopover.qml \
572 1.2/ToolbarButton.qml \
573 1.2/ToolbarItems.qml \
574- 1.2/Toolbar.qml \
575+ 1.2/DeprecatedToolbar.qml \
576 1.2/UbuntuListView11.qml \
577 1.2/UbuntuListView.qml \
578 1.2/UbuntuNumberAnimation.qml
579@@ -120,9 +120,9 @@
580 1.3/TextCursor.qml \
581 1.3/TextField.qml \
582 1.3/TextInputPopover.qml \
583+ 1.3/Toolbar.qml \
584 1.3/ToolbarButton.qml \
585 1.3/ToolbarItems.qml \
586- 1.3/Toolbar.qml \
587 1.3/tree.js \
588 1.3/UbuntuColors.qml \
589 1.3/UbuntuListView11.qml \
590
591=== added file 'src/Ubuntu/Components/Styles/1.3/ToolbarStyle.qml'
592--- src/Ubuntu/Components/Styles/1.3/ToolbarStyle.qml 1970-01-01 00:00:00 +0000
593+++ src/Ubuntu/Components/Styles/1.3/ToolbarStyle.qml 2015-12-15 15:11:22 +0000
594@@ -0,0 +1,32 @@
595+/*
596+ * Copyright 2015 Canonical Ltd.
597+ *
598+ * This program is free software; you can redistribute it and/or modify
599+ * it under the terms of the GNU Lesser General Public License as published by
600+ * the Free Software Foundation; version 3.
601+ *
602+ * This program is distributed in the hope that it will be useful,
603+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
604+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
605+ * GNU Lesser General Public License for more details.
606+ *
607+ * You should have received a copy of the GNU Lesser General Public License
608+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
609+ */
610+import QtQuick 2.4
611+
612+/*!
613+ \qmltype ToolbarStyle
614+ \inqmlmodule Ubuntu.Components.Styles 1.3
615+ \ingroup style-api
616+ \brief Style API for toolbar.
617+
618+ The component defines the style API for the \l Toolbar component.
619+ */
620+Item {
621+ /*!
622+ The default action delegate if the styled item does
623+ not provide a different delegate.
624+ */
625+ property Component defaultDelegate
626+}
627
628=== modified file 'src/Ubuntu/Components/Styles/Styles.pro'
629--- src/Ubuntu/Components/Styles/Styles.pro 2015-10-23 05:42:14 +0000
630+++ src/Ubuntu/Components/Styles/Styles.pro 2015-12-15 15:11:22 +0000
631@@ -8,6 +8,7 @@
632 1.3/PageHeadStyle.qml \
633 1.3/ActionBarStyle.qml \
634 1.3/PageHeaderStyle.qml \
635+ 1.3/ToolbarStyle.qml \
636 $$ARTWORK_FILES
637
638 load(ubuntu_qml_module)
639
640=== modified file 'src/Ubuntu/Components/Styles/qmldir'
641--- src/Ubuntu/Components/Styles/qmldir 2015-10-08 21:19:56 +0000
642+++ src/Ubuntu/Components/Styles/qmldir 2015-12-15 15:11:22 +0000
643@@ -8,3 +8,4 @@
644 PageHeadStyle 1.3 1.3/PageHeadStyle.qml
645 ActionBarStyle 1.3 1.3/ActionBarStyle.qml
646 PageHeaderStyle 1.3 1.3/PageHeaderStyle.qml
647+ToolbarStyle 1.3 1.3/ToolbarStyle.qml
648
649=== renamed file 'src/Ubuntu/Components/Themes/Ambiance/1.2/ToolbarStyle.qml' => 'src/Ubuntu/Components/Themes/Ambiance/1.2/DeprecatedToolbarStyle.qml'
650=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/ToolbarStyle.qml'
651--- src/Ubuntu/Components/Themes/Ambiance/1.3/ToolbarStyle.qml 2015-04-24 14:07:02 +0000
652+++ src/Ubuntu/Components/Themes/Ambiance/1.3/ToolbarStyle.qml 2015-12-15 15:11:22 +0000
653@@ -15,31 +15,22 @@
654 */
655 import QtQuick 2.4
656 import Ubuntu.Components 1.3
657-
658-Item {
659- id: visuals
660- // styling properties
661- property color color: theme.palette.normal.overlay
662-
663- anchors.fill: parent
664-
665- Rectangle {
666- id: background
667- anchors.fill: parent
668- color: visuals.color
669- }
670-
671- Image {
672- id: dropshadow
673- anchors {
674- left: parent.left
675- right: parent.right
676- bottom: background.top
677- }
678- source: Qt.resolvedUrl("../artwork/toolbar_dropshadow.png")
679- opacity: styledItem.opened || styledItem.animating ? 0.5 : 0.0
680- Behavior on opacity {
681- UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration }
682- }
683+import Ubuntu.Components.Styles 1.3 as Style
684+
685+Style.ToolbarStyle {
686+ id: toolbarStyle
687+ implicitWidth: parent ? parent.width : 0
688+ implicitHeight: units.gu(4)
689+
690+ /*!
691+ The default action delegate if the styled item does
692+ not provide a delegate.
693+ */
694+ defaultDelegate: AbstractButton {
695+ style: IconButtonStyle { }
696+ objectName: action.objectName + "_button"
697+ height: parent ? parent.height : undefined
698+ width: units.gu(4)
699+ action: modelData
700 }
701 }
702
703=== modified file 'src/Ubuntu/Components/Themes/Ambiance/Ambiance.pro'
704--- src/Ubuntu/Components/Themes/Ambiance/Ambiance.pro 2015-12-08 22:05:42 +0000
705+++ src/Ubuntu/Components/Themes/Ambiance/Ambiance.pro 2015-12-15 15:11:22 +0000
706@@ -72,7 +72,7 @@
707 1.2/TextCursorStyle.qml \
708 1.2/TextFieldStyle.qml \
709 1.2/ToolbarButtonStyle.qml \
710- 1.2/ToolbarStyle.qml \
711+ 1.2/DeprecatedToolbarStyle.qml \
712 1.3/ActionBarStyle.qml \
713 1.3/ActivityIndicatorStyle.qml \
714 1.3/BubbleShape.qml \
715
716=== modified file 'src/Ubuntu/Components/Themes/Ambiance/qmldir'
717--- src/Ubuntu/Components/Themes/Ambiance/qmldir 2015-12-08 22:05:42 +0000
718+++ src/Ubuntu/Components/Themes/Ambiance/qmldir 2015-12-15 15:11:22 +0000
719@@ -16,7 +16,7 @@
720 internal TextCursorStyle ./1.2/TextCursorStyle.qml
721 TextFieldStyle 0.1 ./1.2/TextFieldStyle.qml
722 internal ToolbarButtonStyle ./1.2/ToolbarButtonStyle.qml
723-internal ToolbarStyle ./1.2/ToolbarStyle.qml
724+internal DeprecatedToolbarStyle ./1.2/DeprecatedToolbarStyle.qml
725 internal BubbleShape ./1.2/BubbleShape.qml
726 PickerStyle 0.1 ./1.2/PickerStyle.qml
727 DatePickerStyle 0.1 ./1.2/DatePickerStyle.qml
728@@ -86,4 +86,5 @@
729 PageHeaderStyle 1.3 ./1.3/PageHeaderStyle.qml
730 BottomEdgeHintStyle 1.3 ./1.3/BottomEdgeHintStyle.qml
731 BottomEdgeStyle 1.3 ./1.3/BottomEdgeStyle.qml
732+ToolbarStyle 1.3 ./1.3/ToolbarStyle.qml
733 internal SectionsForPageHead ./1.3/SectionsForPageHead.qml
734
735=== modified file 'src/Ubuntu/Components/qmldir'
736--- src/Ubuntu/Components/qmldir 2015-11-23 15:14:16 +0000
737+++ src/Ubuntu/Components/qmldir 2015-12-15 15:11:22 +0000
738@@ -25,7 +25,7 @@
739 OptionSelectorDelegate 0.1 1.2/OptionSelectorDelegate.qml
740 Page 0.1 1.2/Page10.qml
741 PageStack 0.1 1.2/PageStack.qml
742-internal Toolbar 1.2/Toolbar.qml
743+internal DeprecatedToolbar 1.2/DeprecatedToolbar.qml
744 internal AppHeader 1.2/AppHeader.qml
745 Header 0.1 1.2/Header.qml
746 internal AnimatedItem 1.2/AnimatedItem.qml
747@@ -136,3 +136,4 @@
748 DateUtils 1.3 1.3/dateUtils.js
749 ProgressionSlot 1.3 1.3/ProgressionSlot.qml
750 PageHeader 1.3 1.3/PageHeader.qml
751+Toolbar 1.3 1.3/Toolbar.qml
752
753=== renamed file 'tests/unit_x11/tst_components/tst_toolbar.qml' => 'tests/unit_x11/tst_components/tst_deprecatedtoolbar.qml'

Subscribers

People subscribed via source and target branches