chatbar: make emojidialog dynamically loaded

This commit is contained in:
Darshan Phaldesai
2026-02-22 12:49:34 -07:00
parent 7eda07d788
commit ce84562829

View File

@@ -88,8 +88,17 @@ QQC2.Control {
} }
return; return;
} }
dialog = Qt.createComponent('org.kde.neochat.chatbar', 'EmojiDialog').createObject(root, {
dialog = (emojiDialog.createObject(root) as EmojiDialog); modal: false,
includeCustom: true,
closeOnChosen: false,
currentRoom: root.room,
});
dialog.y = -dialog.implicitHeight - Kirigami.Units.smallSpacing;
dialog.onChosen.connect((emoji) => {
root.chatButtonHelper.insertText(emoji);
close();
});
dialog.onClosed.connect(() => { dialog.onClosed.connect(() => {
dialog = null; dialog = null;
}); });
@@ -154,24 +163,4 @@ QQC2.Control {
width: 1 width: 1
} }
} }
Component {
id: emojiDialog
EmojiDialog {
x: 0
y: -implicitHeight
modal: false
includeCustom: true
closeOnChosen: false
currentRoom: root.room
onChosen: emoji => {
root.chatButtonHelper.insertText(emoji);
close();
}
}
}
} }