Changeset View
Changeset View
Standalone View
Standalone View
applets/notifications/package/contents/ui/Notifications.qml
Show All 12 Lines | |||||
13 | * | 13 | * | ||
14 | * You should have received a copy of the GNU Library General Public | 14 | * You should have received a copy of the GNU Library General Public | ||
15 | * License along with this program; if not, write to the | 15 | * License along with this program; if not, write to the | ||
16 | * Free Software Foundation, Inc., | 16 | * Free Software Foundation, Inc., | ||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | import QtQuick 2.0 | 20 | import QtQuick 2.0 | ||
21 | import QtQuick.Layouts 1.2 | ||||
21 | import org.kde.plasma.core 2.0 as PlasmaCore | 22 | import org.kde.plasma.core 2.0 as PlasmaCore | ||
22 | import org.kde.plasma.components 2.0 as PlasmaComponents | 23 | import org.kde.plasma.components 2.0 as PlasmaComponents | ||
23 | import org.kde.plasma.extras 2.0 as PlasmaExtras | 24 | import org.kde.plasma.extras 2.0 as PlasmaExtras | ||
24 | 25 | | |||
25 | import org.kde.plasma.private.notifications 1.0 | 26 | import org.kde.plasma.private.notifications 1.0 | ||
26 | 27 | | |||
27 | 28 | | |||
28 | Column { | 29 | Column { | ||
▲ Show 20 Lines • Show All 231 Lines • ▼ Show 20 Line(s) | |||||
260 | } | 261 | } | ||
261 | 262 | | |||
262 | Repeater { | 263 | Repeater { | ||
263 | id: notificationsRepeater | 264 | id: notificationsRepeater | ||
264 | model: notificationsModel | 265 | model: notificationsModel | ||
265 | delegate: NotificationDelegate { listModel: notificationsModel } | 266 | delegate: NotificationDelegate { listModel: notificationsModel } | ||
266 | } | 267 | } | ||
267 | 268 | | |||
268 | PlasmaExtras.Heading { | 269 | RowLayout { | ||
270 | Layout.fillWidth: true | ||||
271 | spacing: units.smallSpacing | ||||
272 | visible: historyCount > 0 | ||||
269 | width: parent.width | 273 | width: parent.width | ||
274 | | ||||
275 | PlasmaExtras.Heading { | ||||
276 | Layout.fillWidth: true | ||||
270 | level: 3 | 277 | level: 3 | ||
271 | opacity: 0.6 | 278 | opacity: 0.6 | ||
272 | visible: historyCount > 0 | | |||
273 | text: i18n("History") | 279 | text: i18n("History") | ||
274 | } | 280 | } | ||
275 | 281 | | |||
282 | PlasmaComponents.ToolButton { | ||||
283 | Layout.rightMargin: spacerSvgFrame.margins.right | ||||
284 | iconSource: "edit-delete" | ||||
285 | tooltip: i18n("Clear History") | ||||
286 | onClicked: clearHistory() | ||||
287 | } | ||||
288 | } | ||||
289 | | ||||
290 | // This hack is unfortunately needed to have the buttons align, | ||||
291 | // the ones in the list contain have a margin due to a frame for being a list item. | ||||
292 | PlasmaCore.FrameSvgItem { | ||||
293 | id : spacerSvgFrame | ||||
294 | imagePath: "widgets/listitem" | ||||
295 | prefix: "normal" | ||||
296 | visible: false | ||||
297 | } | ||||
298 | | ||||
276 | // History stuff | 299 | // History stuff | ||
277 | // The history is shown outside in a ListView | 300 | // The history is shown outside in a ListView | ||
278 | Binding { | 301 | Binding { | ||
279 | target: historyList | 302 | target: historyList | ||
280 | property: "model" | 303 | property: "model" | ||
281 | value: notificationsHistoryModel | 304 | value: notificationsHistoryModel | ||
282 | when: showHistory | 305 | when: showHistory | ||
283 | } | 306 | } | ||
Show All 15 Lines |