Update the look of the chatbar to be floating with the rich text controls on top and send buttons inline

This commit is contained in:
James Graham
2026-01-17 15:46:00 +00:00
parent 79de8a792c
commit 6b318ec754
25 changed files with 945 additions and 806 deletions

View File

@@ -174,6 +174,11 @@ void ChatBarMessageContentModel::connectKeyHelper()
insertComponentAtCursor(MessageComponentType::Text);
}
});
connect(m_keyHelper, &ChatKeyHelper::unhandledReturn, this, [this](bool isCompleting) {
if (!isCompleting) {
postMessage();
}
});
connect(m_keyHelper, &ChatKeyHelper::imagePasted, this, [this](const QString &filePath) {
m_room->cacheForType(m_type)->setAttachmentPath(filePath);
});
@@ -448,6 +453,21 @@ void ChatBarMessageContentModel::removeAttachment()
}
}
bool ChatBarMessageContentModel::sendMessageWithEnter() const
{
return m_sendMessageWithEnter;
}
void ChatBarMessageContentModel::setSendMessageWithEnter(bool sendMessageWithEnter)
{
if (sendMessageWithEnter == m_sendMessageWithEnter) {
return;
}
m_sendMessageWithEnter = sendMessageWithEnter;
m_keyHelper->sendMessageWithEnter = sendMessageWithEnter;
Q_EMIT sendMessageWithEnterChanged();
}
ChatBarMessageContentModel::ComponentIt ChatBarMessageContentModel::removeComponent(ComponentIt it)
{
if (it == m_components.end()) {