chatbar: make emojidialog dynamically loaded
This commit is contained in:
@@ -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();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user