Further improvements to the ChatBox API

Further improvements to the ChatBox API so that outside components no longer access the ChatBar item directly.
This commit is contained in:
James Graham
2023-06-09 15:02:42 +00:00
parent 9425f24315
commit 105be518c7
3 changed files with 19 additions and 13 deletions

View File

@@ -37,16 +37,20 @@ ColumnLayout {
*/
property NeoChatRoom currentRoom
/**
* @brief The chatBar object
*/
property alias chatBar: chatBar
/**
* @brief A message has been sent from the chat bar.
*/
signal messageSent()
/**
* @brief Insert the given text into the ChatBar.
*
* The text is inserted at the current cursor location.
*/
function insertText(text) {
chatBar.insertText(text)
}
spacing: 0
Kirigami.Theme.colorSet: Kirigami.Theme.View
@@ -86,4 +90,6 @@ ColumnLayout {
chatBox.messageSent();
}
}
onActiveFocusChanged: chatBar.forceActiveFocus()
}