NSearchableComboBox is now agnostic to badges. Also replaced [L], [C], [R] by icons

This commit is contained in:
ItsLemmy
2025-12-03 09:37:21 -05:00
parent c8d00d42e7
commit 85b887607a
2 changed files with 48 additions and 27 deletions
+18 -21
View File
@@ -219,33 +219,30 @@ RowLayout {
}
RowLayout {
spacing: Style.marginS
spacing: 0
Layout.alignment: Qt.AlignRight
// Plugin badge indicator
NIcon {
visible: typeof isPlugin !== 'undefined' && isPlugin === true
icon: "plugin"
pointSize: Style.fontSizeXS
color: highlighted ? Color.mOnHover : Color.mSecondary
Layout.preferredWidth: Style.baseWidgetSize * 0.7
Layout.preferredHeight: Style.baseWidgetSize * 0.7
}
// Generic badge renderer
Repeater {
model: typeof badgeLocations !== 'undefined' ? badgeLocations : []
model: (typeof badges !== 'undefined' && badges !== null) ? badges.count : 0
delegate: Item {
width: Style.baseWidgetSize * 0.7
height: Style.baseWidgetSize * 0.7
delegate: NIcon {
required property int index
readonly property var badgeData: badges.get(index)
NText {
anchors.centerIn: parent
text: modelData
pointSize: Style.fontSizeXXS
font.weight: Style.fontWeightBold
color: highlighted ? Color.mOnHover : Color.mOnSurface
icon: badgeData.icon || ""
pointSize: {
if (badgeData.size === "xsmall")
return Style.fontSizeXXS;
else if (badgeData.size === "medium")
return Style.fontSizeM;
else
return Style.fontSizeXS;
}
color: highlighted ? Color.mOnHover : (badgeData.color || Color.mOnSurface)
Layout.preferredWidth: Style.baseWidgetSize * 0.6
Layout.preferredHeight: Style.baseWidgetSize * 0.6
visible: badgeData && badgeData.icon !== undefined && badgeData.icon !== ""
}
}
}