Always show ExpandableListitem buttons, not just on hover

Hover buttons suffer from discoverability problems and can't be used on
touch, and this component is explicitly trying to be touch-friendly. So
let's make the buttons always be visible, not just on hover.

To avoid the appearance becoming too heavy, the Buttons are turned
into ToolButtons.

BUG: 428624
FIXED-IN: 5.76
This commit is contained in:
Nate Graham 2020-11-04 13:32:08 -07:00
parent b96f23cd3a
commit e845f3dbcc

View File

@ -328,10 +328,8 @@ Item {
}
}
// We still need a MouseArea to handle mouse hover and right-click
// We still need a MouseArea to handle right-click
MouseArea {
id: clickAndHoverHandler
anchors.fill: parent
enabled: listItem.isEnabled
@ -448,20 +446,17 @@ Item {
}
// Default action button
PlasmaComponents3.Button {
PlasmaComponents3.ToolButton {
id: defaultActionButton
enabled: listItem.isEnabled
visible: defaultActionButtonAction
&& listItem.defaultActionButtonVisible
&& (clickAndHoverHandler.containsMouse || expandedView.active)
&& (!busyIndicator.visible || listItem.showDefaultActionButtonWhenBusy)
}
// Expand/collapse button
PlasmaComponents3.Button {
visible: clickAndHoverHandler.containsMouse || expandedView.visible
PlasmaComponents3.ToolButton {
icon.name: expandedView.active? "collapse" : "expand"
onClicked: listItem.toggleExpanded()