2
* Copyright 2016 Canonical Ltd.
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU Lesser General Public License as published by
6
* the Free Software Foundation; version 3.
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 Lesser General Public License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
18
import Ubuntu.Components 1.3
21
objectName: "toolbarTemplate"
24
property list<Action> actionList: [
26
iconName: "alarm-clock"
30
iconName: "appointment"
34
iconName: "attachment"
51
property list<Action> longActionList: [
53
iconName: "alarm-clock"
55
onTriggered: print("tock")
58
iconName: "appointment"
60
onTriggered: print("date")
63
iconName: "attachment"
65
onTriggered: print("attach")
70
onTriggered: print("contact")
75
onTriggered: print("+1")
80
onTriggered: print("lock")
85
onTriggered: print("cam")
90
onTriggered: print("loc")
96
onTriggered: print("msg")
101
onTriggered: print("tv")
104
iconName: "lock-broken"
106
onTriggered: print("unlock")
111
onTriggered: print("edit")
114
iconName: "contact-new"
116
onTriggered: print("useradd")
121
onTriggered: print("crop")
126
onTriggered: print("cut")
129
iconName: "image-quality"
130
text: "Image quality"
131
onTriggered: print("image quality")
136
onTriggered: print("import")
141
onTriggered: print("history")
144
iconName: "media-eject"
146
onTriggered: print("eject")
150
property list<Action> deleteActionList: [
154
onTriggered: print("delete")
160
title: toolbarTemplate.title
161
property bool longList: false
167
bottom: parent.bottom
169
leadingActionBar.actions: deleteActionList
170
trailingActionBar.actions: h.longList ? longActionList : actionList
172
trailingActionBar.actions: [
174
iconName: h.longList ? "remove" : "add"
175
text: h.longList ? "less" : "more"
177
h.longList = !h.longList;
189
title: i18n.tr("Enabled")
192
trailingActionBar.actions: actionList
193
leadingActionBar.actions: deleteActionList
197
title: i18n.tr("Disabled")
200
trailingActionBar.actions: actionList
201
leadingActionBar.actions: deleteActionList
208
title: "Scrollable toolbar"
212
title: i18n.tr("Enabled")
215
trailingActionBar.actions: longActionList
216
leadingActionBar.actions: deleteActionList
220
title: i18n.tr("Disabled")
223
trailingActionBar.actions: longActionList
224
leadingActionBar.actions: deleteActionList
232
className: "ActionBarStyle"
238
trailingActionBar.actions: longActionList
239
leadingActionBar.actions: deleteActionList
241
ignoreUnknownProperties: false
242
backgroundColor: UbuntuColors.green
244
foregroundColor: "white"
245
disabledForegroundColor: UbuntuColors.silk
246
pressedBackgroundColor: UbuntuColors.ash
247
disabledBackgroundColor: UbuntuColors.slate