linphone-desktop/Linphone/view/Control/Button/Settings/ComboSetting.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

36 lines
1,015 B
QML

import QtQuick
import QtQuick.Controls.Basic
import QtQuick.Layouts
import Linphone
import 'qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js' as Utils
ComboBox {
id: mainItem
Layout.preferredHeight: Utils.getSizeWithScreenRatio(49)
property string propertyName
property var propertyOwner
property var propertyOwnerGui
property alias entries: mainItem.model
oneLine: true
currentIndex: Utils.findIndex(model, function (entry) {
if(propertyOwnerGui)
return Utils.equalObject(entry,propertyOwnerGui.core[propertyName])
else
return Utils.equalObject(entry,propertyOwner[propertyName])
})
onCurrentValueChanged: {
if(propertyOwnerGui) {
binding.when = !Utils.equalObject(currentValue,propertyOwnerGui.core[propertyName])
}else{
binding.when = !Utils.equalObject(currentValue,propertyOwner[propertyName])
}
}
Binding {
id: binding
target: propertyOwnerGui ? propertyOwnerGui.core : propertyOwner
property: propertyName
value: mainItem.currentValue
when: false
}
}