mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-09-04 22:23:32 +02:00
presence: cosmetic changes / simplify component
Gitlab: #138 Change-Id: I552c26583dda87c71491a87655a91273c59d851f
This commit is contained in:
parent
a3a2e611f9
commit
87c7543644
5 changed files with 57 additions and 65 deletions
2
qml.qrc
2
qml.qrc
|
@ -126,7 +126,6 @@
|
||||||
<file>src/mainview/components/SipInputPanel.qml</file>
|
<file>src/mainview/components/SipInputPanel.qml</file>
|
||||||
<file>src/commoncomponents/js/contextmenugenerator.js</file>
|
<file>src/commoncomponents/js/contextmenugenerator.js</file>
|
||||||
<file>src/commoncomponents/BaseContextMenu.qml</file>
|
<file>src/commoncomponents/BaseContextMenu.qml</file>
|
||||||
<file>src/mainview/components/AccountPresenceCycle.qml</file>
|
|
||||||
<file>src/commoncomponents/Scaffold.qml</file>
|
<file>src/commoncomponents/Scaffold.qml</file>
|
||||||
<file>src/constant/JamiQmlUtils.qml</file>
|
<file>src/constant/JamiQmlUtils.qml</file>
|
||||||
<file>src/wizardview/components/AccountCreationStepIndicator.qml</file>
|
<file>src/wizardview/components/AccountCreationStepIndicator.qml</file>
|
||||||
|
@ -137,5 +136,6 @@
|
||||||
<file>src/commoncomponents/ModalPopup.qml</file>
|
<file>src/commoncomponents/ModalPopup.qml</file>
|
||||||
<file>src/commoncomponents/SimpleMessageDialog.qml</file>
|
<file>src/commoncomponents/SimpleMessageDialog.qml</file>
|
||||||
<file>src/commoncomponents/ResponsiveImage.qml</file>
|
<file>src/commoncomponents/ResponsiveImage.qml</file>
|
||||||
|
<file>src/commoncomponents/PresenceIndicator.qml</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|
|
@ -1,51 +1,47 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2020 by Savoir-faire Linux
|
* Copyright (C) 2020 by Savoir-faire Linux
|
||||||
* Author: Mingrui Zhang <mingrui.zhang@savoirfairelinux.com>
|
* Author: Mingrui Zhang <mingrui.zhang@savoirfairelinux.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 3 of the License, or
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import QtQuick 2.14
|
import QtQuick 2.14
|
||||||
import QtQuick.Controls 2.14
|
import QtQuick.Controls 2.14
|
||||||
import net.jami.Models 1.0
|
import net.jami.Models 1.0
|
||||||
|
|
||||||
Rectangle {
|
// Serves as either account or contact presence indicator.
|
||||||
id: root
|
// TODO: this should be part of an avatar component at some point.
|
||||||
|
Rectangle {
|
||||||
property int accountStatus: 5
|
id: root
|
||||||
|
|
||||||
width: 12
|
// This is set to REGISTERED for contact presence
|
||||||
height: 12
|
// as status is not currently tracked for contact items.
|
||||||
|
property int status: Account.Status.REGISTERED
|
||||||
Rectangle {
|
property int size: 12
|
||||||
id: presenceCycle
|
|
||||||
|
width: size
|
||||||
anchors.centerIn: root
|
height: size
|
||||||
|
radius: size * 0.5
|
||||||
width: 10
|
border {
|
||||||
height: 10
|
color: JamiTheme.backgroundColor
|
||||||
|
width: 2
|
||||||
radius: 30
|
}
|
||||||
color: {
|
color: {
|
||||||
if (accountStatus === Account.Status.REGISTERED)
|
if (status === Account.Status.REGISTERED)
|
||||||
return JamiTheme.presenceGreen
|
return JamiTheme.presenceGreen
|
||||||
else if (accountStatus === Account.Status.TRYING)
|
else if (status === Account.Status.TRYING)
|
||||||
return JamiTheme.unPresenceOrange
|
return JamiTheme.unPresenceOrange
|
||||||
return JamiTheme.notificationRed
|
return JamiTheme.notificationRed
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
radius: 30
|
|
||||||
color: JamiTheme.backgroundColor
|
|
||||||
}
|
|
|
@ -41,7 +41,7 @@ ComboBox {
|
||||||
function onModelReset() {
|
function onModelReset() {
|
||||||
userImageRoot.source = "data:image/png;base64," + accountListModel.data(
|
userImageRoot.source = "data:image/png;base64," + accountListModel.data(
|
||||||
accountListModel.index(0, 0), AccountListModel.Picture)
|
accountListModel.index(0, 0), AccountListModel.Picture)
|
||||||
currentAccountPresenseCycle.accountStatus =
|
currentAccountPresenceIndicator.status =
|
||||||
accountListModel.data(accountListModel.index(0, 0), AccountListModel.Status)
|
accountListModel.data(accountListModel.index(0, 0), AccountListModel.Status)
|
||||||
textMetricsUserAliasRoot.text = accountListModel.data(accountListModel.index(0,0),
|
textMetricsUserAliasRoot.text = accountListModel.data(accountListModel.index(0,0),
|
||||||
AccountListModel.Alias)
|
AccountListModel.Alias)
|
||||||
|
@ -67,15 +67,15 @@ ComboBox {
|
||||||
accountListModel.index(0, 0), AccountListModel.Picture)
|
accountListModel.index(0, 0), AccountListModel.Picture)
|
||||||
mipmap: true
|
mipmap: true
|
||||||
|
|
||||||
AccountPresenceCycle {
|
PresenceIndicator {
|
||||||
id: currentAccountPresenseCycle
|
id: currentAccountPresenceIndicator
|
||||||
|
|
||||||
anchors.right: userImageRoot.right
|
anchors.right: userImageRoot.right
|
||||||
anchors.rightMargin: -2
|
anchors.rightMargin: -2
|
||||||
anchors.bottom: userImageRoot.bottom
|
anchors.bottom: userImageRoot.bottom
|
||||||
anchors.bottomMargin: -2
|
anchors.bottomMargin: -2
|
||||||
|
|
||||||
accountStatus: accountListModel.data(accountListModel.index(0, 0),
|
status: accountListModel.data(accountListModel.index(0, 0),
|
||||||
AccountListModel.Status)
|
AccountListModel.Status)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,15 +74,13 @@ Popup {
|
||||||
return "data:image/png;base64," + data
|
return "data:image/png;base64," + data
|
||||||
}
|
}
|
||||||
|
|
||||||
AccountPresenceCycle {
|
PresenceIndicator {
|
||||||
id: accountPresenseCycle
|
|
||||||
|
|
||||||
anchors.right: userImage.right
|
anchors.right: userImage.right
|
||||||
anchors.rightMargin: -2
|
anchors.rightMargin: -2
|
||||||
anchors.bottom: userImage.bottom
|
anchors.bottom: userImage.bottom
|
||||||
anchors.bottomMargin: -2
|
anchors.bottomMargin: -2
|
||||||
|
|
||||||
accountStatus: Status
|
status: Status
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2020 by Savoir-faire Linux
|
* Copyright (C) 2020 by Savoir-faire Linux
|
||||||
* Author: Mingrui Zhang <mingrui.zhang@savoirfairelinux.com>
|
* Author: Mingrui Zhang <mingrui.zhang@savoirfairelinux.com>
|
||||||
|
@ -16,10 +15,12 @@
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import QtQuick 2.14
|
import QtQuick 2.14
|
||||||
import QtQuick.Controls 2.14
|
import QtQuick.Controls 2.14
|
||||||
import QtQuick.Layouts 1.14
|
import QtQuick.Layouts 1.14
|
||||||
import net.jami.Models 1.0
|
import net.jami.Models 1.0
|
||||||
|
import "../../commoncomponents"
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
id: userImage
|
id: userImage
|
||||||
|
@ -31,12 +32,9 @@ Image {
|
||||||
source: "data:image/png;base64," + Picture
|
source: "data:image/png;base64," + Picture
|
||||||
mipmap: true
|
mipmap: true
|
||||||
|
|
||||||
AccountPresenceCycle {
|
PresenceIndicator {
|
||||||
id: conversationAccountPresenseCycle
|
|
||||||
|
|
||||||
anchors.right: userImage.right
|
anchors.right: userImage.right
|
||||||
anchors.bottom: userImage.bottom
|
anchors.bottom: userImage.bottom
|
||||||
anchors.bottomMargin: -2
|
|
||||||
|
|
||||||
visible: Presence === undefined ? false : Presence
|
visible: Presence === undefined ? false : Presence
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue