@ -31,8 +31,10 @@ KCM.ScrollViewKCM {
Component {
id: desktopsListItemComponent
Kirigami . SwipeListItem {
id: listItem
QQC2 . ItemDelegate {
width: ListView . view . width
down: false / / D i s a b l e p r e s s e f f e c t
hoverEnabled: false
contentItem: RowLayout {
QQC2 . TextField {
@ -64,7 +66,7 @@ KCM.ScrollViewKCM {
enabled: nameField . readOnly
onDoubleClicked: {
renameAction . trigger ( ) ;
renameAction . clicked ( ) ;
}
}
}
@ -78,40 +80,46 @@ KCM.ScrollViewKCM {
opacity: model ? ! model.IsDefault : 0.0
color: Kirigami . Theme . neutralTextColor
}
}
actions: [
Kirigami . Action {
DelegateButton {
id: renameAction
enabled: model && ! model . IsMissing
visible: ! applyAction . visible
icon.name: "edit-rename"
tooltip : i18nc ( "@info:tooltip" , "Rename" )
onTrigger ed: {
text : i18nc ( "@info:tooltip" , "Rename" )
onClick ed: {
nameField . readOnly = false ;
nameField . selectAll ( ) ;
nameField . forceActiveFocus ( ) ;
}
} ,
Kirigami . Action {
}
DelegateButton {
id: applyAction
visible: ! nameField . readOnly
icon.name: "dialog-ok-apply"
tooltip : i18nc ( "@info:tooltip" , "Confirm new name" )
onTrigger ed: {
text : i18nc ( "@info:tooltip" , "Confirm new name" )
onClick ed: {
nameField . readOnly = true ;
}
} ,
Kirigami . Action {
}
DelegateButton {
enabled: model && ! model . IsMissing && desktopsList . count !== 1
icon.name: "edit-delete"
tooltip : i18nc ( "@info:tooltip" , "Remove" )
onTrigger ed: kcm . desktopsModel . removeDesktop ( model . Id )
text : i18nc ( "@info:tooltip" , "Remove" )
onClick ed: kcm . desktopsModel . removeDesktop ( model . Id )
}
]
}
}
}
component DelegateButton: QQC2 . ToolButton {
display: QQC2 . AbstractButton . IconOnly
QQC2.ToolTip.text: text
QQC2.ToolTip.visible: hovered
}
header: ColumnLayout {
id: messagesLayout