Commit 8c83cc68 authored by Christian (Fuchs)'s avatar Christian (Fuchs)
Browse files

Add a button to clear the notification history

Adds a button in the plasmoid header to clear the history, same as the context menu.
The icon used is the same as clear history in the klipper plasmoid.

BUG: 386068
FIXED-IN: 5.13.0

Test Plan: Please test the alignment on your screen, whilst I made sure to use provided units, due to the indentation of heading I had to use fractions, which might lead to odd results on different resolutions / dpi

Reviewers: broulik

Reviewed By: broulik

Subscribers: plasma-devel

Tags: #plasma

Differential Revision:
parent 5286b919
......@@ -18,6 +18,7 @@
import QtQuick 2.0
import QtQuick.Layouts 1.2
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.extras 2.0 as PlasmaExtras
......@@ -265,12 +266,34 @@ Column {
delegate: NotificationDelegate { listModel: notificationsModel }
PlasmaExtras.Heading {
width: parent.width
level: 3
opacity: 0.6
RowLayout {
Layout.fillWidth: true
spacing: units.smallSpacing
visible: historyCount > 0
text: i18n("History")
width: parent.width
PlasmaExtras.Heading {
Layout.fillWidth: true
level: 3
opacity: 0.6
text: i18n("History")
PlasmaComponents.ToolButton {
Layout.rightMargin: spacerSvgFrame.margins.right
iconSource: "edit-delete"
tooltip: i18n("Clear History")
onClicked: clearHistory()
// This hack is unfortunately needed to have the buttons align,
// the ones in the list contain have a margin due to a frame for being a list item.
PlasmaCore.FrameSvgItem {
id : spacerSvgFrame
imagePath: "widgets/listitem"
prefix: "normal"
visible: false
// History stuff
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment