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
}
@ -123,13 +123,7 @@ 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,33 +96,47 @@ StackView {
}
Component{
id: initials
Rectangle {
id: initialItem
property string initials: UtilsCpp.getInitials(mainItem.displayNameVal)
radius: width / 2
color: DefaultStyle.main2_200
Item {
id: avatarItem
height: mainItem.height
width: height
Text {
anchors.fill: parent
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
Rectangle {
id: initialItem
property string initials: UtilsCpp.getInitials(mainItem.displayNameVal)
radius: width / 2
color: DefaultStyle.main2_200
height: mainItem.height
width: height
Text {
anchors.fill: parent
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 {
visible: initialItem.initials == ''
width: mainItem.width/3
height: width
source: AppIcons.profile
sourceSize.width: width
sourceSize.height: height
anchors.centerIn: parent
MultiEffect {
source: initialItem
anchors.fill: initialItem
shadowEnabled: true
shadowBlur: 1
shadowColor: DefaultStyle.grey_1000
shadowOpacity: 0.1
}
}
}

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
@ -27,40 +27,10 @@ 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,86 +17,96 @@ 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
spacing: 30 * DefaultStyle.dp
RowLayout {
Layout.fillWidth: true
Layout.alignment: Qt.AlignLeft
spacing: 13 * DefaultStyle.dp
Avatar {
Layout.preferredWidth: 45 * DefaultStyle.dp
Layout.preferredHeight: 45 * DefaultStyle.dp
call: mainItem.call
}
ColumnLayout {
Text {
property var remoteAddress: UtilsCpp.getDisplayName(call.core.peerAddress)
text: remoteAddress ? remoteAddress.value : ""
color: DefaultStyle.grey_600
font {
pixelSize: 20 * DefaultStyle.dp
weight: 800 * DefaultStyle.dp
capitalization: Font.Capitalize
}
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
call: mainItem.call
}
RowLayout {
EffectImage {
imageSource: AppIcons.arrowDownLeft
colorizationColor: DefaultStyle.success_500main
Layout.preferredWidth: 24 * DefaultStyle.dp
Layout.preferredHeight: 24 * DefaultStyle.dp
}
ColumnLayout {
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
property var remoteAddress: UtilsCpp.getDisplayName(call.core.peerAddress)
text: remoteAddress ? remoteAddress.value : ""
color: DefaultStyle.grey_600
font {
pixelSize: 13 * DefaultStyle.dp
weight: 400 * DefaultStyle.dp
pixelSize: 20 * 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 {
Layout.alignment: Qt.AlignHCenter
Layout.fillWidth: true
spacing: 26 * DefaultStyle.dp
Button {
color: DefaultStyle.success_500main
Layout.preferredWidth: 75 * DefaultStyle.dp
Layout.preferredHeight: 55 * DefaultStyle.dp
contentItem: EffectImage {
colorizationColor: DefaultStyle.grey_0
imageSource: AppIcons.phone
imageWidth: 32 * DefaultStyle.dp
imageHeight: 32 * DefaultStyle.dp
RowLayout {
Layout.alignment: Qt.AlignHCenter
Layout.fillWidth: true
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 {
colorizationColor: DefaultStyle.grey_0
imageSource: AppIcons.phone
imageWidth: 32 * DefaultStyle.dp
imageHeight: 32 * DefaultStyle.dp
}
onClicked: {
mainItem.call.core.lAccept(false)
UtilsCpp.openCallsWindow(mainItem.call)
}
}
onClicked: {
mainItem.call.core.lAccept(false)
UtilsCpp.openCallsWindow(mainItem.call)
}
}
Button {
color: DefaultStyle.danger_500main
Layout.preferredWidth: 75 * DefaultStyle.dp
Layout.preferredHeight: 55 * DefaultStyle.dp
contentItem: EffectImage {
colorizationColor: DefaultStyle.grey_0
imageSource: AppIcons.endCall
imageWidth: 32 * DefaultStyle.dp
imageHeight: 32 * DefaultStyle.dp
}
onClicked: {
mainItem.call.core.lDecline()
Button {
color: DefaultStyle.danger_500main
Layout.preferredWidth: 75 * DefaultStyle.dp
Layout.preferredHeight: 55 * DefaultStyle.dp
contentItem: EffectImage {
colorizationColor: DefaultStyle.grey_0
imageSource: AppIcons.endCall
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 {
Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: 360 * DefaultStyle.dp
Text {
spacing: 13 * DefaultStyle.dp
Item {
Layout.preferredWidth: 360 * DefaultStyle.dp
Layout.preferredHeight: detailAvatar.height
// Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
Layout.fillWidth: true
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.WrapAnywhere
elide: Text.ElideRight
text: mainItem.contactName
maximumLineCount: 1
font {
pixelSize: 14 * DefaultStyle.dp
weight: 400 * DefaultStyle.dp
capitalization: Font.Capitalize
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
}
}
Text {
property var mode : contact ? contact.core.consolidatedPresence : -1
ColumnLayout {
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
Layout.preferredWidth: 360 * DefaultStyle.dp
spacing: 2 * DefaultStyle.dp
Text {
Layout.alignment: Qt.AlignHCenter
Layout.fillWidth: true
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.WrapAnywhere
elide: Text.ElideRight
text: mainItem.contactName
maximumLineCount: 1
font {
pixelSize: 14 * DefaultStyle.dp
weight: 400 * DefaultStyle.dp
capitalization: Font.Capitalize
}
}
Text {
property var mode : contact ? contact.core.consolidatedPresence : -1
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 {

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,167 +195,159 @@ 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
Flickable {
id: listLayout
contentWidth: width
contentHeight: content.height
clip: true
Control.ScrollBar.vertical: contactsScrollbar
Layout.fillWidth: 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 {
id: content
width: parent.width
// anchors.fill: parent
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
visible: favoriteList.contentHeight > 0
onVisibleChanged: if (visible && !favoriteList.visible) favoriteList.visible = true
Layout.leftMargin: leftPanel.leftMargin
Layout.rightMargin: leftPanel.rightMargin
spacing: 18 * DefaultStyle.dp
RowLayout {
spacing: 0
Text {
text: qsTr("Favoris")
font {
pixelSize: 16 * 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 {
visible: favoriteList.contentHeight > 0
onVisibleChanged: if (visible && !favoriteList.visible) favoriteList.visible = true
Layout.leftMargin: leftPanel.leftMargin
Layout.rightMargin: leftPanel.rightMargin
spacing: 18 * DefaultStyle.dp
RowLayout {
spacing: 0
Text {
text: qsTr("Favoris")
font {
pixelSize: 16 * 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
ContactsList{
id: favoriteList
hoverEnabled: mainItem.leftPanelEnabled
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
}
ContactsList{
id: favoriteList
hoverEnabled: mainItem.leftPanelEnabled
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()
}
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.availableHeight
active: true
interactive: true
policy: Control.ScrollBar.AsNeeded
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()
}
}
}
}
}
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 {
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"