Commit e046daae authored by Ronan's avatar Ronan
Browse files

fix(app): remove useless loaders

parent eb15c571
......@@ -72,7 +72,7 @@ function handleTextChanged () {
}
function sendMessage (text) {
textArea.item.text = ''
textArea.text = ''
chat.bindToEnd = true
container.proxyModel.sendMessage(text)
}
......@@ -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
active: SettingsModel.chatEnabled
sourceComponent: Borders {
property alias text: textArea.text
Layout.preferredHeight: ChatStyle.sendArea.height + ChatStyle.sendArea.border.width
anchors.fill: parent
borderColor: ChatStyle.sendArea.border.color
topWidth: ChatStyle.sendArea.border.width
borderColor: ChatStyle.sendArea.border.color
topWidth: ChatStyle.sendArea.border.width
visible: SettingsModel.chatEnabled
DroppableTextArea {
id: textArea
DroppableTextArea {
id: textArea
anchors.fill: parent
anchors.fill: parent
dropEnabled: SettingsModel.fileTransferUrl.length > 0
dropDisabledReason: qsTr('noFileTransferUrl')
placeholderText: qsTr('newMessagePlaceholder')
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)
}
}
}
......
......@@ -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
onClicked: notification._close(notification.call.acceptWithVideo)
}
ActionButton {
icon: 'video_call_accept'
visible: SettingsModel.videoSupported
onClicked: notification._close(notification.call.acceptWithVideo)
}
ActionButton {
......
......@@ -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) {
......
......@@ -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)
}
}
}
......
......@@ -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) {
......
......@@ -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
}
}
......
......@@ -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
onClicked: call.acceptWithVideo()
}
ActionButton {
icon: 'video_call_accept'
visible: SettingsModel.videoSupported
onClicked: call.acceptWithVideo()
}
ActionButton {
icon: 'call_accept'
onClicked: call.accept()
}
}
......
......@@ -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 {
......
......@@ -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
ExclusiveButtons {
anchors {
left: parent.left
leftMargin: ConversationStyle.filters.leftMargin
verticalCenter: parent.verticalCenter
}
texts: [
qsTr('displayCallsAndMessages'),
qsTr('displayCalls'),
qsTr('displayMessages')
]
borderColor: ConversationStyle.filters.border.color
bottomWidth: ConversationStyle.filters.border.bottomWidth
color: ConversationStyle.filters.backgroundColor
topWidth: ConversationStyle.filters.border.topWidth
visible: SettingsModel.chatEnabled
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)
}
}
......
......@@ -62,7 +62,6 @@ ApplicationWindow {
TabButton {
enabled: SettingsModel.videoSupported
iconName: 'settings_video'
text: qsTr('videoTab')
width: implicitWidth
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment