fix delete history

restore last active tab on launch

fix #LINQT-1246 barre de scroll horizontale

fix call notif ui + main window coordinates

blason bleu confiance 100%

fix contact searchbar

fix contact scrollbar

fix zrtp incoming call

remove shadow effect not in mockup
This commit is contained in:
Gaelle Braud 2024-06-26 17:25:22 +02:00 committed by gaelle
parent e4d6cb4dfd
commit e8845e271d
15 changed files with 378 additions and 361 deletions

View file

@ -362,6 +362,19 @@ void Settings::setFirstLaunch(bool first) {
} }
} }
void Settings::setLastActiveTabIndex(int index) {
auto lastActiveIndex = getLastActiveTabIndex();
if (lastActiveIndex != index) {
mAppSettings.setValue("lastActiveTabIndex", index);
mAppSettings.sync();
emit lastActiveTabIndexChanged();
}
}
int Settings::getLastActiveTabIndex() {
return mAppSettings.value("lastActiveTabIndex", 1).toInt();
}
void Settings::setDisplayDeviceCheckConfirmation(bool display) { void Settings::setDisplayDeviceCheckConfirmation(bool display) {
if (getDisplayDeviceCheckConfirmation() != display) { if (getDisplayDeviceCheckConfirmation() != display) {
mAppSettings.setValue("displayDeviceCheckConfirmation", display); mAppSettings.setValue("displayDeviceCheckConfirmation", display);

View file

@ -81,6 +81,10 @@ public:
Q_INVOKABLE void setDisplayDeviceCheckConfirmation(bool display); Q_INVOKABLE void setDisplayDeviceCheckConfirmation(bool display);
Q_INVOKABLE bool getDisplayDeviceCheckConfirmation() const; Q_INVOKABLE bool getDisplayDeviceCheckConfirmation() const;
// Used to restore the last active index on launch
Q_INVOKABLE void setLastActiveTabIndex(int index);
Q_INVOKABLE int getLastActiveTabIndex();
// Security. -------------------------------------------------------------------- // Security. --------------------------------------------------------------------
bool getVfsEnabled() { bool getVfsEnabled() {
return mVfsEnabled; return mVfsEnabled;
@ -198,6 +202,8 @@ signals:
void firstLaunchChanged(bool firstLaunch); void firstLaunchChanged(bool firstLaunch);
void showVerifyDeviceConfirmationChanged(bool showVerifyDeviceConfirmation); void showVerifyDeviceConfirmationChanged(bool showVerifyDeviceConfirmation);
void lastActiveTabIndexChanged();
private: private:
std::shared_ptr<SettingsModel> mSettingsModel; std::shared_ptr<SettingsModel> mSettingsModel;

View file

@ -7,6 +7,8 @@ import SettingsCpp 1.0
ApplicationWindow { ApplicationWindow {
id: mainWindow id: mainWindow
x: 0
y: 0
width: Math.min(1512 * DefaultStyle.dp, Screen.desktopAvailableWidth) width: Math.min(1512 * DefaultStyle.dp, Screen.desktopAvailableWidth)
height: Math.min(982 * DefaultStyle.dp, Screen.desktopAvailableHeight) height: Math.min(982 * DefaultStyle.dp, Screen.desktopAvailableHeight)

View file

@ -24,8 +24,8 @@ AppWindow {
property var transferState: call && call.core.transferState property var transferState: call && call.core.transferState
onCallStateChanged: { onCallStateChanged: {
if (callState === LinphoneEnums.CallState.Connected) { if (callState === LinphoneEnums.CallState.Connected || callState === LinphoneEnums.CallState.StreamsRunning) {
if (middleItemStackView.currentItem != inCallItem) { if (middleItemStackView.currentItem.objectName != inCallItem) {
middleItemStackView.replace(inCallItem) middleItemStackView.replace(inCallItem)
bottomButtonsLayout.visible = true bottomButtonsLayout.visible = true
} }
@ -123,13 +123,7 @@ AppWindow {
} }
} }
} }
Component.onCompleted: {
if(call && call.core.encryption === LinphoneEnums.MediaEncryption.Zrtp && (!call.core.tokenVerified || call.core.isMismatch)) {
zrtpValidation.open()
}
}
Timer { Timer {
id: autoCloseWindow id: autoCloseWindow
interval: 2000 interval: 2000
@ -480,7 +474,6 @@ AppWindow {
initialItem: inCallItem initialItem: inCallItem
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
} }
OngoingCallRightPanel { OngoingCallRightPanel {
id: rightPanel id: rightPanel

View file

@ -108,6 +108,7 @@ Item {
Layout.preferredWidth: 82 * DefaultStyle.dp Layout.preferredWidth: 82 * DefaultStyle.dp
defaultAccount: accountProxy.defaultAccount defaultAccount: accountProxy.defaultAccount
property int unreadMessages: defaultAccount.core.unreadMessageNotifications property int unreadMessages: defaultAccount.core.unreadMessageNotifications
currentIndex: SettingsCpp.getLastActiveTabIndex()
model: [ model: [
{icon: AppIcons.phone, selectedIcon: AppIcons.phoneSelected, label: qsTr("Appels")}, {icon: AppIcons.phone, selectedIcon: AppIcons.phoneSelected, label: qsTr("Appels")},
{icon: AppIcons.adressBook, selectedIcon: AppIcons.adressBookSelected, label: qsTr("Contacts")}, {icon: AppIcons.adressBook, selectedIcon: AppIcons.adressBookSelected, label: qsTr("Contacts")},
@ -115,6 +116,7 @@ Item {
{icon: AppIcons.videoconference, selectedIcon: AppIcons.videoconferenceSelected, label: qsTr("Réunions"), visible: !SettingsCpp.disableMeetingsFeature} {icon: AppIcons.videoconference, selectedIcon: AppIcons.videoconferenceSelected, label: qsTr("Réunions"), visible: !SettingsCpp.disableMeetingsFeature}
] ]
onCurrentIndexChanged: { onCurrentIndexChanged: {
SettingsCpp.setLastActiveTabIndex(currentIndex)
if (currentIndex === 0) accountProxy.defaultAccount.core.lResetMissedCalls() if (currentIndex === 0) accountProxy.defaultAccount.core.lResetMissedCalls()
if (mainItem.contextualMenuOpenedComponent) { if (mainItem.contextualMenuOpenedComponent) {
closeContextualMenuComponent() closeContextualMenuComponent()

View file

@ -42,7 +42,7 @@ FocusScope {
numericPad: mainItem.numPad numericPad: mainItem.numPad
KeyNavigation.down: grouCallButton KeyNavigation.down: grouCallButton
} }
Control.ScrollView { Flickable {
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
Layout.topMargin: 25 * DefaultStyle.dp Layout.topMargin: 25 * DefaultStyle.dp

View file

@ -33,7 +33,9 @@ StackView {
onHaveAvatarChanged: replace(haveAvatar ? avatar : initials, StackView.Immediate) onHaveAvatarChanged: replace(haveAvatar ? avatar : initials, StackView.Immediate)
property bool secured: false property bool secured: contact
? contact.core.devices.length != 0 && contact.core.verifiedDeviceCount === contact.core.devices.length
: false
property bool displayPresence: (account || contact) && (account property bool displayPresence: (account || contact) && (account
? account.core.registrationState != LinphoneEnums.RegistrationState.Progress && account.core.registrationState != LinphoneEnums.RegistrationState.Refreshing ? account.core.registrationState != LinphoneEnums.RegistrationState.Progress && account.core.registrationState != LinphoneEnums.RegistrationState.Refreshing
: contact.core.consolidatedPresence != LinphoneEnums.ConsolidatedPresence.Offline) : contact.core.consolidatedPresence != LinphoneEnums.ConsolidatedPresence.Offline)
@ -66,8 +68,9 @@ StackView {
width: mainItem.width/4.5 width: mainItem.width/4.5
height: width height: width
radius: width / 2 radius: width / 2
x: 2 * mainItem.width / 3 anchors.bottom: parent.bottom
y: 6 * mainItem.height / 7 anchors.right: parent.right
anchors.rightMargin: mainItem.width / 15
z: 1 z: 1
color: account color: account
? account.core.registrationState == LinphoneEnums.RegistrationState.Ok ? account.core.registrationState == LinphoneEnums.RegistrationState.Ok
@ -93,33 +96,47 @@ StackView {
} }
Component{ Component{
id: initials id: initials
Rectangle { Item {
id: initialItem id: avatarItem
property string initials: UtilsCpp.getInitials(mainItem.displayNameVal)
radius: width / 2
color: DefaultStyle.main2_200
height: mainItem.height height: mainItem.height
width: height width: height
Text { Rectangle {
anchors.fill: parent id: initialItem
anchors.centerIn: parent property string initials: UtilsCpp.getInitials(mainItem.displayNameVal)
verticalAlignment: Text.AlignVCenter radius: width / 2
horizontalAlignment: Text.AlignHCenter color: DefaultStyle.main2_200
text: initialItem.initials height: mainItem.height
font { width: height
pixelSize: initialItem.height * 36 / 120 Text {
weight: 800 * DefaultStyle.dp anchors.fill: parent
capitalization: Font.AllUppercase anchors.centerIn: parent
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
text: initialItem.initials
font {
pixelSize: initialItem.height * 36 / 120
weight: 800 * DefaultStyle.dp
capitalization: Font.AllUppercase
}
}
Image {
id: initialImg
visible: initialItem.initials == ''
width: mainItem.width/3
height: width
source: AppIcons.profile
sourceSize.width: width
sourceSize.height: height
anchors.centerIn: parent
} }
} }
Image { MultiEffect {
visible: initialItem.initials == '' source: initialItem
width: mainItem.width/3 anchors.fill: initialItem
height: width shadowEnabled: true
source: AppIcons.profile shadowBlur: 1
sourceSize.width: width shadowColor: DefaultStyle.grey_1000
sourceSize.height: height shadowOpacity: 0.1
anchors.centerIn: parent
} }
} }
} }

View file

@ -168,6 +168,7 @@ ListView {
id: actionsRow id: actionsRow
z: 1 z: 1
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: 5 * DefaultStyle.dp
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
spacing: 10 * DefaultStyle.dp // TODO : change when mockup ready spacing: 10 * DefaultStyle.dp // TODO : change when mockup ready
RowLayout{ RowLayout{

View file

@ -13,13 +13,13 @@ Popup {
leftPadding: 10 * DefaultStyle.dp leftPadding: 10 * DefaultStyle.dp
topPadding: 10 * DefaultStyle.dp topPadding: 10 * DefaultStyle.dp
bottomPadding: 10 * DefaultStyle.dp bottomPadding: 10 * DefaultStyle.dp
underlineColor: DefaultStyle.main1_500_main
property int radius: 16 * DefaultStyle.dp property int radius: 16 * DefaultStyle.dp
property color underlineColor: DefaultStyle.main1_500_main
property alias buttons: buttonsLayout.data
property alias content: contentLayout.data
property string title property string title
property string text property string text
property string details property string details
property alias content: contentLayout.data
property alias buttons: buttonsLayout.data
property alias firstButton: firstButtonId property alias firstButton: firstButtonId
property alias secondButton: secondButtonId property alias secondButton: secondButtonId
property bool firstButtonAccept: true property bool firstButtonAccept: true
@ -27,40 +27,10 @@ Popup {
signal accepted() signal accepted()
signal rejected() signal rejected()
background: Item {
anchors.fill: parent
Rectangle {
visible: mainItem.underlineColor != undefined
width: mainItem.width
x: backgroundItem.x
y: backgroundItem.y
height: backgroundItem.height + 2 * DefaultStyle.dp
color: mainItem.underlineColor
radius: mainItem.radius
}
Rectangle {
id: backgroundItem
anchors.fill: parent
width: mainItem.width
height: mainItem.implicitHeight
radius: mainItem.radius
color: DefaultStyle.grey_0
border.color: DefaultStyle.grey_0
}
MultiEffect {
anchors.fill: backgroundItem
source: backgroundItem
shadowEnabled: true
shadowColor: DefaultStyle.grey_900
shadowBlur: 1.0
shadowOpacity: 0.1
}
}
contentItem: FocusScope{ contentItem: FocusScope{
height: contentLayout.implicitHeight height: child.implicitHeight
width: contentLayout.implicitWidth width: child.implicitWidth
onVisibleChanged: { onVisibleChanged: {
if(visible) forceActiveFocus() if(visible) forceActiveFocus()
} }
@ -71,8 +41,9 @@ Popup {
} }
} }
ColumnLayout { ColumnLayout {
id: child
anchors.fill: parent anchors.fill: parent
spacing: 20 * DefaultStyle.dp spacing: 15 * DefaultStyle.dp
Text{ Text{
id: titleText id: titleText
Layout.fillWidth: true Layout.fillWidth: true
@ -96,7 +67,6 @@ Popup {
id: defaultText id: defaultText
visible: text.length != 0 visible: text.length != 0
Layout.fillWidth: true Layout.fillWidth: true
//Layout.preferredWidth: 278 * DefaultStyle.dp
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
text: mainItem.text text: mainItem.text
font { font {

View file

@ -41,17 +41,17 @@ Item {
height: 50 * DefaultStyle.dp height: 50 * DefaultStyle.dp
visible: parent.containsMouse || isSelected visible: parent.containsMouse || isSelected
} }
MultiEffect { // MultiEffect {
enabled: mainItem.shadowEnabled // enabled: mainItem.shadowEnabled
anchors.fill: background // anchors.fill: background
source: background // source: background
visible: mainItem.shadowEnabled // visible: mainItem.shadowEnabled
// Crash : https://bugreports.qt.io/browse/QTBUG-124730 // // Crash : https://bugreports.qt.io/browse/QTBUG-124730
shadowEnabled: true //mainItem.shadowEnabled // shadowEnabled: true //mainItem.shadowEnabled
shadowColor: DefaultStyle.grey_1000 // shadowColor: DefaultStyle.grey_1000
shadowBlur: 1 // shadowBlur: 1
shadowOpacity: mainItem.shadowEnabled ? 0.5 : 0.0 // shadowOpacity: mainItem.shadowEnabled ? 0.5 : 0.0
} // }
onClicked: { onClicked: {
mainItem.selected() mainItem.selected()
} }

View file

@ -7,9 +7,8 @@ import UtilsCpp
Notification { Notification {
id: mainItem id: mainItem
radius: 20 * DefaultStyle.dp radius: 20 * DefaultStyle.dp
overriddenHeight: 101 * DefaultStyle.dp overriddenWidth: content.implicitWidth//101 * DefaultStyle.dp
overriddenWidth: 422 * DefaultStyle.dp overriddenHeight: content.implicitHeight//422 * DefaultStyle.dp
readonly property var call: notificationData && notificationData.call readonly property var call: notificationData && notificationData.call
property var state: call.core.state property var state: call.core.state
onStateChanged:{ onStateChanged:{
@ -18,86 +17,96 @@ Notification {
} }
} }
RowLayout { Popup {
anchors.fill: parent id: content
anchors.leftMargin: 19 * DefaultStyle.dp visible: mainItem.visible
anchors.rightMargin: 19 * DefaultStyle.dp leftPadding: 19 * DefaultStyle.dp
anchors.bottomMargin: 15 * DefaultStyle.dp rightPadding: 19 * DefaultStyle.dp
anchors.topMargin: 15 * DefaultStyle.dp topPadding: 15 * DefaultStyle.dp
spacing: 30 * DefaultStyle.dp bottomPadding: 15 * DefaultStyle.dp
RowLayout { background: Item{}
Layout.fillWidth: true contentItem: RowLayout {
Layout.alignment: Qt.AlignLeft id: notifContent
spacing: 13 * DefaultStyle.dp
Avatar { spacing: 30 * DefaultStyle.dp
Layout.preferredWidth: 45 * DefaultStyle.dp height: childrenRect.height
Layout.preferredHeight: 45 * DefaultStyle.dp width: childrenRect.width
call: mainItem.call RowLayout {
} Layout.fillWidth: true
ColumnLayout { Layout.alignment: Qt.AlignLeft
Text { spacing: 13 * DefaultStyle.dp
property var remoteAddress: UtilsCpp.getDisplayName(call.core.peerAddress) Layout.preferredHeight: childrenRect.height
text: remoteAddress ? remoteAddress.value : "" Layout.preferredWidth: childrenRect.width
color: DefaultStyle.grey_600 Avatar {
font { Layout.preferredWidth: 45 * DefaultStyle.dp
pixelSize: 20 * DefaultStyle.dp Layout.preferredHeight: 45 * DefaultStyle.dp
weight: 800 * DefaultStyle.dp call: mainItem.call
capitalization: Font.Capitalize
}
} }
RowLayout { ColumnLayout {
EffectImage {
imageSource: AppIcons.arrowDownLeft
colorizationColor: DefaultStyle.success_500main
Layout.preferredWidth: 24 * DefaultStyle.dp
Layout.preferredHeight: 24 * DefaultStyle.dp
}
Text { Text {
Layout.fillWidth: true property var remoteAddress: UtilsCpp.getDisplayName(call.core.peerAddress)
elide: Text.ElideRight text: remoteAddress ? remoteAddress.value : ""
property var localAddress: UtilsCpp.getDisplayName(call.core.localAddress)
text: qsTr("Appel entrant%1").arg(localAddress ? qsTr(" pour %1").arg(localAddress.value) : "") //call.core.peerAddress
color: DefaultStyle.grey_600 color: DefaultStyle.grey_600
font { font {
pixelSize: 13 * DefaultStyle.dp pixelSize: 20 * DefaultStyle.dp
weight: 400 * DefaultStyle.dp weight: 800 * DefaultStyle.dp
capitalization: Font.Capitalize
}
}
RowLayout {
EffectImage {
imageSource: AppIcons.arrowDownLeft
colorizationColor: DefaultStyle.success_500main
Layout.preferredWidth: 24 * DefaultStyle.dp
Layout.preferredHeight: 24 * DefaultStyle.dp
}
Text {
Layout.fillWidth: true
property var localAddress: UtilsCpp.getDisplayName(call.core.localAddress)
text: qsTr("Appel entrant")//.arg(localAddress ? qsTr(" pour %1").arg(localAddress.value) : "") //call.core.peerAddress
color: DefaultStyle.grey_600
font {
pixelSize: 13 * DefaultStyle.dp
weight: 400 * DefaultStyle.dp
}
} }
} }
} }
} }
}
RowLayout { RowLayout {
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
Layout.fillWidth: true Layout.fillWidth: true
spacing: 26 * DefaultStyle.dp spacing: 26 * DefaultStyle.dp
Button { Button {
color: DefaultStyle.success_500main color: DefaultStyle.success_500main
Layout.preferredWidth: 75 * DefaultStyle.dp pressedColor: DefaultStyle.success_500main_darker
Layout.preferredHeight: 55 * DefaultStyle.dp Layout.preferredWidth: 75 * DefaultStyle.dp
contentItem: EffectImage { Layout.preferredHeight: 55 * DefaultStyle.dp
colorizationColor: DefaultStyle.grey_0 contentItem: EffectImage {
imageSource: AppIcons.phone colorizationColor: DefaultStyle.grey_0
imageWidth: 32 * DefaultStyle.dp imageSource: AppIcons.phone
imageHeight: 32 * DefaultStyle.dp imageWidth: 32 * DefaultStyle.dp
imageHeight: 32 * DefaultStyle.dp
}
onClicked: {
mainItem.call.core.lAccept(false)
UtilsCpp.openCallsWindow(mainItem.call)
}
} }
onClicked: { Button {
mainItem.call.core.lAccept(false) color: DefaultStyle.danger_500main
UtilsCpp.openCallsWindow(mainItem.call) Layout.preferredWidth: 75 * DefaultStyle.dp
} Layout.preferredHeight: 55 * DefaultStyle.dp
} contentItem: EffectImage {
Button { colorizationColor: DefaultStyle.grey_0
color: DefaultStyle.danger_500main imageSource: AppIcons.endCall
Layout.preferredWidth: 75 * DefaultStyle.dp imageWidth: 32 * DefaultStyle.dp
Layout.preferredHeight: 55 * DefaultStyle.dp imageHeight: 32 * DefaultStyle.dp
contentItem: EffectImage { }
colorizationColor: DefaultStyle.grey_0 onClicked: {
imageSource: AppIcons.endCall mainItem.call.core.lDecline()
imageWidth: 32 * DefaultStyle.dp }
imageHeight: 32 * DefaultStyle.dp
}
onClicked: {
mainItem.call.core.lDecline()
} }
} }
} }

View file

@ -51,73 +51,77 @@ ColumnLayout {
} }
} }
Item {
Layout.preferredWidth: 360 * DefaultStyle.dp
Layout.preferredHeight: detailAvatar.height
// Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
Avatar {
id: detailAvatar
anchors.horizontalCenter: parent.horizontalCenter
width: 100 * DefaultStyle.dp
height: 100 * DefaultStyle.dp
contact: mainItem.contact || null
address: mainItem.conferenceInfo
? mainItem.conferenceInfo.core.subject
: mainItem.contactAddress || mainItem.contactName
}
Item {
id: rightButton
anchors.right: parent.right
anchors.verticalCenter: detailAvatar.verticalCenter
anchors.rightMargin: 20 * DefaultStyle.dp
width: 30 * DefaultStyle.dp
height: 30 * DefaultStyle.dp
}
}
ColumnLayout { ColumnLayout {
Layout.alignment: Qt.AlignHCenter spacing: 13 * DefaultStyle.dp
Layout.preferredWidth: 360 * DefaultStyle.dp Item {
Text { Layout.preferredWidth: 360 * DefaultStyle.dp
Layout.preferredHeight: detailAvatar.height
// Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
Layout.fillWidth: true Avatar {
horizontalAlignment: Text.AlignHCenter id: detailAvatar
wrapMode: Text.WrapAnywhere anchors.horizontalCenter: parent.horizontalCenter
elide: Text.ElideRight width: 100 * DefaultStyle.dp
text: mainItem.contactName height: 100 * DefaultStyle.dp
maximumLineCount: 1 contact: mainItem.contact || null
font { address: mainItem.conferenceInfo
pixelSize: 14 * DefaultStyle.dp ? mainItem.conferenceInfo.core.subject
weight: 400 * DefaultStyle.dp : mainItem.contactAddress || mainItem.contactName
capitalization: Font.Capitalize }
Item {
id: rightButton
anchors.right: parent.right
anchors.verticalCenter: detailAvatar.verticalCenter
anchors.rightMargin: 20 * DefaultStyle.dp
width: 30 * DefaultStyle.dp
height: 30 * DefaultStyle.dp
} }
} }
Text { ColumnLayout {
property var mode : contact ? contact.core.consolidatedPresence : -1
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
horizontalAlignment: Text.AlignHCenter Layout.preferredWidth: 360 * DefaultStyle.dp
visible: mainItem.contact spacing: 2 * DefaultStyle.dp
text: mode === LinphoneEnums.ConsolidatedPresence.Online Text {
? qsTr("En ligne") Layout.alignment: Qt.AlignHCenter
: mode === LinphoneEnums.ConsolidatedPresence.Busy Layout.fillWidth: true
? qsTr("Occupé") horizontalAlignment: Text.AlignHCenter
: mode === LinphoneEnums.ConsolidatedPresence.DoNotDisturb wrapMode: Text.WrapAnywhere
? qsTr("Ne pas déranger") elide: Text.ElideRight
: qsTr("Hors ligne") text: mainItem.contactName
color: mode === LinphoneEnums.ConsolidatedPresence.Online maximumLineCount: 1
? DefaultStyle.success_500main font {
: mode === LinphoneEnums.ConsolidatedPresence.Busy pixelSize: 14 * DefaultStyle.dp
? DefaultStyle.warning_600 weight: 400 * DefaultStyle.dp
: mode === LinphoneEnums.ConsolidatedPresence.DoNotDisturb capitalization: Font.Capitalize
? DefaultStyle.danger_500main }
: DefaultStyle.main2_500main }
font { Text {
pixelSize: 12 * DefaultStyle.dp property var mode : contact ? contact.core.consolidatedPresence : -1
weight: 300 * DefaultStyle.dp Layout.alignment: Qt.AlignHCenter
horizontalAlignment: Text.AlignHCenter
visible: mainItem.contact
text: mode === LinphoneEnums.ConsolidatedPresence.Online
? qsTr("En ligne")
: mode === LinphoneEnums.ConsolidatedPresence.Busy
? qsTr("Occupé")
: mode === LinphoneEnums.ConsolidatedPresence.DoNotDisturb
? qsTr("Ne pas déranger")
: qsTr("Hors ligne")
color: mode === LinphoneEnums.ConsolidatedPresence.Online
? DefaultStyle.success_500main
: mode === LinphoneEnums.ConsolidatedPresence.Busy
? DefaultStyle.warning_600
: mode === LinphoneEnums.ConsolidatedPresence.DoNotDisturb
? DefaultStyle.danger_500main
: DefaultStyle.main2_500main
font {
pixelSize: 12 * DefaultStyle.dp
weight: 300 * DefaultStyle.dp
}
}
Text {
// connection status
} }
}
Text {
// connection status
} }
} }
RowLayout { RowLayout {

View file

@ -168,6 +168,12 @@ AbstractMainPage {
} }
} }
} }
Connections {
target: deleteHistoryPopup
onAccepted: {
if (listStackView.currentItem.listView) listStackView.currentItem.listView.model.removeAllEntries()
}
}
onClicked: { onClicked: {
removeHistory.close() removeHistory.close()
deleteHistoryPopup.open() deleteHistoryPopup.open()

View file

@ -195,167 +195,159 @@ AbstractMainPage {
spacing: 38 * DefaultStyle.dp spacing: 38 * DefaultStyle.dp
SearchBar { SearchBar {
id: searchBar id: searchBar
visible: contactList.count > 0 visible: contactList.model.sourceModel.count != 0
Layout.leftMargin: leftPanel.leftMargin Layout.leftMargin: leftPanel.leftMargin
Layout.rightMargin: leftPanel.rightMargin Layout.rightMargin: leftPanel.rightMargin
Layout.topMargin: 18 * DefaultStyle.dp Layout.topMargin: 18 * DefaultStyle.dp
Layout.fillWidth: true Layout.fillWidth: true
placeholderText: qsTr("Rechercher un contact") placeholderText: qsTr("Rechercher un contact")
} }
Item {
id: contactsArea Flickable {
id: listLayout
contentWidth: width
contentHeight: content.height
clip: true
Control.ScrollBar.vertical: contactsScrollbar
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
Control.ScrollView {
id: listLayout
anchors.fill: parent
contentWidth: width
contentHeight: content.height
clip: true
Control.ScrollBar.vertical: contactsScrollbar
ColumnLayout {
id: content
width: parent.width
spacing: 15 * DefaultStyle.dp
Text {
visible: contactList.count === 0 && favoriteList.count === 0
Layout.alignment: Qt.AlignHCenter
Layout.topMargin: 137 * DefaultStyle.dp
text: qsTr("Aucun contact")
font {
pixelSize: 16 * DefaultStyle.dp
weight: 800 * DefaultStyle.dp
}
}
ColumnLayout { ColumnLayout {
id: content visible: favoriteList.contentHeight > 0
width: parent.width onVisibleChanged: if (visible && !favoriteList.visible) favoriteList.visible = true
// anchors.fill: parent Layout.leftMargin: leftPanel.leftMargin
spacing: 15 * DefaultStyle.dp Layout.rightMargin: leftPanel.rightMargin
Text { spacing: 18 * DefaultStyle.dp
visible: contactList.count === 0 && favoriteList.count === 0 RowLayout {
Layout.alignment: Qt.AlignHCenter spacing: 0
Layout.topMargin: 137 * DefaultStyle.dp Text {
text: qsTr("Aucun contact") text: qsTr("Favoris")
font { font {
pixelSize: 16 * DefaultStyle.dp pixelSize: 16 * DefaultStyle.dp
weight: 800 * DefaultStyle.dp weight: 800 * DefaultStyle.dp
}
}
Item {
Layout.fillWidth: true
}
Button {
background: Item{}
icon.source: favoriteList.visible ? AppIcons.upArrow : AppIcons.downArrow
Layout.preferredWidth: 24 * DefaultStyle.dp
Layout.preferredHeight: 24 * DefaultStyle.dp
icon.width: 24 * DefaultStyle.dp
icon.height: 24 * DefaultStyle.dp
onClicked: favoriteList.visible = !favoriteList.visible
} }
} }
ColumnLayout { ContactsList{
visible: favoriteList.contentHeight > 0 id: favoriteList
onVisibleChanged: if (visible && !favoriteList.visible) favoriteList.visible = true hoverEnabled: mainItem.leftPanelEnabled
Layout.leftMargin: leftPanel.leftMargin Layout.fillWidth: true
Layout.rightMargin: leftPanel.rightMargin Layout.preferredHeight: contentHeight
spacing: 18 * DefaultStyle.dp Control.ScrollBar.vertical.visible: false
RowLayout { showOnlyFavourites: true
spacing: 0 contactMenuVisible: true
Text { model: allFriends
text: qsTr("Favoris") onSelectedContactChanged: {
font { if (selectedContact) {
pixelSize: 16 * DefaultStyle.dp contactList.currentIndex = -1
weight: 800 * DefaultStyle.dp
}
}
Item {
Layout.fillWidth: true
}
Button {
background: Item{}
icon.source: favoriteList.visible ? AppIcons.upArrow : AppIcons.downArrow
Layout.preferredWidth: 24 * DefaultStyle.dp
Layout.preferredHeight: 24 * DefaultStyle.dp
icon.width: 24 * DefaultStyle.dp
icon.height: 24 * DefaultStyle.dp
onClicked: favoriteList.visible = !favoriteList.visible
} }
mainItem.selectedContact = selectedContact
} }
ContactsList{ onContactDeletionRequested: (contact) => {
id: favoriteList dialog.contact = contact
hoverEnabled: mainItem.leftPanelEnabled dialog.open()
Layout.fillWidth: true
Layout.preferredHeight: contentHeight
Control.ScrollBar.vertical.visible: false
showOnlyFavourites: true
contactMenuVisible: true
model: allFriends
onSelectedContactChanged: {
if (selectedContact) {
contactList.currentIndex = -1
}
mainItem.selectedContact = selectedContact
}
onContactDeletionRequested: (contact) => {
dialog.contact = contact
dialog.open()
}
}
}
ColumnLayout {
visible: contactList.count > 0
onVisibleChanged: if (visible && !contactList.visible) contactList.visible = true
Layout.leftMargin: leftPanel.leftMargin
Layout.rightMargin: leftPanel.rightMargin
spacing: 16 * DefaultStyle.dp
RowLayout {
spacing: 0
Text {
text: qsTr("All contacts")
font {
pixelSize: 16 * DefaultStyle.dp
weight: 800 * DefaultStyle.dp
}
}
Item {
Layout.fillWidth: true
}
Button {
background: Item{}
icon.source: contactList.visible ? AppIcons.upArrow : AppIcons.downArrow
Layout.preferredWidth: 24 * DefaultStyle.dp
Layout.preferredHeight: 24 * DefaultStyle.dp
icon.width: 24 * DefaultStyle.dp
icon.height: 24 * DefaultStyle.dp
onClicked: contactList.visible = !contactList.visible
}
}
ContactsList{
id: contactList
onCountChanged: {
if (initialFriendToDisplay.length !== 0) {
if (selectContact(initialFriendToDisplay) != -1) initialFriendToDisplay = ""
}
}
Layout.fillWidth: true
Layout.preferredHeight: contentHeight
interactive: false
Control.ScrollBar.vertical.visible: false
hoverEnabled: mainItem.leftPanelEnabled
contactMenuVisible: true
searchBarText: searchBar.text
model: allFriends
Connections {
target: allFriends
function onFriendCreated(index) {
contactList.currentIndex = index
}
}
onSelectedContactChanged: {
if (selectedContact) {
favoriteList.currentIndex = -1
}
mainItem.selectedContact = selectedContact
}
onContactDeletionRequested: (contact) => {
dialog.contact = contact
dialog.open()
}
} }
} }
} }
ColumnLayout {
ScrollBar { visible: contactList.count > 0
id: contactsScrollbar onVisibleChanged: if (visible && !contactList.visible) contactList.visible = true
anchors.right: listLayout.right Layout.leftMargin: leftPanel.leftMargin
anchors.rightMargin: 8 * DefaultStyle.dp Layout.rightMargin: leftPanel.rightMargin
anchors.top: listLayout.top spacing: 16 * DefaultStyle.dp
anchors.bottom: listLayout.bottom RowLayout {
height: listLayout.availableHeight spacing: 0
active: true Text {
interactive: true text: qsTr("All contacts")
policy: Control.ScrollBar.AsNeeded font {
pixelSize: 16 * DefaultStyle.dp
weight: 800 * DefaultStyle.dp
}
}
Item {
Layout.fillWidth: true
}
Button {
background: Item{}
icon.source: contactList.visible ? AppIcons.upArrow : AppIcons.downArrow
Layout.preferredWidth: 24 * DefaultStyle.dp
Layout.preferredHeight: 24 * DefaultStyle.dp
icon.width: 24 * DefaultStyle.dp
icon.height: 24 * DefaultStyle.dp
onClicked: contactList.visible = !contactList.visible
}
}
ContactsList{
id: contactList
onCountChanged: {
if (initialFriendToDisplay.length !== 0) {
if (selectContact(initialFriendToDisplay) != -1) initialFriendToDisplay = ""
}
}
Layout.fillWidth: true
Layout.preferredHeight: contentHeight
interactive: false
Control.ScrollBar.vertical.visible: false
hoverEnabled: mainItem.leftPanelEnabled
contactMenuVisible: true
searchBarText: searchBar.text
model: allFriends
Connections {
target: allFriends
function onFriendCreated(index) {
contactList.currentIndex = index
}
}
onSelectedContactChanged: {
if (selectedContact) {
favoriteList.currentIndex = -1
}
mainItem.selectedContact = selectedContact
}
onContactDeletionRequested: (contact) => {
dialog.contact = contact
dialog.open()
}
}
} }
} }
}
ScrollBar {
id: contactsScrollbar
anchors.right: listLayout.right
anchors.rightMargin: 8 * DefaultStyle.dp
anchors.top: listLayout.top
anchors.bottom: listLayout.bottom
height: listLayout.height
active: true
interactive: true
policy: Control.ScrollBar.AsNeeded
} }
} }
} }
@ -583,6 +575,7 @@ AbstractMainPage {
} }
} }
RoundedBackgroundControl { RoundedBackgroundControl {
Layout.preferredWidth: 360 * DefaultStyle.dp
contentItem: ColumnLayout { contentItem: ColumnLayout {
spacing: 13 * DefaultStyle.dp spacing: 13 * DefaultStyle.dp
Text { Text {

View file

@ -29,6 +29,7 @@ QtObject {
property color warning_600: "#DBB820" property color warning_600: "#DBB820"
property color danger_500main: "#DD5F5F" property color danger_500main: "#DD5F5F"
property color success_500main: "#4FAE80" property color success_500main: "#4FAE80"
property color success_500main_darker: "#3F8C67"
property color info_500_main: "#4AA8FF" property color info_500_main: "#4AA8FF"
property color vue_meter_light_green: "#6FF88D" property color vue_meter_light_green: "#6FF88D"