diff --git a/ui/StatusQ/src/StatusQ/Popups/StatusSpellcheckingMenuItems.qml b/ui/StatusQ/src/StatusQ/Popups/StatusSpellcheckingMenuItems.qml index 9bd57ad326..9718546802 100644 --- a/ui/StatusQ/src/StatusQ/Popups/StatusSpellcheckingMenuItems.qml +++ b/ui/StatusQ/src/StatusQ/Popups/StatusSpellcheckingMenuItems.qml @@ -13,72 +13,95 @@ StatusPopupMenu { signal addToUserDict() signal disableSpellchecking() - Repeater { - id: suggestionsMenu + Column { - delegate: Loader { - sourceComponent: root.delegate - onLoaded: { - item.action.text = modelData + Repeater { + id: suggestionsMenu + + delegate: MenuItem { + id: variants + implicitWidth: parent ? parent.width : 0 + 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 { visible: !!suggestionsMenu.model && suggestionsMenu.model.length !== 0} + + MenuItem { + id: ignoreWord + implicitWidth: parent ? parent.width : 0 + implicitHeight: 38 + contentItem: StatusBaseText { + rightPadding: 8 + leftPadding: 4 + + horizontalAlignment: Text.AlignLeft + verticalAlignment: Text.AlignVCenter + + text: qsTr("Add to dictionary") + color: Theme.palette.directColor1 + font.pixelSize: 13 + elide: Text.ElideRight + } + + background: Rectangle { + color: ignoreWord.hovered ? Theme.palette.statusPopupMenu.hoverBackgroundColor + : "transparent" + } + + onTriggered: { + root.addToUserDict() + } + } + + MenuItem { + id: disableSpellchecking + implicitWidth: parent ? parent.width : 0 + implicitHeight: 38 + contentItem: StatusBaseText { + rightPadding: 8 + leftPadding: 4 + + horizontalAlignment: Text.AlignLeft + verticalAlignment: Text.AlignVCenter + + text: qsTr("Disable Spellchecking") + color: Theme.palette.directColor1 + font.pixelSize: 13 + elide: Text.ElideRight + } + + + background: Rectangle { + color: disableSpellchecking.hovered ? Theme.palette.statusPopupMenu.hoverBackgroundColor + : "transparent" + } + + onTriggered: { + root.disableSpellchecking() } } } - StatusMenuSeparator {} - - MenuItem { - id: ignoreWord - implicitWidth: parent ? parent.width : 0 - implicitHeight: 38 - contentItem: StatusBaseText { - rightPadding: 8 - leftPadding: 4 - - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - - text: qsTr("Add to dictionary") - color: Theme.palette.directColor1 - font.pixelSize: 13 - elide: Text.ElideRight - } - - background: Rectangle { - color: ignoreWord.hovered ? Theme.palette.statusPopupMenu.hoverBackgroundColor - : "transparent" - } - - onTriggered: { - root.addToUserDict() - } - } - - MenuItem { - id: disableSpellchecking - implicitWidth: parent ? parent.width : 0 - implicitHeight: 38 - contentItem: StatusBaseText { - rightPadding: 8 - leftPadding: 4 - - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - - text: qsTr("Disable Spellchecking") - color: Theme.palette.directColor1 - font.pixelSize: 13 - elide: Text.ElideRight - } - - - background: Rectangle { - color: disableSpellchecking.hovered ? Theme.palette.statusPopupMenu.hoverBackgroundColor - : "transparent" - } - - onTriggered: { - root.disableSpellchecking() - } - } - }