refactor: replace all the StatusImageIdenticon with StatusQ's StatusSmartIdenticon

closes  #3848
This commit is contained in:
Khushboo Mehta 2021-10-21 00:47:23 +02:00 committed by Khushboo-dev-cpp
parent 7114240e72
commit be7a56cc27
16 changed files with 77 additions and 62 deletions

View File

@ -6,6 +6,8 @@ import Qt.labs.platform 1.1
import utils 1.0 import utils 1.0
import StatusQ.Controls 0.1 as StatusQControls import StatusQ.Controls 0.1 as StatusQControls
import StatusQ.Components 0.1
import "../../../../shared/panels" import "../../../../shared/panels"
import "../../../../shared/status" import "../../../../shared/status"
@ -36,12 +38,13 @@ Rectangle {
radius: Style.current.radius radius: Style.current.radius
color: isHovered ? Style.current.backgroundHover : Style.current.transparent color: isHovered ? Style.current.backgroundHover : Style.current.transparent
StatusImageIdenticon { StatusSmartIdenticon {
id: accountImage id: accountImage
anchors.left: parent.left anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
source: identicon
anchors.leftMargin: Style.current.padding anchors.leftMargin: Style.current.padding
image.source: identicon
image.isIdenticon: true
} }
StyledText { StyledText {

View File

@ -5,7 +5,8 @@ import QtQuick.Layouts 1.13
import utils 1.0 import utils 1.0
import "../../../../shared" import "../../../../shared"
import "../../../../shared/panels" import "../../../../shared/panels"
import "../../../../shared/status"
import StatusQ.Components 0.1
Rectangle { Rectangle {
property string name property string name
@ -26,12 +27,13 @@ Rectangle {
radius: Style.current.radius radius: Style.current.radius
color: isHovered ? Style.current.backgroundHover : Style.current.transparent color: isHovered ? Style.current.backgroundHover : Style.current.transparent
StatusImageIdenticon { StatusSmartIdenticon {
id: accountImage id: accountImage
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: Style.current.padding anchors.leftMargin: Style.current.padding
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
source: identicon image.source: identicon
image.isIdenticon: true
} }
StyledText { StyledText {

View File

@ -5,7 +5,7 @@ import QtQml.Models 2.3
import QtQuick.Dialogs 1.0 import QtQuick.Dialogs 1.0
import StatusQ.Popups 0.1 import StatusQ.Popups 0.1
import StatusQ.Components 0.1
import utils 1.0 import utils 1.0
import "../../../../shared" import "../../../../shared"
@ -116,12 +116,14 @@ StatusPopupMenu {
visible: mouseArea.containsMouse visible: mouseArea.containsMouse
color: Style.current.backgroundHover color: Style.current.backgroundHover
} }
StatusImageIdenticon {
StatusSmartIdenticon {
id: profileImage id: profileImage
source: identicon
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 4 anchors.topMargin: 4
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
image.source: identicon
image.isIdenticon: true
} }
StyledText { StyledText {

View File

@ -23,10 +23,12 @@ import QtGraphicalEffects 1.13
import QtQml.Models 2.13 import QtQml.Models 2.13
import utils 1.0 import utils 1.0
import StatusQ.Components 0.1
import "../../../../shared" import "../../../../shared"
import "../../../../shared/panels" import "../../../../shared/panels"
import "../../../../shared/controls" import "../../../../shared/controls"
import "../../../../shared/status"
Rectangle { Rectangle {
id: container id: container
@ -184,14 +186,15 @@ Rectangle {
height: 42 height: 42
radius: Style.current.radius radius: Style.current.radius
StatusImageIdenticon { StatusSmartIdenticon {
id: accountImage id: accountImage
width: 32
height: 32
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: Style.current.smallPadding anchors.leftMargin: Style.current.smallPadding
source: model.identicon image.width: 32
image.height: 32
image.source: model.identicon
image.isIdenticon: true
} }
StyledText { StyledText {

View File

@ -289,10 +289,11 @@ ModalPopup {
property string nickname: appMain.getUserNickname(model.publicKey) property string nickname: appMain.getUserNickname(model.publicKey)
StatusImageIdenticon { StatusQ.StatusSmartIdenticon {
id: identicon id: identicon
anchors.left: parent.left anchors.left: parent.left
source: appMain.getProfileImage(model.publicKey) || model.identicon image.source: appMain.getProfileImage(model.publicKey)|| model.identicon
image.isIdenticon: true
} }
StyledText { StyledText {

View File

@ -8,6 +8,7 @@ import "../../../../shared/panels"
import "../../../../shared/status" import "../../../../shared/status"
import StatusQ.Controls 0.1 as StatusQControls import StatusQ.Controls 0.1 as StatusQControls
import StatusQ.Components 0.1
Rectangle { Rectangle {
id: accountViewDelegate id: accountViewDelegate
@ -36,13 +37,15 @@ Rectangle {
return Style.current.transparent return Style.current.transparent
} }
StatusImageIdenticon { StatusSmartIdenticon {
id: accountImage id: accountImage
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: Style.current.padding anchors.leftMargin: Style.current.padding
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
source: identicon image.source : identicon
image.isIdenticon: true
} }
StyledText { StyledText {
id: usernameText id: usernameText
text: username text: username

View File

@ -11,6 +11,8 @@ import "../../../../shared/panels"
import "../../../../shared/popups" import "../../../../shared/popups"
import "../stores" import "../stores"
import StatusQ.Components 0.1
// TODO: replace with StatusModal // TODO: replace with StatusModal
ModalPopup { ModalPopup {
id: popup id: popup
@ -36,14 +38,14 @@ ModalPopup {
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
} }
StatusImageIdenticon { StatusSmartIdenticon {
id: identicon id: identicon
source: OnboardingStore.currentAccount.identicon
anchors.top: info.bottom anchors.top: info.bottom
anchors.topMargin: Style.current.bigPadding anchors.topMargin: Style.current.bigPadding
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
width: 60 image.source: OnboardingStore.currentAccount.identicon
height: 60 image.width: 60
image.height: 60
} }
StyledText { StyledText {

View File

@ -13,6 +13,8 @@ import "../../../../shared/status"
import "../popups" import "../popups"
import "../stores" import "../stores"
import StatusQ.Components 0.1
import utils 1.0 import utils 1.0
Item { Item {
@ -94,10 +96,11 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
StatusImageIdenticon { StatusSmartIdenticon {
id: userImage id: userImage
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
source: LoginStore.currentAccount.thumbnailImage image.source : LoginStore.currentAccount.thumbnailImage
image.isIdenticon: true
} }
StyledText { StyledText {

View File

@ -8,6 +8,8 @@ import "../../../../shared/popups"
import "../../../../shared/panels" import "../../../../shared/panels"
import "../../../../shared/status" import "../../../../shared/status"
import StatusQ.Components 0.1
Rectangle { Rectangle {
property string name: "Jotaro Kujo" property string name: "Jotaro Kujo"
property string address: "0x04d8c07dd137bd1b73a6f51df148b4f77ddaa11209d36e43d8344c0a7d6db1cad6085f27cfb75dd3ae21d86ceffebe4cf8a35b9ce8d26baa19dc264efe6d8f221b" property string address: "0x04d8c07dd137bd1b73a6f51df148b4f77ddaa11209d36e43d8344c0a7d6db1cad6085f27cfb75dd3ae21d86ceffebe4cf8a35b9ce8d26baa19dc264efe6d8f221b"
@ -35,12 +37,13 @@ Rectangle {
radius: Style.current.radius radius: Style.current.radius
color: isHovered ? Style.current.backgroundHover : Style.current.transparent color: isHovered ? Style.current.backgroundHover : Style.current.transparent
StatusImageIdenticon { StatusSmartIdenticon {
id: accountImage id: accountImage
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: Style.current.padding anchors.leftMargin: Style.current.padding
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
source: identicon image.source: identicon
image.isIdenticon: true
} }
StyledText { StyledText {

View File

@ -7,9 +7,10 @@ import utils 1.0
import "../" import "../"
import "../views" import "../views"
import "../panels" import "../panels"
import "../status"
import "." import "."
import StatusQ.Components 0.1
Item { Item {
id: root id: root
property var contacts property var contacts
@ -91,17 +92,17 @@ Item {
menuAlignment: Select.MenuAlignment.Left menuAlignment: Select.MenuAlignment.Left
selectedItemView: Item { selectedItemView: Item {
anchors.fill: parent anchors.fill: parent
StatusImageIdenticon { StatusSmartIdenticon {
id: iconImg id: iconImg
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: 14 anchors.leftMargin: 14
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
height: 32 image.width: (!!selectedContact && !!selectedContact.identicon) ? 32 : 0
width: (!!selectedContact && !!selectedContact.identicon) ? 32 : 0 image.height: 32
visible: !!selectedContact && !!selectedContact.identicon image.source: (!!selectedContact && !!selectedContact.identicon) ? selectedContact.identicon : ""
source: (!!selectedContact && !!selectedContact.identicon) ? selectedContact.identicon : "" image.isIdenticon: true
active: !!selectedContact && !!selectedContact.identicon
} }
StyledText { StyledText {
id: selectedTextField id: selectedTextField
text: !!selectedContact ? selectedContact.name : "" text: !!selectedContact ? selectedContact.name : ""
@ -159,12 +160,13 @@ Item {
width: parent.width width: parent.width
height: visible ? 72 : 0 height: visible ? 72 : 0
StatusImageIdenticon { StatusSmartIdenticon {
id: iconImg id: iconImg
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: Style.current.padding anchors.leftMargin: Style.current.padding
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
source: identicon image.source: identicon
image.isIdenticon: true
} }
Column { Column {
anchors.left: iconImg.right anchors.left: iconImg.right

View File

@ -4,10 +4,11 @@ import QtQuick.Layouts 1.3
import QtQml.Models 2.3 import QtQml.Models 2.3
import utils 1.0 import utils 1.0
import "../status"
import "../panels" import "../panels"
import "." import "."
import StatusQ.Components 0.1
// TODO: replace with StatusPopupMenu // TODO: replace with StatusPopupMenu
PopupMenu { PopupMenu {
id: root id: root
@ -23,14 +24,14 @@ PopupMenu {
visible: mouseArea.containsMouse visible: mouseArea.containsMouse
color: Style.current.backgroundHover color: Style.current.backgroundHover
} }
StatusImageIdenticon { StatusSmartIdenticon {
id: profileImage id: profileImage
source: profileModel.profile.thumbnailImage || ""
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 4 anchors.topMargin: 4
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
image.source: profileModel.profile.thumbnailImage || ""
image.isIdenticon: true
} }
StyledText { StyledText {
id: username id: username
text: Utils.removeStatusEns(profileModel.ens.preferredUsername || profileModel.profile.username) text: Utils.removeStatusEns(profileModel.ens.preferredUsername || profileModel.profile.username)

View File

@ -15,6 +15,7 @@ import "../../app/AppLayouts/Chat/panels"
import "./emojiList.js" as EmojiJSON import "./emojiList.js" as EmojiJSON
import StatusQ.Core.Theme 0.1 import StatusQ.Core.Theme 0.1
import StatusQ.Components 0.1
import StatusQ.Controls 0.1 as StatusQ import StatusQ.Controls 0.1 as StatusQ
Rectangle { Rectangle {
@ -851,13 +852,14 @@ Rectangle {
} }
} }
StatusImageIdenticon { StatusSmartIdenticon {
id: profileImage id: profileImage
source: profileModel.profile.thumbnailImage || profileModel.profile.identicon
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: Style.current.smallPadding anchors.leftMargin: Style.current.smallPadding
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: Style.current.halfPadding anchors.topMargin: Style.current.halfPadding
image.source: profileModel.profile.thumbnailImage || profileModel.profile.identicon
image.isIdenticon: true
visible: control.isStatusUpdateInput visible: control.isStatusUpdateInput
} }

View File

@ -1,16 +0,0 @@
import QtQuick 2.13
import utils 1.0
import "../panels"
RoundedImage {
id: root
noHover: true
source:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAg0lEQVR4nOzXwQmAMBAFURV7sQybsgybsgyr0QYUlE1g+Mw7ioQMe9lMQwhDaAyhMYTGEJqYkPnrj/t5XE/ft2UdW1yken7MRAyhMYTGEBpDaAyhKe9JbzvSX9WdLWYihtAYQuMLkcYQGkPUScxEDKExhMYQGkNoDKExhMYQmjsAAP//ZfIUZgXTZXQAAAAASUVORK5CYII="
width: 40
height: 40
border.width: 1
border.color: Style.current.borderSecondary
smooth: false
antialiasing: true
}

View File

@ -6,7 +6,6 @@ StatusEmojiPopup 1.0 StatusEmojiPopup.qml
StatusEmojiSection 1.0 StatusEmojiSection.qml StatusEmojiSection 1.0 StatusEmojiSection.qml
StatusGifPopup 1.0 StatusGifPopup.qml StatusGifPopup 1.0 StatusGifPopup.qml
StatusGifColumn 1.0 StatusGifColumn.qml StatusGifColumn 1.0 StatusGifColumn.qml
StatusImageIdenticon 1.0 StatusImageIdenticon.qml
StatusSectionHeadline 1.0 StatusSectionHeadline.qml StatusSectionHeadline 1.0 StatusSectionHeadline.qml
StatusStickerButton 1.0 StatusStickerButton.qml StatusStickerButton 1.0 StatusStickerButton.qml
StatusStickerList 1.0 StatusStickerList.qml StatusStickerList 1.0 StatusStickerList.qml

View File

@ -13,6 +13,8 @@ import "../panels"
import "../../app/AppLayouts/Chat/controls" import "../../app/AppLayouts/Chat/controls"
import "./" import "./"
import StatusQ.Components 0.1
Item { Item {
id: root id: root
height: 64 height: 64
@ -73,12 +75,13 @@ Item {
height: 64 height: 64
visible: root.pubKey !== "" && !root.loading visible: root.pubKey !== "" && !root.loading
StatusImageIdenticon { StatusSmartIdenticon {
id: contactIdenticon id: contactIdenticon
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: Style.current.padding anchors.leftMargin: Style.current.padding
source: utilsModel.generateIdenticon(root.pubKey) image.source: utilsModel.generateIdenticon(root.pubKey)
image.isIdenticon: true
} }
StyledText { StyledText {

View File

@ -11,6 +11,8 @@ import "../panels"
import "../controls" import "../controls"
import "../popups" import "../popups"
import StatusQ.Components 0.1
Item { Item {
id: root id: root
property var fromAccount property var fromAccount
@ -253,14 +255,14 @@ Item {
visible: false visible: false
source: imgToWallet source: imgToWallet
} }
StatusImageIdenticon { StatusSmartIdenticon {
id: idtToContact id: idtToContact
visible: false visible: false
anchors.right: toInvalid.visible ? toInvalid.left : parent.right anchors.right: toInvalid.visible ? toInvalid.left : parent.right
anchors.rightMargin: toInvalid.visible ? Style.current.halfPadding : 0 anchors.rightMargin: toInvalid.visible ? Style.current.halfPadding : 0
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
width: 32 image.width: 32
height: 32 image.height: 32
} }
SVGImage { SVGImage {
id: toInvalid id: toInvalid