mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
NSearchableComboBox is now agnostic to badges. Also replaced [L], [C], [R] by icons
This commit is contained in:
@@ -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 !== ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user