Commit ef9ecb60 authored by Nate Graham's avatar Nate Graham 🔩

[applet/notes] Show a "remove" button on the button row

Summary:
I've personally observed various users struggle to remove a Sticky Note widget, and heard
anedcotal user reports about this too. Some people look for a close button and don't
find one, never thinking to press-and-hold or right-click. Some people do right-click
but right-click in the content area rather than the frame (which look identical), and see
the context menu for the text rather than the widget itself.

This patch alleviates this user confusion by adding a {nav Remove} button on the button
row on the bottom of the widget, next to the {nav Configure...} button. This makes it
very easy to remove a Sticky Note. This is not destructive because there's an undo, so
it's not a big deal if someone clicks the button by mistake.

It could be argued that this makes the applet inconsistent with other widgets which do
not display visible {nav Remove} buttons, which is true. However the nature of the Sticky
Note applet is that it is likely to be used in a more transient or temporary manner than
other widgets; it often has more in common with a temporary document than a permanent
fixture of your desktop. For this reason, I believe it is appropriate to show a visible
{nav Remove} button on the widget.

The default size of the widget is increased a bit so that there's room for the new
{nav remove} button as well as the text control buttons.

Test Plan: {F8177920, size=full}

Reviewers: #vdg, #plasma, ndavis

Reviewed By: #vdg, ndavis

Subscribers: ndavis, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D28064
parent 006b5932
......@@ -42,8 +42,8 @@ PlasmaCore.SvgItem {
}
elementId: plasmoid.configuration.color + "-notes"
width: units.gridUnit * 14
height: units.gridUnit * 14
width: units.gridUnit * 15
height: units.gridUnit * 15
Layout.minimumWidth: units.iconSizes.medium
Layout.minimumHeight: units.iconSizes.medium
Plasmoid.switchWidth: units.gridUnit * 5
......@@ -358,7 +358,7 @@ PlasmaCore.SvgItem {
opacity: focusScope.activeFocus ? 1 : 0
Behavior on opacity { NumberAnimation { duration: units.longDuration } }
readonly property int requiredWidth: formatButtonsRow.width + spacing + settingsButton.width
readonly property int requiredWidth: formatButtonsRow.width + spacing + settingsButton.width + removeButton.width
readonly property bool showFormatButtons: width > requiredWidth
Row {
......@@ -440,6 +440,20 @@ PlasmaCore.SvgItem {
text: plasmoid.action("configure").text
}
}
QQC2.ToolButton {
id: removeButton
icon.name: "edit-delete"
icon.color: textIconColor
icon.width: units.iconSizes.smallMedium
icon.height: icon.width
onClicked: plasmoid.action("remove").trigger()
Accessible.name: removeTooltip.text
QQC2.ToolTip {
id: removeTooltip
text: plasmoid.action("remove").text
}
}
}
}
......
Markdown is supported
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