Skip to content
Snippets Groups Projects
Commit 87c75436 authored by Andreas Traczyk's avatar Andreas Traczyk
Browse files

presence: cosmetic changes / simplify component

Gitlab: #138
Change-Id: I552c26583dda87c71491a87655a91273c59d851f
parent a3a2e611
No related branches found
No related tags found
No related merge requests found
...@@ -126,7 +126,6 @@ ...@@ -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 @@ ...@@ -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>
...@@ -20,32 +20,28 @@ import QtQuick 2.14 ...@@ -20,32 +20,28 @@ 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
// Serves as either account or contact presence indicator.
// TODO: this should be part of an avatar component at some point.
Rectangle { Rectangle {
id: root id: root
property int accountStatus: 5 // This is set to REGISTERED for contact presence
// as status is not currently tracked for contact items.
property int status: Account.Status.REGISTERED
property int size: 12
width: 12 width: size
height: 12 height: size
radius: size * 0.5
Rectangle { border {
id: presenceCycle color: JamiTheme.backgroundColor
width: 2
anchors.centerIn: root }
width: 10
height: 10
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 { ...@@ -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 { ...@@ -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 { ...@@ -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
} }
} }
......
/* /*
* 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 @@ ...@@ -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 { ...@@ -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
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment