Commit e9b62701 authored by Eugene Popov's avatar Eugene Popov 🇺🇦 Committed by Nate Graham
Browse files

Hide the Clear History action and button if history is empty

Currently, the Clear History action remains visible even if the clipboard
history is empty. This patch changes this so the behavior of the Clear History
action will be the same as in the Notifications widget.
parent 7c49a0ae
......@@ -98,7 +98,7 @@ ColumnLayout {
}
}
PlasmaComponents3.ToolButton {
visible: !(plasmoid.containmentDisplayHints & PlasmaCore.Types.ContainmentDrawsPlasmoidHeading)
visible: !(plasmoid.containmentDisplayHints & PlasmaCore.Types.ContainmentDrawsPlasmoidHeading) && plasmoid.action("clearHistory").visible
icon.name: "edit-clear-history"
onClicked: {
......
......@@ -67,6 +67,9 @@ Item {
plasmoid.setAction("configure", i18n("Configure Clipboard..."), "configure", "alt+d, s");
plasmoid.setAction("clearHistory", i18n("Clear History"), "edit-clear-history");
plasmoid.action("clearHistory").visible = Qt.binding(() => {
return !main.isClipboardEmpty;
});
}
PlasmaCore.DataSource {
......
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