mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-06-02 10:37:50 +00:00
NComBox: added safe guards if not options or invalid option index
This commit is contained in:
@@ -69,9 +69,7 @@ ColumnLayout {
|
||||
font.pointSize: Style.fontSizeMedium * scaling
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
elide: Text.ElideRight
|
||||
text: {
|
||||
return root.optionsLabels[combo.currentIndex]
|
||||
}
|
||||
text: (combo.currentIndex < root.optionsLabels.length) ? root.optionsLabels[combo.currentIndex] : "";
|
||||
}
|
||||
|
||||
// Drop down indicator
|
||||
@@ -110,9 +108,7 @@ ColumnLayout {
|
||||
highlighted: combo.highlightedIndex === index
|
||||
|
||||
contentItem: NText {
|
||||
text: {
|
||||
return root.optionsLabels[combo.model.indexOf(modelData)]
|
||||
}
|
||||
text: (combo.model.indexOf(modelData)< root.optionsLabels.length) ? root.optionsLabels[combo.model.indexOf(modelData)] : ""
|
||||
font.pointSize: Style.fontSizeMedium * scaling
|
||||
color: highlighted ? Colors.backgroundPrimary : Colors.textPrimary
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
|
||||
Reference in New Issue
Block a user