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) {
if (getDisplayDeviceCheckConfirmation() != display) {
mAppSettings.setValue("displayDeviceCheckConfirmation", display);

View file

@ -81,6 +81,10 @@ public:
Q_INVOKABLE void setDisplayDeviceCheckConfirmation(bool display);
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. --------------------------------------------------------------------
bool getVfsEnabled() {
return mVfsEnabled;
@ -198,6 +202,8 @@ signals:
void firstLaunchChanged(bool firstLaunch);
void showVerifyDeviceConfirmationChanged(bool showVerifyDeviceConfirmation);
void lastActiveTabIndexChanged();
private:
std::shared_ptr<SettingsModel> mSettingsModel;

View file

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

View file

@ -24,8 +24,8 @@ AppWindow {
property var transferState: call && call.core.transferState
onCallStateChanged: {
if (callState === LinphoneEnums.CallState.Connected) {
if (middleItemStackView.currentItem != inCallItem) {
if (callState === LinphoneEnums.CallState.Connected || callState === LinphoneEnums.CallState.StreamsRunning) {
if (middleItemStackView.currentItem.objectName != inCallItem) {
middleItemStackView.replace(inCallItem)
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 {
id: autoCloseWindow
interval: 2000
@ -480,7 +474,6 @@ AppWindow {
initialItem: inCallItem
Layout.fillWidth: true
Layout.fillHeight: true
}
OngoingCallRightPanel {
id: rightPanel

View file

@ -108,6 +108,7 @@ Item {
Layout.preferredWidth: 82 * DefaultStyle.dp
defaultAccount: accountProxy.defaultAccount
property int unreadMessages: defaultAccount.core.unreadMessageNotifications
currentIndex: SettingsCpp.getLastActiveTabIndex()
model: [
{icon: AppIcons.phone, selectedIcon: AppIcons.phoneSelected, label: qsTr("Appels")},
{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}
]
onCurrentIndexChanged: {
SettingsCpp.setLastActiveTabIndex(currentIndex)
if (currentIndex === 0) accountProxy.defaultAccount.core.lResetMissedCalls()
if (mainItem.contextualMenuOpenedComponent) {
closeContextualMenuComponent()

View file

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

View file

@ -33,7 +33,9 @@ StackView {
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
? account.core.registrationState != LinphoneEnums.RegistrationState.Progress && account.core.registrationState != LinphoneEnums.RegistrationState.Refreshing
: contact.core.consolidatedPresence != LinphoneEnums.ConsolidatedPresence.Offline)
@ -66,8 +68,9 @@ StackView {
width: mainItem.width/4.5
height: width
radius: width / 2
x: 2 * mainItem.width / 3
y: 6 * mainItem.height / 7
anchors.bottom: parent.bottom
anchors.right: parent.right
anchors.rightMargin: mainItem.width / 15
z: 1
color: account
? account.core.registrationState == LinphoneEnums.RegistrationState.Ok
@ -93,6 +96,10 @@ StackView {
}
Component{
id: initials
Item {
id: avatarItem
height: mainItem.height
width: height
Rectangle {
id: initialItem
property string initials: UtilsCpp.getInitials(mainItem.displayNameVal)
@ -113,6 +120,7 @@ StackView {
}
}
Image {
id: initialImg
visible: initialItem.initials == ''
width: mainItem.width/3
height: width
@ -122,6 +130,15 @@ StackView {
anchors.centerIn: parent
}
}
MultiEffect {
source: initialItem
anchors.fill: initialItem
shadowEnabled: true
shadowBlur: 1
shadowColor: DefaultStyle.grey_1000
shadowOpacity: 0.1
}
}
}
Component{
id: avatar

View file

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

View file

@ -13,13 +13,13 @@ Popup {
leftPadding: 10 * DefaultStyle.dp
topPadding: 10 * DefaultStyle.dp
bottomPadding: 10 * DefaultStyle.dp
underlineColor: DefaultStyle.main1_500_main
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 text
property string details
property alias content: contentLayout.data
property alias buttons: buttonsLayout.data
property alias firstButton: firstButtonId
property alias secondButton: secondButtonId
property bool firstButtonAccept: true
@ -28,39 +28,9 @@ Popup {
signal accepted()
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{
height: contentLayout.implicitHeight
width: contentLayout.implicitWidth
height: child.implicitHeight
width: child.implicitWidth
onVisibleChanged: {
if(visible) forceActiveFocus()
}
@ -71,8 +41,9 @@ Popup {
}
}
ColumnLayout {
id: child
anchors.fill: parent
spacing: 20 * DefaultStyle.dp
spacing: 15 * DefaultStyle.dp
Text{
id: titleText
Layout.fillWidth: true
@ -96,7 +67,6 @@ Popup {
id: defaultText
visible: text.length != 0
Layout.fillWidth: true
//Layout.preferredWidth: 278 * DefaultStyle.dp
Layout.alignment: Qt.AlignCenter
text: mainItem.text
font {

View file

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

View file

@ -7,9 +7,8 @@ import UtilsCpp
Notification {
id: mainItem
radius: 20 * DefaultStyle.dp
overriddenHeight: 101 * DefaultStyle.dp
overriddenWidth: 422 * DefaultStyle.dp
overriddenWidth: content.implicitWidth//101 * DefaultStyle.dp
overriddenHeight: content.implicitHeight//422 * DefaultStyle.dp
readonly property var call: notificationData && notificationData.call
property var state: call.core.state
onStateChanged:{
@ -18,17 +17,26 @@ Notification {
}
}
RowLayout {
anchors.fill: parent
anchors.leftMargin: 19 * DefaultStyle.dp
anchors.rightMargin: 19 * DefaultStyle.dp
anchors.bottomMargin: 15 * DefaultStyle.dp
anchors.topMargin: 15 * DefaultStyle.dp
Popup {
id: content
visible: mainItem.visible
leftPadding: 19 * DefaultStyle.dp
rightPadding: 19 * DefaultStyle.dp
topPadding: 15 * DefaultStyle.dp
bottomPadding: 15 * DefaultStyle.dp
background: Item{}
contentItem: RowLayout {
id: notifContent
spacing: 30 * DefaultStyle.dp
height: childrenRect.height
width: childrenRect.width
RowLayout {
Layout.fillWidth: true
Layout.alignment: Qt.AlignLeft
spacing: 13 * DefaultStyle.dp
Layout.preferredHeight: childrenRect.height
Layout.preferredWidth: childrenRect.width
Avatar {
Layout.preferredWidth: 45 * DefaultStyle.dp
Layout.preferredHeight: 45 * DefaultStyle.dp
@ -54,9 +62,8 @@ Notification {
}
Text {
Layout.fillWidth: true
elide: Text.ElideRight
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
font {
pixelSize: 13 * DefaultStyle.dp
@ -73,6 +80,7 @@ Notification {
spacing: 26 * DefaultStyle.dp
Button {
color: DefaultStyle.success_500main
pressedColor: DefaultStyle.success_500main_darker
Layout.preferredWidth: 75 * DefaultStyle.dp
Layout.preferredHeight: 55 * DefaultStyle.dp
contentItem: EffectImage {
@ -103,3 +111,4 @@ Notification {
}
}
}
}

View file

@ -51,6 +51,8 @@ ColumnLayout {
}
}
ColumnLayout {
spacing: 13 * DefaultStyle.dp
Item {
Layout.preferredWidth: 360 * DefaultStyle.dp
Layout.preferredHeight: detailAvatar.height
@ -78,6 +80,7 @@ ColumnLayout {
ColumnLayout {
Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: 360 * DefaultStyle.dp
spacing: 2 * DefaultStyle.dp
Text {
Layout.alignment: Qt.AlignHCenter
Layout.fillWidth: true
@ -120,6 +123,7 @@ ColumnLayout {
// connection status
}
}
}
RowLayout {
Layout.alignment: Qt.AlignHCenter
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: {
removeHistory.close()
deleteHistoryPopup.open()

View file

@ -195,30 +195,26 @@ AbstractMainPage {
spacing: 38 * DefaultStyle.dp
SearchBar {
id: searchBar
visible: contactList.count > 0
visible: contactList.model.sourceModel.count != 0
Layout.leftMargin: leftPanel.leftMargin
Layout.rightMargin: leftPanel.rightMargin
Layout.topMargin: 18 * DefaultStyle.dp
Layout.fillWidth: true
placeholderText: qsTr("Rechercher un contact")
}
Item {
id: contactsArea
Layout.fillWidth: true
Layout.fillHeight: true
Control.ScrollView {
Flickable {
id: listLayout
anchors.fill: parent
contentWidth: width
contentHeight: content.height
clip: true
Control.ScrollBar.vertical: contactsScrollbar
Layout.fillWidth: true
Layout.fillHeight: true
ColumnLayout {
id: content
width: parent.width
// anchors.fill: parent
spacing: 15 * DefaultStyle.dp
Text {
visible: contactList.count === 0 && favoriteList.count === 0
@ -341,22 +337,18 @@ AbstractMainPage {
}
}
}
}
ScrollBar {
id: contactsScrollbar
anchors.right: listLayout.right
anchors.rightMargin: 8 * DefaultStyle.dp
anchors.top: listLayout.top
anchors.bottom: listLayout.bottom
height: listLayout.availableHeight
height: listLayout.height
active: true
interactive: true
policy: Control.ScrollBar.AsNeeded
}
}
}
}
}
@ -583,6 +575,7 @@ AbstractMainPage {
}
}
RoundedBackgroundControl {
Layout.preferredWidth: 360 * DefaultStyle.dp
contentItem: ColumnLayout {
spacing: 13 * DefaultStyle.dp
Text {

View file

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