qml: don't determine channel state on gui string, use state enum instead
This commit is contained in:
@@ -72,7 +72,7 @@ Pane {
|
|||||||
|
|
||||||
Label {
|
Label {
|
||||||
text: channeldetails.state
|
text: channeldetails.state
|
||||||
color: channeldetails.state == 'OPEN'
|
color: channeldetails.stateCode == ChannelDetails.Open
|
||||||
? constants.colorChannelOpen
|
? constants.colorChannelOpen
|
||||||
: Material.foreground
|
: Material.foreground
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ ItemDelegate {
|
|||||||
font.pixelSize: constants.fontSizeMedium
|
font.pixelSize: constants.fontSizeMedium
|
||||||
color: _closed
|
color: _closed
|
||||||
? constants.mutedForeground
|
? constants.mutedForeground
|
||||||
: model.state == 'OPEN'
|
: model.state_code == ChannelDetails.Open
|
||||||
? constants.colorChannelOpen
|
? constants.colorChannelOpen
|
||||||
: Material.foreground
|
: Material.foreground
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ class QEChannelDetails(QObject, QtEventListener):
|
|||||||
_logger = get_logger(__name__)
|
_logger = get_logger(__name__)
|
||||||
|
|
||||||
class State: # subset, only ones we currently need in UI
|
class State: # subset, only ones we currently need in UI
|
||||||
|
Open = ChannelState.OPEN
|
||||||
Closed = ChannelState.CLOSED
|
Closed = ChannelState.CLOSED
|
||||||
Redeemed = ChannelState.REDEEMED
|
Redeemed = ChannelState.REDEEMED
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user