Comment updates
This commit is contained in:
@@ -103,8 +103,14 @@ Item {
|
||||
height: Kirigami.Units.iconSizes.smallMedium
|
||||
|
||||
icon.name: NeoChatConfig.sendMessageWith === 0 ? "arrow-up" : "arrow-down"
|
||||
text: NeoChatConfig.sendMessageWith === 0 ? i18nc("@action:button", "Enter rich text mode") : i18nc("@action:button", "Exit rich text mode")
|
||||
display: QQC2.AbstractButton.IconOnly
|
||||
|
||||
onClicked: NeoChatConfig.sendMessageWith = NeoChatConfig.sendMessageWith === 0 ? 1 : 0
|
||||
|
||||
QQC2.ToolTip.visible: hovered
|
||||
QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay
|
||||
QQC2.ToolTip.text: text
|
||||
}
|
||||
|
||||
LibNeoChat.DelegateSizeHelper {
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
// SPDX-FileCopyrightText: 2024 Carl Schwan <carl@carlschwan.eu>
|
||||
// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
||||
|
||||
import QtQuick
|
||||
import QtCore
|
||||
import org.kde.kirigami as Kirigami
|
||||
import org.kde.kirigamiaddons.formcard as FormCard
|
||||
import QtQuick.Controls as QQC2
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Dialogs
|
||||
|
||||
FormCard.FormCardDialog {
|
||||
id: root
|
||||
|
||||
readonly property alias imagePath: imageField.path
|
||||
|
||||
title: i18nc("@title:window", "Insert Image")
|
||||
standardButtons: QQC2.Dialog.Ok | QQC2.Dialog.Cancel
|
||||
|
||||
FileDialog {
|
||||
id: fileDialog
|
||||
|
||||
title: i18nc("@title:window", "Select an image")
|
||||
currentFolder: StandardPaths.writableLocation(StandardPaths.PicturesLocation)
|
||||
fileMode: FileDialog.OpenFile
|
||||
nameFilters: [i18n("Image files (*.jpg *.jpeg *.png *.svg *.webp)"), i18n("All files (*)")]
|
||||
onAccepted: imageField.path = selectedFile
|
||||
}
|
||||
|
||||
FormCard.FormButtonDelegate {
|
||||
id: imageField
|
||||
|
||||
property url path
|
||||
|
||||
text: i18nc("@label:textbox", "Image Location:")
|
||||
description: path.toString().length > 0 ? path.toString().split('/').slice(-1)[0] : ''
|
||||
|
||||
onClicked: fileDialog.open()
|
||||
}
|
||||
|
||||
Item {
|
||||
visible: imageField.path.toString().length > 0
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 200
|
||||
Layout.topMargin: Kirigami.Units.largeSpacing
|
||||
|
||||
Image {
|
||||
anchors.fill: parent
|
||||
source: imageField.path
|
||||
fillMode: Image.PreserveAspectFit
|
||||
horizontalAlignment: Image.AlignHCenter
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -33,7 +33,7 @@ RowLayout {
|
||||
|
||||
visible: !root.contentModel.hasAttachment && (root.contentModel?.type ?? true) === LibNeoChat.ChatBarType.Room
|
||||
icon.name: "mail-attachment"
|
||||
text: i18n("Attach an image or file")
|
||||
text: i18nc("@action:button", "Attach an image or file")
|
||||
display: QQC2.AbstractButton.IconOnly
|
||||
|
||||
onClicked: {
|
||||
@@ -48,8 +48,8 @@ RowLayout {
|
||||
|
||||
let warningDialog = Qt.createComponent('org.kde.kirigami', 'PromptDialog').createObject(QQC2.Overlay.overlay, {
|
||||
dialogType: Kirigami.PromptDialog.Warning,
|
||||
title: i18n("Attach an image or file?"),
|
||||
subtitle: i18n("Attachments can only have plain text captions, all rich formatting will be removed"),
|
||||
title: attachmentButton.text,
|
||||
subtitle: i18nc("@Warning: that any rich text in the chat bar will be switched for the plain text equivalent.", "Attachments can only have plain text captions, all rich formatting will be removed"),
|
||||
standardButtons: Kirigami.Dialog.Ok | Kirigami.Dialog.Cancel
|
||||
});
|
||||
warningDialog.onAccepted.connect(() => {
|
||||
@@ -87,7 +87,7 @@ RowLayout {
|
||||
visible: (root.contentModel?.type ?? true) === LibNeoChat.ChatBarType.Room
|
||||
icon.name: "globe"
|
||||
property bool isBusy: false
|
||||
text: i18n("Send a Location")
|
||||
text: i18nc("@action:button", "Send a Location")
|
||||
display: QQC2.AbstractButton.IconOnly
|
||||
|
||||
onClicked: {
|
||||
@@ -122,7 +122,7 @@ RowLayout {
|
||||
property bool isBusy: false
|
||||
|
||||
icon.name: "document-send"
|
||||
text: i18n("Send message")
|
||||
text: i18nc("@action:button", "Send message")
|
||||
display: QQC2.AbstractButton.IconOnly
|
||||
|
||||
onClicked: root.contentModel.postMessage();
|
||||
|
||||
Reference in New Issue
Block a user