mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-03-28 14:56:19 +01: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/commoncomponents/js/contextmenugenerator.js</file>
|
||||
<file>src/commoncomponents/BaseContextMenu.qml</file>
|
||||
<file>src/mainview/components/AccountPresenceCycle.qml</file>
|
||||
<file>src/commoncomponents/Scaffold.qml</file>
|
||||
<file>src/constant/JamiQmlUtils.qml</file>
|
||||
<file>src/wizardview/components/AccountCreationStepIndicator.qml</file>
|
||||
|
@ -137,5 +136,6 @@
|
|||
<file>src/commoncomponents/ModalPopup.qml</file>
|
||||
<file>src/commoncomponents/SimpleMessageDialog.qml</file>
|
||||
<file>src/commoncomponents/ResponsiveImage.qml</file>
|
||||
<file>src/commoncomponents/PresenceIndicator.qml</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
|
@ -1,51 +1,47 @@
|
|||
/*
|
||||
* Copyright (C) 2020 by Savoir-faire Linux
|
||||
* Author: Mingrui Zhang <mingrui.zhang@savoirfairelinux.com>
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.14
|
||||
import QtQuick.Controls 2.14
|
||||
import net.jami.Models 1.0
|
||||
|
||||
Rectangle {
|
||||
id: root
|
||||
|
||||
property int accountStatus: 5
|
||||
|
||||
width: 12
|
||||
height: 12
|
||||
|
||||
Rectangle {
|
||||
id: presenceCycle
|
||||
|
||||
anchors.centerIn: root
|
||||
|
||||
width: 10
|
||||
height: 10
|
||||
|
||||
radius: 30
|
||||
color: {
|
||||
if (accountStatus === Account.Status.REGISTERED)
|
||||
return JamiTheme.presenceGreen
|
||||
else if (accountStatus === Account.Status.TRYING)
|
||||
return JamiTheme.unPresenceOrange
|
||||
return JamiTheme.notificationRed
|
||||
}
|
||||
}
|
||||
|
||||
radius: 30
|
||||
color: JamiTheme.backgroundColor
|
||||
}
|
||||
/*
|
||||
* Copyright (C) 2020 by Savoir-faire Linux
|
||||
* Author: Mingrui Zhang <mingrui.zhang@savoirfairelinux.com>
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.14
|
||||
import QtQuick.Controls 2.14
|
||||
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 {
|
||||
id: root
|
||||
|
||||
// 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: size
|
||||
height: size
|
||||
radius: size * 0.5
|
||||
border {
|
||||
color: JamiTheme.backgroundColor
|
||||
width: 2
|
||||
}
|
||||
color: {
|
||||
if (status === Account.Status.REGISTERED)
|
||||
return JamiTheme.presenceGreen
|
||||
else if (status === Account.Status.TRYING)
|
||||
return JamiTheme.unPresenceOrange
|
||||
return JamiTheme.notificationRed
|
||||
}
|
||||
}
|
|
@ -41,7 +41,7 @@ ComboBox {
|
|||
function onModelReset() {
|
||||
userImageRoot.source = "data:image/png;base64," + accountListModel.data(
|
||||
accountListModel.index(0, 0), AccountListModel.Picture)
|
||||
currentAccountPresenseCycle.accountStatus =
|
||||
currentAccountPresenceIndicator.status =
|
||||
accountListModel.data(accountListModel.index(0, 0), AccountListModel.Status)
|
||||
textMetricsUserAliasRoot.text = accountListModel.data(accountListModel.index(0,0),
|
||||
AccountListModel.Alias)
|
||||
|
@ -67,15 +67,15 @@ ComboBox {
|
|||
accountListModel.index(0, 0), AccountListModel.Picture)
|
||||
mipmap: true
|
||||
|
||||
AccountPresenceCycle {
|
||||
id: currentAccountPresenseCycle
|
||||
PresenceIndicator {
|
||||
id: currentAccountPresenceIndicator
|
||||
|
||||
anchors.right: userImageRoot.right
|
||||
anchors.rightMargin: -2
|
||||
anchors.bottom: userImageRoot.bottom
|
||||
anchors.bottomMargin: -2
|
||||
|
||||
accountStatus: accountListModel.data(accountListModel.index(0, 0),
|
||||
status: accountListModel.data(accountListModel.index(0, 0),
|
||||
AccountListModel.Status)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -74,15 +74,13 @@ Popup {
|
|||
return "data:image/png;base64," + data
|
||||
}
|
||||
|
||||
AccountPresenceCycle {
|
||||
id: accountPresenseCycle
|
||||
|
||||
PresenceIndicator {
|
||||
anchors.right: userImage.right
|
||||
anchors.rightMargin: -2
|
||||
anchors.bottom: userImage.bottom
|
||||
anchors.bottomMargin: -2
|
||||
|
||||
accountStatus: Status
|
||||
status: Status
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
/*
|
||||
* Copyright (C) 2020 by Savoir-faire Linux
|
||||
* Author: Mingrui Zhang <mingrui.zhang@savoirfairelinux.com>
|
||||
|
@ -16,10 +15,12 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.14
|
||||
import QtQuick.Controls 2.14
|
||||
import QtQuick.Layouts 1.14
|
||||
import net.jami.Models 1.0
|
||||
import "../../commoncomponents"
|
||||
|
||||
Image {
|
||||
id: userImage
|
||||
|
@ -31,12 +32,9 @@ Image {
|
|||
source: "data:image/png;base64," + Picture
|
||||
mipmap: true
|
||||
|
||||
AccountPresenceCycle {
|
||||
id: conversationAccountPresenseCycle
|
||||
|
||||
PresenceIndicator {
|
||||
anchors.right: userImage.right
|
||||
anchors.bottom: userImage.bottom
|
||||
anchors.bottomMargin: -2
|
||||
|
||||
visible: Presence === undefined ? false : Presence
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue