このようなラベルのコンテナがあります...しかし、ラベルの値が負の場合は、赤色を追加する必要があります。それ以外の場合は緑色を追加します。QmlのBB 10カスケードでそれを行うにはどうすればよいですか。
Container {
leftPadding: 15.0
rightPadding: 15.0
layout: StackLayout {
orientation: LayoutOrientation.LeftToRight
}
topPadding: 20.0
Label {
id: symbol
text: ListItemData.Symbol_En
// Text Style and size etc
textStyle.base: SystemDefaults.TextStyles.SubtitleText
textStyle.fontSizeValue: 30.0
layoutProperties: StackLayoutProperties {
spaceQuota: 4
}
verticalAlignment: VerticalAlignment.Center
horizontalAlignment: HorizontalAlignment.Center
}
Label {
id: change
text: ListItemData.PerChange
textStyle.base: SystemDefaults.TextStyles.SubtitleText
textStyle.fontSizeValue: 30.0
layoutProperties: StackLayoutProperties {
spaceQuota: 2
}
verticalAlignment: VerticalAlignment.Center
horizontalAlignment: HorizontalAlignment.Center
}
Label {
id: ltp
text: ListItemData.LTP
textStyle.base: SystemDefaults.TextStyles.SubtitleText
textStyle.fontSizeValue: 30.0
layoutProperties: StackLayoutProperties {
spaceQuota: 1
}
verticalAlignment: VerticalAlignment.Center
horizontalAlignment: HorizontalAlignment.Center
}
Label {
id: highValue
text: ListItemData.High
textStyle.base: SystemDefaults.TextStyles.SubtitleText
textStyle.fontSizeValue: 30.0
layoutProperties: StackLayoutProperties {
spaceQuota: 1
}
verticalAlignment: VerticalAlignment.Center
horizontalAlignment: HorizontalAlignment.Center
}
Label {
id: lowValue
text: ListItemData.Low
textStyle.base: SystemDefaults.TextStyles.SubtitleText
textStyle.fontSizeValue: 30.0
layoutProperties: StackLayoutProperties {
spaceQuota: 1
}
verticalAlignment: VerticalAlignment.Center
horizontalAlignment: HorizontalAlignment.Center
}