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