diff --git a/ui/modules/Linphone/Chat/Chat.js b/ui/modules/Linphone/Chat/Chat.js index 2dce2e211..b60db925f 100644 --- a/ui/modules/Linphone/Chat/Chat.js +++ b/ui/modules/Linphone/Chat/Chat.js @@ -72,7 +72,7 @@ function handleTextChanged () { } function sendMessage (text) { - textArea.item.text = '' + textArea.text = '' chat.bindToEnd = true container.proxyModel.sendMessage(text) } diff --git a/ui/modules/Linphone/Chat/Chat.qml b/ui/modules/Linphone/Chat/Chat.qml index 509263a55..05a48a6b3 100644 --- a/ui/modules/Linphone/Chat/Chat.qml +++ b/ui/modules/Linphone/Chat/Chat.qml @@ -203,33 +203,26 @@ Rectangle { // Send area. // ------------------------------------------------------------------------- - Loader { - id: textArea - + Borders { Layout.fillWidth: true - Layout.preferredHeight: active ? ChatStyle.sendArea.height + ChatStyle.sendArea.border.width : 0 + Layout.preferredHeight: ChatStyle.sendArea.height + ChatStyle.sendArea.border.width - active: SettingsModel.chatEnabled - sourceComponent: Borders { - property alias text: textArea.text + borderColor: ChatStyle.sendArea.border.color + topWidth: ChatStyle.sendArea.border.width + visible: SettingsModel.chatEnabled + + DroppableTextArea { + id: textArea anchors.fill: parent - borderColor: ChatStyle.sendArea.border.color - topWidth: ChatStyle.sendArea.border.width - DroppableTextArea { - id: textArea + dropEnabled: SettingsModel.fileTransferUrl.length > 0 + dropDisabledReason: qsTr('noFileTransferUrl') + placeholderText: qsTr('newMessagePlaceholder') - anchors.fill: parent - - dropEnabled: SettingsModel.fileTransferUrl.length > 0 - dropDisabledReason: qsTr('noFileTransferUrl') - placeholderText: qsTr('newMessagePlaceholder') - - onDropped: Logic.handleFilesDropped(files) - onTextChanged: Logic.handleTextChanged(text) - onValidText: Logic.sendMessage(text) - } + onDropped: Logic.handleFilesDropped(files) + onTextChanged: Logic.handleTextChanged(text) + onValidText: Logic.sendMessage(text) } } } diff --git a/ui/modules/Linphone/Notifications/NotificationReceivedCall.qml b/ui/modules/Linphone/Notifications/NotificationReceivedCall.qml index 323fda355..14f47ae0e 100644 --- a/ui/modules/Linphone/Notifications/NotificationReceivedCall.qml +++ b/ui/modules/Linphone/Notifications/NotificationReceivedCall.qml @@ -54,14 +54,11 @@ Notification { anchors.centerIn: parent iconSize: NotificationReceivedCallStyle.actionArea.iconSize - Loader { - active: SettingsModel.videoSupported - sourceComponent: ActionButton { - icon: 'video_call_accept' - iconSize: acceptActionBar.iconSize + ActionButton { + icon: 'video_call_accept' + visible: SettingsModel.videoSupported - onClicked: notification._close(notification.call.acceptWithVideo) - } + onClicked: notification._close(notification.call.acceptWithVideo) } ActionButton { diff --git a/ui/modules/Linphone/SmartSearchBar/SmartSearchBar.qml b/ui/modules/Linphone/SmartSearchBar/SmartSearchBar.qml index 914d3698a..7ebf490d2 100644 --- a/ui/modules/Linphone/SmartSearchBar/SmartSearchBar.qml +++ b/ui/modules/Linphone/SmartSearchBar/SmartSearchBar.qml @@ -38,12 +38,12 @@ SearchBox { id: view actions: [{ - active: SettingsModel.videoSupported, icon: 'video_call', handler: function (entry) { searchBox.closeMenu() searchBox.launchVideoCall(entry.sipAddress) - } + }, + visible: SettingsModel.videoSupported }, { icon: 'call', handler: function (entry) { diff --git a/ui/modules/Linphone/View/SipAddressesView.qml b/ui/modules/Linphone/View/SipAddressesView.qml index e8f2d4a8b..5224c258a 100644 --- a/ui/modules/Linphone/View/SipAddressesView.qml +++ b/ui/modules/Linphone/View/SipAddressesView.qml @@ -240,17 +240,14 @@ ScrollableListView { Repeater { model: sipAddressesView.actions - Loader { - active: { - var active = sipAddressesView.actions[index].active - return active === undefined || active + ActionButton { + icon: modelData.icon + visible: { + var visible = sipAddressesView.actions[index].visible + return visible === undefined || visible } - sourceComponent: ActionButton { - icon: modelData.icon - iconSize: actionBar.iconSize - onClicked: sipAddressesView.actions[index].handler($sipAddress) - } + onClicked: sipAddressesView.actions[index].handler($sipAddress) } } } diff --git a/ui/views/App/Calls/Dialogs/CallSipAddress.qml b/ui/views/App/Calls/Dialogs/CallSipAddress.qml index dcea5ec29..d27cda95a 100644 --- a/ui/views/App/Calls/Dialogs/CallSipAddress.qml +++ b/ui/views/App/Calls/Dialogs/CallSipAddress.qml @@ -59,12 +59,12 @@ DialogPlus { anchors.fill: parent actions: [{ - active: SettingsModel.videoSupported, icon: 'video_call', handler: function (entry) { CallsListModel.launchVideoCall(entry.sipAddress) exit(1) - } + }, + visible: SettingsModel.videoSupported }, { icon: 'call', handler: function (entry) { diff --git a/ui/views/App/Calls/Incall.qml b/ui/views/App/Calls/Incall.qml index 2a388e9cf..35d373951 100644 --- a/ui/views/App/Calls/Incall.qml +++ b/ui/views/App/Calls/Incall.qml @@ -343,20 +343,17 @@ Rectangle { } } - Loader { - active: SettingsModel.videoSupported - sourceComponent: ActionSwitch { - enabled: incall.call.videoEnabled - icon: 'camera' - iconSize: CallStyle.actionArea.iconSize - updating: incall.call.updating + ActionSwitch { + enabled: incall.call.videoEnabled + icon: 'camera' + updating: incall.call.updating + visible: SettingsModel.videoSupported - onClicked: incall.call.videoEnabled = !enabled + onClicked: incall.call.videoEnabled = !enabled - TooltipArea { - text: qsTr('pendingRequestLabel') - visible: parent.updating - } + TooltipArea { + text: qsTr('pendingRequestLabel') + visible: parent.updating } } diff --git a/ui/views/App/Calls/IncomingCall.qml b/ui/views/App/Calls/IncomingCall.qml index 0044e6494..6d38a015c 100644 --- a/ui/views/App/Calls/IncomingCall.qml +++ b/ui/views/App/Calls/IncomingCall.qml @@ -14,19 +14,15 @@ AbstractStartingCall { anchors.centerIn: parent iconSize: CallStyle.actionArea.iconSize - Loader { - active: SettingsModel.videoSupported - sourceComponent: ActionButton { - icon: 'video_call_accept' - iconSize: actionBar.iconSize + ActionButton { + icon: 'video_call_accept' + visible: SettingsModel.videoSupported - onClicked: call.acceptWithVideo() - } + onClicked: call.acceptWithVideo() } ActionButton { icon: 'call_accept' - onClicked: call.accept() } } diff --git a/ui/views/App/Main/Contacts.qml b/ui/views/App/Main/Contacts.qml index aa16d0a61..4d96418cf 100644 --- a/ui/views/App/Main/Contacts.qml +++ b/ui/views/App/Main/Contacts.qml @@ -124,22 +124,17 @@ ColumnLayout { Item { ActionBar { - id: actionBar - anchors { left: parent.left verticalCenter: parent.verticalCenter } iconSize: ContactsStyle.contact.actionButtonsSize - Loader { - active: SettingsModel.videoSupported - sourceComponent: ActionButton { - icon: 'video_call' - iconSize: actionBar.iconSize + ActionButton { + icon: 'video_call' + visible: SettingsModel.videoSupported - onClicked: actions.itemAt(0).open() - } + onClicked: actions.itemAt(0).open() } ActionButton { diff --git a/ui/views/App/Main/Conversation.qml b/ui/views/App/Main/Conversation.qml index d4872852c..c1184e785 100644 --- a/ui/views/App/Main/Conversation.qml +++ b/ui/views/App/Main/Conversation.qml @@ -70,19 +70,14 @@ ColumnLayout { spacing: ConversationStyle.bar.actions.spacing ActionBar { - id: actionBar - anchors.verticalCenter: parent.verticalCenter iconSize: ConversationStyle.bar.actions.call.iconSize - Loader { - active: SettingsModel.videoSupported - sourceComponent: ActionButton { - icon: 'video_call' - iconSize: actionBar.iconSize + ActionButton { + icon: 'video_call' + visible: SettingsModel.videoSupported - onClicked: CallsListModel.launchVideoCall(conversation.sipAddress) - } + onClicked: CallsListModel.launchVideoCall(conversation.sipAddress) } ActionButton { @@ -118,33 +113,30 @@ ColumnLayout { // Messages/Calls filters. // --------------------------------------------------------------------------- - Loader { + Borders { Layout.fillWidth: true Layout.preferredHeight: active ? ConversationStyle.filters.height : 0 - active: SettingsModel.chatEnabled - sourceComponent: Borders { - anchors.fill: parent - borderColor: ConversationStyle.filters.border.color - bottomWidth: ConversationStyle.filters.border.bottomWidth - color: ConversationStyle.filters.backgroundColor - topWidth: ConversationStyle.filters.border.topWidth + borderColor: ConversationStyle.filters.border.color + bottomWidth: ConversationStyle.filters.border.bottomWidth + color: ConversationStyle.filters.backgroundColor + topWidth: ConversationStyle.filters.border.topWidth + visible: SettingsModel.chatEnabled - ExclusiveButtons { - anchors { - left: parent.left - leftMargin: ConversationStyle.filters.leftMargin - verticalCenter: parent.verticalCenter - } - - texts: [ - qsTr('displayCallsAndMessages'), - qsTr('displayCalls'), - qsTr('displayMessages') - ] - - onClicked: Logic.updateChatFilter(button) + ExclusiveButtons { + anchors { + left: parent.left + leftMargin: ConversationStyle.filters.leftMargin + verticalCenter: parent.verticalCenter } + + texts: [ + qsTr('displayCallsAndMessages'), + qsTr('displayCalls'), + qsTr('displayMessages') + ] + + onClicked: Logic.updateChatFilter(button) } } diff --git a/ui/views/App/Settings/SettingsWindow.qml b/ui/views/App/Settings/SettingsWindow.qml index 8902914f2..128cf0b3a 100644 --- a/ui/views/App/Settings/SettingsWindow.qml +++ b/ui/views/App/Settings/SettingsWindow.qml @@ -62,7 +62,6 @@ ApplicationWindow { TabButton { enabled: SettingsModel.videoSupported - iconName: 'settings_video' text: qsTr('videoTab') width: implicitWidth