fix(StatusSpellcheckingMenuItems): Exact menu items order

This commit is contained in:
B.Melnik 2021-09-22 17:15:33 +03:00 committed by Pascal Precht
parent 654bd9f284
commit 478177f25e
1 changed files with 86 additions and 63 deletions

View File

@ -13,18 +13,40 @@ StatusPopupMenu {
signal addToUserDict() signal addToUserDict()
signal disableSpellchecking() signal disableSpellchecking()
Column {
Repeater { Repeater {
id: suggestionsMenu id: suggestionsMenu
delegate: Loader { delegate: MenuItem {
sourceComponent: root.delegate id: variants
onLoaded: { implicitWidth: parent ? parent.width : 0
item.action.text = modelData implicitHeight: 38
contentItem: StatusBaseText {
rightPadding: 8
leftPadding: 4
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
text: modelData
color: Theme.palette.directColor1
font.pixelSize: 13
elide: Text.ElideRight
}
background: Rectangle {
color: variants.hovered ? Theme.palette.statusPopupMenu.hoverBackgroundColor
: "transparent"
}
onTriggered: {
root.menuItemClicked(index)
} }
} }
} }
StatusMenuSeparator {} StatusMenuSeparator { visible: !!suggestionsMenu.model && suggestionsMenu.model.length !== 0}
MenuItem { MenuItem {
id: ignoreWord id: ignoreWord
@ -80,5 +102,6 @@ StatusPopupMenu {
root.disableSpellchecking() root.disableSpellchecking()
} }
} }
}
} }