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
} }
@ -124,12 +124,6 @@ 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,6 +96,10 @@ StackView {
} }
Component{ Component{
id: initials id: initials
Item {
id: avatarItem
height: mainItem.height
width: height
Rectangle { Rectangle {
id: initialItem id: initialItem
property string initials: UtilsCpp.getInitials(mainItem.displayNameVal) property string initials: UtilsCpp.getInitials(mainItem.displayNameVal)
@ -113,6 +120,7 @@ StackView {
} }
} }
Image { Image {
id: initialImg
visible: initialItem.initials == '' visible: initialItem.initials == ''
width: mainItem.width/3 width: mainItem.width/3
height: width height: width
@ -122,6 +130,15 @@ StackView {
anchors.centerIn: parent anchors.centerIn: parent
} }
} }
MultiEffect {
source: initialItem
anchors.fill: initialItem
shadowEnabled: true
shadowBlur: 1
shadowColor: DefaultStyle.grey_1000
shadowOpacity: 0.1
}
}
} }
Component{ Component{
id: avatar id: avatar

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
@ -28,39 +28,9 @@ 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,17 +17,26 @@ 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
bottomPadding: 15 * DefaultStyle.dp
background: Item{}
contentItem: RowLayout {
id: notifContent
spacing: 30 * DefaultStyle.dp spacing: 30 * DefaultStyle.dp
height: childrenRect.height
width: childrenRect.width
RowLayout { RowLayout {
Layout.fillWidth: true Layout.fillWidth: true
Layout.alignment: Qt.AlignLeft Layout.alignment: Qt.AlignLeft
spacing: 13 * DefaultStyle.dp spacing: 13 * DefaultStyle.dp
Layout.preferredHeight: childrenRect.height
Layout.preferredWidth: childrenRect.width
Avatar { Avatar {
Layout.preferredWidth: 45 * DefaultStyle.dp Layout.preferredWidth: 45 * DefaultStyle.dp
Layout.preferredHeight: 45 * DefaultStyle.dp Layout.preferredHeight: 45 * DefaultStyle.dp
@ -54,9 +62,8 @@ Notification {
} }
Text { Text {
Layout.fillWidth: true Layout.fillWidth: true
elide: Text.ElideRight
property var localAddress: UtilsCpp.getDisplayName(call.core.localAddress) property var localAddress: UtilsCpp.getDisplayName(call.core.localAddress)
text: qsTr("Appel entrant%1").arg(localAddress ? qsTr(" pour %1").arg(localAddress.value) : "") //call.core.peerAddress text: qsTr("Appel entrant")//.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: 13 * DefaultStyle.dp
@ -73,6 +80,7 @@ Notification {
spacing: 26 * DefaultStyle.dp spacing: 26 * DefaultStyle.dp
Button { Button {
color: DefaultStyle.success_500main color: DefaultStyle.success_500main
pressedColor: DefaultStyle.success_500main_darker
Layout.preferredWidth: 75 * DefaultStyle.dp Layout.preferredWidth: 75 * DefaultStyle.dp
Layout.preferredHeight: 55 * DefaultStyle.dp Layout.preferredHeight: 55 * DefaultStyle.dp
contentItem: EffectImage { contentItem: EffectImage {
@ -102,4 +110,5 @@ Notification {
} }
} }
} }
}
} }

View file

@ -51,6 +51,8 @@ ColumnLayout {
} }
} }
ColumnLayout {
spacing: 13 * DefaultStyle.dp
Item { Item {
Layout.preferredWidth: 360 * DefaultStyle.dp Layout.preferredWidth: 360 * DefaultStyle.dp
Layout.preferredHeight: detailAvatar.height Layout.preferredHeight: detailAvatar.height
@ -78,6 +80,7 @@ ColumnLayout {
ColumnLayout { ColumnLayout {
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: 360 * DefaultStyle.dp Layout.preferredWidth: 360 * DefaultStyle.dp
spacing: 2 * DefaultStyle.dp
Text { Text {
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
Layout.fillWidth: true Layout.fillWidth: true
@ -120,6 +123,7 @@ ColumnLayout {
// connection status // connection status
} }
} }
}
RowLayout { RowLayout {
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
spacing: 72 * DefaultStyle.dp spacing: 72 * DefaultStyle.dp

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,30 +195,26 @@ 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
Layout.fillWidth: true
Layout.fillHeight: true
Control.ScrollView { Flickable {
id: listLayout id: listLayout
anchors.fill: parent
contentWidth: width contentWidth: width
contentHeight: content.height contentHeight: content.height
clip: true clip: true
Control.ScrollBar.vertical: contactsScrollbar Control.ScrollBar.vertical: contactsScrollbar
Layout.fillWidth: true
Layout.fillHeight: true
ColumnLayout { ColumnLayout {
id: content id: content
width: parent.width width: parent.width
// anchors.fill: parent
spacing: 15 * DefaultStyle.dp spacing: 15 * DefaultStyle.dp
Text { Text {
visible: contactList.count === 0 && favoriteList.count === 0 visible: contactList.count === 0 && favoriteList.count === 0
@ -341,22 +337,18 @@ AbstractMainPage {
} }
} }
} }
}
ScrollBar { ScrollBar {
id: contactsScrollbar id: contactsScrollbar
anchors.right: listLayout.right anchors.right: listLayout.right
anchors.rightMargin: 8 * DefaultStyle.dp anchors.rightMargin: 8 * DefaultStyle.dp
anchors.top: listLayout.top anchors.top: listLayout.top
anchors.bottom: listLayout.bottom anchors.bottom: listLayout.bottom
height: listLayout.availableHeight height: listLayout.height
active: true active: true
interactive: true interactive: true
policy: Control.ScrollBar.AsNeeded 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"