diff --git a/applets/kimpanel/backend/ibus/emojier/ui/CategoryPage.qml b/applets/kimpanel/backend/ibus/emojier/ui/CategoryPage.qml --- a/applets/kimpanel/backend/ibus/emojier/ui/CategoryPage.qml +++ b/applets/kimpanel/backend/ibus/emojier/ui/CategoryPage.qml @@ -67,9 +67,8 @@ id: emojiView readonly property real desiredSize: Kirigami.Units.gridUnit * 3 - readonly property real columnsToHave: Math.ceil(width/desiredSize) - cellWidth: width/columnsToHave + cellWidth: desiredSize cellHeight: desiredSize model: CategoryModelFilter { @@ -87,38 +86,45 @@ } currentIndex: -1 - delegate: MouseArea { - QQC2.Label { - font.pointSize: 30 - fontSizeMode: Text.Fit - minimumPointSize: 10 - text: model.display - horizontalAlignment: Text.AlignHCenter - - anchors.fill: parent - anchors.margins: 1 - } + delegate: Loader { width: emojiView.cellWidth height: emojiView.cellHeight - QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay - QQC2.ToolTip.text: model.toolTip - QQC2.ToolTip.visible: mouse.containsMouse + asynchronous: true + sourceComponent: MouseArea { + anchors.fill: parent - opacity: mouse.containsMouse ? 0.7 : 1 + QQC2.Label { + font.pointSize: 30 + fontSizeMode: Text.Fit + minimumPointSize: 10 + text: model.display + horizontalAlignment: Text.AlignHCenter - Keys.onReturnPressed: { - reportEmoji() - } + anchors.fill: parent + anchors.margins: 1 + } - function reportEmoji() { - window.report(model.display, model.toolTip) - } + QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay + QQC2.ToolTip.text: model.toolTip + QQC2.ToolTip.visible: mouse.containsMouse + opacity: mouse.containsMouse ? 0.7 : 1 - id: mouse - hoverEnabled: true - onClicked: reportEmoji() + Keys.onReturnPressed: { + reportEmoji() + } + + function reportEmoji() { + window.report(model.display, model.toolTip) + } + + + id: mouse + hoverEnabled: true + onClicked: reportEmoji() + + } } } }