linux.x86.linphone/Linphone/view/Control/Display/Chat/ChatTextContent.qml
data 3b3bb966d4 Add ringtone selection dropdown and various bugfixes
- Add ComboBox for ringtone selection in Call Settings
- Convert MKV ringtones to WAV format (Linphone only supports WAV)
- Fix ComboSetting to support dialPlan type for international prefix
- Disable account devices feature to prevent API errors
- Disable automatic update check on startup
- Add ringtone fallback to default when custom file not found
- Fix ringtone dropdown to not override setting on initialization

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-08 08:31:15 +01:00

88 lines
2.5 KiB
QML
Executable file

import QtQuick
import QtQuick.Layouts
import Linphone
import UtilsCpp
// TODO : into Loader
// =============================================================================
TextEdit {
id: mainItem
property ChatMessageContentGui contentGui
property ChatGui chatGui: null
property string lastTextSelected : ''
property string searchedTextPart
color: DefaultStyle.main2_700
// force restoring cursor in case we click on a mention, otherwise
// the cursor stays IBeam
onVisibleChanged: if (!visible) UtilsCpp.restoreGlobalCursor()
font {
pixelSize: (contentGui && UtilsCpp.isOnlyEmojis(contentGui.core.text)) ? Typography.h1.pixelSize : Typography.p1.pixelSize
weight: Typography.p1.weight
}
// property int removeWarningFromBindingLoop : implicitWidth // Just a dummy variable to remove meaningless binding loop on implicitWidth
visible: contentGui && contentGui.core.isText
textMargin: 0
readOnly: true
selectByMouse: true
text: contentGui.core.richFormatText
onSearchedTextPartChanged: {
contentGui.core.setSearchedTextPart(searchedTextPart)
}
textFormat: Text.RichText // To supports links and imgs.
wrapMode: TextEdit.Wrap
onLinkActivated: (link) => {
if (link.startsWith('sip'))
UtilsCpp.createCall(link)
else if (link.startsWith('mention:')) {
var mentionAddress = link.substring(8) // remove "mention:"
UtilsCpp.openContactAtAddress(mentionAddress);
}
else
Qt.openUrlExternally(link)
}
onSelectedTextChanged:{
if(selectedText != '') lastTextSelected = selectedText
}
onLinkHovered: {
if (hoveredLink !== "") UtilsCpp.setGlobalCursor(Qt.PointingHandCursor)
else UtilsCpp.restoreGlobalCursor()
}
onActiveFocusChanged: {
if(activeFocus) {
lastTextSelected = ''
}
else mouseArea.keepLastSelection = false
// deselect()
}
MouseArea {
id: mouseArea
property bool keepLastSelection: false
property int lastStartSelection:0
property int lastEndSelection:0
anchors.fill: parent
propagateComposedEvents: true
hoverEnabled: true
scrollGestureEnabled: false
onContainsMouseChanged: {
if (containsMouse) UtilsCpp.setGlobalCursor(Qt.IBeamCursor)
else UtilsCpp.restoreGlobalCursor()
}
cursorShape: mainItem.hoveredLink ? Qt.PointingHandCursor : Qt.IBeamCursor
acceptedButtons: Qt.LeftButton
onPressed: (mouse) => {
// if(!keepLastSelection) {
// lastStartSelection = parent.selectionStart
// lastEndSelection = parent.selectionEnd
// }
keepLastSelection = true
mouse.accepted = false
}
}
}