linphone-desktop/Linphone/view/Control/Display/Contact/PresenceSetCustomStatus.qml
Alexandre Jörgensen a9a78cb4bf Accessibility and code improvments:
* Normalize and correct linphone color
* Add border when user focus using keyboard navigation
* Correct some keyboard navigation
* Add accessibility screen reading to interactive elements except chat and meeting
2025-10-15 12:50:43 +02:00

78 lines
1.8 KiB
QML

import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import Linphone
import SettingsCpp
import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle
Column {
id: mainItem
spacing: 20 * DefaultStyle.dp
anchors.centerIn: parent
property var accountCore
signal isSet
Text {
text: qsTr("contact_presence_button_set_custom_status_title")
horizontalAlignment: Text.AlignHCenter
color: DefaultStyle.main2_600
font: Typography.p2
}
Rectangle {
width: parent.width
height: 150 * DefaultStyle.dp
color: "transparent"
border.color: DefaultStyle.main1_500_main
border.width: 1 * DefaultStyle.dp
radius: 8 * DefaultStyle.dp
ColumnLayout {
anchors.fill: parent
anchors.margins: 10 * DefaultStyle.dp
TextEdit {
id: statusMessage
wrapMode: TextEdit.Wrap
font: Typography.p1
color: DefaultStyle.main2_500_main
Layout.fillHeight: true
Layout.fillWidth: true
property string previoustext: ""
text: mainItem.accountCore.presenceNote
onTextChanged: {
if (statusMessage.text.length > accountCore.maxPresenceNoteSize) {
statusMessage.text = previoustext
statusMessage.cursorPosition = statusMessage.text.length
} else {
previoustext = statusMessage.text
}
}
}
Item {
Layout.fillHeight: true
}
Text {
Layout.fillWidth: true
text: statusMessage.text.length + " / " + accountCore.maxPresenceNoteSize
font: Typography.p1
color: DefaultStyle.main2_400
horizontalAlignment: Text.AlignRight
}
}
}
Row {
spacing: 10 * DefaultStyle.dp
anchors.right: parent.right
SmallButton {
style: ButtonStyle.secondary
text: qsTr("contact_presence_button_save_custom_status")
enabled: statusMessage.text.length > 0
onClicked: {
mainItem.accountCore.presenceNote = statusMessage.text
mainItem.isSet()
}
}
}
}