chatbar: move emojis back to main panel
This commit is contained in:
@@ -71,6 +71,35 @@ QQC2.Control {
|
|||||||
visible: NeoChatConfig.sendMessageWith === 1
|
visible: NeoChatConfig.sendMessageWith === 1
|
||||||
}
|
}
|
||||||
RowLayout {
|
RowLayout {
|
||||||
|
QQC2.ToolButton {
|
||||||
|
id: emojiButton
|
||||||
|
property EmojiDialog dialog
|
||||||
|
|
||||||
|
icon.name: "smiley"
|
||||||
|
text: i18n("Emojis & Stickers")
|
||||||
|
display: QQC2.AbstractButton.IconOnly
|
||||||
|
checkable: true
|
||||||
|
checked: dialog !== null
|
||||||
|
|
||||||
|
onClicked: {
|
||||||
|
if(!checked){
|
||||||
|
if(dialog) {
|
||||||
|
dialog.close();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
dialog = (emojiDialog.createObject(root) as EmojiDialog);
|
||||||
|
dialog.onClosed.connect(() => {
|
||||||
|
dialog = null;
|
||||||
|
});
|
||||||
|
dialog.open();
|
||||||
|
}
|
||||||
|
QQC2.ToolTip.visible: hovered
|
||||||
|
QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay
|
||||||
|
QQC2.ToolTip.text: text
|
||||||
|
}
|
||||||
|
|
||||||
QQC2.ScrollView {
|
QQC2.ScrollView {
|
||||||
id: chatScrollView
|
id: chatScrollView
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
@@ -125,4 +154,24 @@ 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();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -230,21 +230,7 @@ RowLayout {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
QQC2.ToolButton {
|
|
||||||
id: emojiButton
|
|
||||||
visible: !Kirigami.Settings.isMobile
|
|
||||||
icon.name: "smiley"
|
|
||||||
text: i18n("Emojis & Stickers")
|
|
||||||
display: QQC2.AbstractButton.IconOnly
|
|
||||||
checkable: true
|
|
||||||
|
|
||||||
onClicked: {
|
|
||||||
let dialog = (emojiDialog.createObject(root) as EmojiDialog).open();
|
|
||||||
}
|
|
||||||
QQC2.ToolTip.visible: hovered
|
|
||||||
QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay
|
|
||||||
QQC2.ToolTip.text: text
|
|
||||||
}
|
|
||||||
QQC2.ToolButton {
|
QQC2.ToolButton {
|
||||||
id: linkButton
|
id: linkButton
|
||||||
enabled: root.chatButtonHelper.richFormatEnabled
|
enabled: root.chatButtonHelper.richFormatEnabled
|
||||||
@@ -396,25 +382,4 @@ RowLayout {
|
|||||||
LinkDialog {}
|
LinkDialog {}
|
||||||
}
|
}
|
||||||
|
|
||||||
Component {
|
|
||||||
id: emojiDialog
|
|
||||||
EmojiDialog {
|
|
||||||
x: root.width - width
|
|
||||||
y: -implicitHeight
|
|
||||||
|
|
||||||
modal: false
|
|
||||||
includeCustom: true
|
|
||||||
closeOnChosen: false
|
|
||||||
|
|
||||||
currentRoom: root.room
|
|
||||||
|
|
||||||
onChosen: emoji => {
|
|
||||||
root.chatButtonHelper.insertText(emoji);
|
|
||||||
close();
|
|
||||||
}
|
|
||||||
onClosed: if (emojiButton.checked) {
|
|
||||||
emojiButton.checked = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user