linphone-desktop/linphone-app/ui/modules/Common/Misc/MessageBanner.qml
Julien Wadel 91f4d94aae Add a message banner to call view. If the user is alone, display an alone message.
Fix paused view : fix the state display (next to username)and show username in remote view.
Add an API to get participant device count from the conference model.
Reduce mosaic max size before switchçng to lesser quality (9 to 6 participants).
Upgrade message banner to be more customizable on colors and icons.
Hide some buttons if the conference is not ready.
Fix title display if there is no elapsed time (remove the minus character).
2022-08-29 18:37:51 +02:00

76 lines
No EOL
1.7 KiB
QML

import QtQuick 2.7
import QtQuick.Layouts 1.3
import Common 1.0
import Common.Styles 1.0
import Utils 1.0
Rectangle{
id: mainItem
property int fitHeight: visible && opacity > 0 ? 32 : 0
property string noticeBannerText
property bool showIcon: true
property alias pointSize: textItem.font.pointSize
property alias textColor: textItem.color
property alias icon: iconItem.icon
property alias iconColor: iconItem.overwriteColor // = textColor by default
onNoticeBannerTextChanged: if(noticeBannerText!='') mainItem.state = "showed"
color: MessageBannerStyle.color
radius: 10
state: "hidden"
Timer{
id: hideNoticeBanner
interval: 4000
repeat: false
onTriggered: mainItem.state = "hidden"
}
RowLayout{
anchors.centerIn: parent
spacing: 5
Icon{
id: iconItem
icon: mainItem.showIcon ? MessageBannerStyle.copyTextIcon : ''
overwriteColor: textItem.color
iconSize: 20
visible: mainItem.showIcon
}
Text{
id: textItem
Layout.fillHeight: true
Layout.fillWidth: true
text: mainItem.noticeBannerText
font {
pointSize: MessageBannerStyle.pointSize
}
color: MessageBannerStyle.textColor
}
}
states: [
State {
name: "hidden"
PropertyChanges { target: mainItem; opacity: 0 }
},
State {
name: "showed"
PropertyChanges { target: mainItem; opacity: 1 }
}
]
transitions: [
Transition {
from: "*"; to: "showed"
SequentialAnimation{
NumberAnimation{ properties: "opacity"; easing.type: Easing.OutBounce; duration: 500 }
ScriptAction{ script: hideNoticeBanner.start()}
}
},
Transition {
SequentialAnimation{
NumberAnimation{ properties: "opacity"; duration: 1000 }
ScriptAction{ script: mainItem.noticeBannerText = '' }
}
}
]
}// mainItem