Bar settings + Add widget: button-style trigger, fit inside panel

This commit is contained in:
Ryan Hughes
2026-05-18 02:18:07 -04:00
parent 030963768b
commit 135d21cae2
2 changed files with 11 additions and 11 deletions
@@ -23,6 +23,7 @@ Item {
property var options: []
property string placeholderText: "Search..."
property string emptyText: "No matches"
property string triggerLabel: ""
property color foreground: Color.foreground
property color background: Color.popups.background
@@ -136,8 +137,8 @@ Item {
anchors.verticalCenter: parent.verticalCenter
anchors.leftMargin: 10
anchors.rightMargin: 6
text: root.currentLabel() || root.placeholderText
color: root.currentLabel() ? root.foreground : Qt.darker(root.foreground, 1.5)
text: root.currentLabel() || root.triggerLabel || root.placeholderText
color: (root.currentLabel() || root.triggerLabel) ? root.foreground : Qt.darker(root.foreground, 1.5)
font.family: root.fontFamily
font.pixelSize: 12
elide: Text.ElideRight
@@ -744,7 +744,7 @@ Item {
function onDraftRevisionChanged() { section.entries = root.sectionArray(section.sectionKey) }
}
Row {
RowLayout {
width: section.width
spacing: 8
@@ -754,7 +754,7 @@ Item {
font.family: root.fontFamily
font.pixelSize: 13
font.bold: true
anchors.verticalCenter: parent.verticalCenter
Layout.alignment: Qt.AlignVCenter
}
Text {
@@ -762,21 +762,20 @@ Item {
color: Qt.darker(root.foreground, 1.5)
font.family: root.fontFamily
font.pixelSize: 11
anchors.verticalCenter: parent.verticalCenter
Layout.alignment: Qt.AlignVCenter
}
Item {
width: Math.max(0, section.width - 200 - 100)
height: 1
}
Item { Layout.fillWidth: true; implicitHeight: 1 }
SearchableDropdown {
id: addPill
label: "󰐕 Add widget"
showLabel: false
triggerLabel: "󰐕 Add widget"
value: ""
placeholderText: "Search widgets..."
emptyText: "No widgets to add"
width: 220
Layout.preferredWidth: 220
Layout.alignment: Qt.AlignVCenter
options: {
var list = root.availableToAdd(section.sectionKey)
var out = []