mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-10 22:36:24 +00:00
parent
9e23f78180
commit
8ba10ce6b0
@ -11,7 +11,7 @@ QtObject:
|
|||||||
View* = ref object of QObject
|
View* = ref object of QObject
|
||||||
delegate: io_interface.AccessInterface
|
delegate: io_interface.AccessInterface
|
||||||
|
|
||||||
networkName: string
|
networkShortName: string
|
||||||
networkColor: string
|
networkColor: string
|
||||||
networkIconUrl: string
|
networkIconUrl: string
|
||||||
|
|
||||||
@ -47,14 +47,14 @@ QtObject:
|
|||||||
proc load*(self: View) =
|
proc load*(self: View) =
|
||||||
self.delegate.viewDidLoad()
|
self.delegate.viewDidLoad()
|
||||||
|
|
||||||
proc getNetworkName(self: View): QVariant {.slot.} =
|
proc getNetworkShortName(self: View): QVariant {.slot.} =
|
||||||
return newQVariant(self.networkName)
|
return newQVariant(self.networkShortName)
|
||||||
|
|
||||||
proc networkNameChanged(self: View) {.signal.}
|
proc networkShortNameChanged(self: View) {.signal.}
|
||||||
|
|
||||||
QtProperty[QVariant] networkName:
|
QtProperty[QVariant] networkShortName:
|
||||||
read = getNetworkName
|
read = getNetworkShortName
|
||||||
notify = networkNameChanged
|
notify = networkShortNameChanged
|
||||||
|
|
||||||
proc getNetworkColor(self: View): QVariant {.slot.} =
|
proc getNetworkColor(self: View): QVariant {.slot.} =
|
||||||
return newQVariant(self.networkColor)
|
return newQVariant(self.networkColor)
|
||||||
@ -177,9 +177,9 @@ QtObject:
|
|||||||
self.delegate.update(collectionSlug, id)
|
self.delegate.update(collectionSlug, id)
|
||||||
|
|
||||||
proc setData*(self: View, collection: collectible_dto.CollectionDto, collectible: collectible_dto.CollectibleDto, network: network_dto.NetworkDto) =
|
proc setData*(self: View, collection: collectible_dto.CollectionDto, collectible: collectible_dto.CollectibleDto, network: network_dto.NetworkDto) =
|
||||||
if (self.networkName != network.chainName):
|
if (self.networkShortName != network.shortName):
|
||||||
self.networkName = network.chainName
|
self.networkShortName = network.shortName
|
||||||
self.networkNameChanged()
|
self.networkShortNameChanged()
|
||||||
|
|
||||||
if (self.networkColor != network.chainColor):
|
if (self.networkColor != network.chainColor):
|
||||||
self.networkColor = network.chainColor
|
self.networkColor = network.chainColor
|
||||||
|
@ -15,7 +15,7 @@ ColumnLayout {
|
|||||||
property alias primaryText: collectibleName.text
|
property alias primaryText: collectibleName.text
|
||||||
property string secondaryText
|
property string secondaryText
|
||||||
property bool isNarrowMode
|
property bool isNarrowMode
|
||||||
property string networkName
|
property string networkShortName
|
||||||
property string networkColor
|
property string networkColor
|
||||||
property string networkIconURL
|
property string networkIconURL
|
||||||
|
|
||||||
@ -84,9 +84,9 @@ ColumnLayout {
|
|||||||
|
|
||||||
InformationTag {
|
InformationTag {
|
||||||
id: networkTag
|
id: networkTag
|
||||||
readonly property bool isNetworkValid: networkName !== ""
|
readonly property bool isNetworkValid: networkShortName !== ""
|
||||||
image.source: isNetworkValid && networkIconURL !== "" ? Style.svg("tiny/" + networkIconURL) : ""
|
image.source: isNetworkValid && networkIconURL !== "" ? Style.svg("tiny/" + networkIconURL) : ""
|
||||||
tagPrimaryLabel.text: isNetworkValid ? networkName : "---"
|
tagPrimaryLabel.text: isNetworkValid ? networkShortName : "---"
|
||||||
tagPrimaryLabel.color: isNetworkValid ? networkColor : "black"
|
tagPrimaryLabel.color: isNetworkValid ? networkColor : "black"
|
||||||
visible: isNetworkValid
|
visible: isNetworkValid
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ Item {
|
|||||||
primaryText: currentCollectible.collectionName
|
primaryText: currentCollectible.collectionName
|
||||||
secondaryText: currentCollectible.id
|
secondaryText: currentCollectible.id
|
||||||
isNarrowMode: root.isNarrowMode
|
isNarrowMode: root.isNarrowMode
|
||||||
networkName: currentCollectible.networkName
|
networkShortName: currentCollectible.networkShortName
|
||||||
networkColor: currentCollectible.networkColor
|
networkColor: currentCollectible.networkColor
|
||||||
networkIconURL: currentCollectible.networkIconUrl
|
networkIconURL: currentCollectible.networkIconUrl
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user