Bar settings + Add widget: button-style trigger, fit inside panel
This commit is contained in:
@@ -23,6 +23,7 @@ Item {
|
|||||||
property var options: []
|
property var options: []
|
||||||
property string placeholderText: "Search..."
|
property string placeholderText: "Search..."
|
||||||
property string emptyText: "No matches"
|
property string emptyText: "No matches"
|
||||||
|
property string triggerLabel: ""
|
||||||
|
|
||||||
property color foreground: Color.foreground
|
property color foreground: Color.foreground
|
||||||
property color background: Color.popups.background
|
property color background: Color.popups.background
|
||||||
@@ -136,8 +137,8 @@ Item {
|
|||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
anchors.leftMargin: 10
|
anchors.leftMargin: 10
|
||||||
anchors.rightMargin: 6
|
anchors.rightMargin: 6
|
||||||
text: root.currentLabel() || root.placeholderText
|
text: root.currentLabel() || root.triggerLabel || root.placeholderText
|
||||||
color: root.currentLabel() ? root.foreground : Qt.darker(root.foreground, 1.5)
|
color: (root.currentLabel() || root.triggerLabel) ? root.foreground : Qt.darker(root.foreground, 1.5)
|
||||||
font.family: root.fontFamily
|
font.family: root.fontFamily
|
||||||
font.pixelSize: 12
|
font.pixelSize: 12
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
|
|||||||
@@ -744,7 +744,7 @@ Item {
|
|||||||
function onDraftRevisionChanged() { section.entries = root.sectionArray(section.sectionKey) }
|
function onDraftRevisionChanged() { section.entries = root.sectionArray(section.sectionKey) }
|
||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
RowLayout {
|
||||||
width: section.width
|
width: section.width
|
||||||
spacing: 8
|
spacing: 8
|
||||||
|
|
||||||
@@ -754,7 +754,7 @@ Item {
|
|||||||
font.family: root.fontFamily
|
font.family: root.fontFamily
|
||||||
font.pixelSize: 13
|
font.pixelSize: 13
|
||||||
font.bold: true
|
font.bold: true
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
@@ -762,21 +762,20 @@ Item {
|
|||||||
color: Qt.darker(root.foreground, 1.5)
|
color: Qt.darker(root.foreground, 1.5)
|
||||||
font.family: root.fontFamily
|
font.family: root.fontFamily
|
||||||
font.pixelSize: 11
|
font.pixelSize: 11
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
Item { Layout.fillWidth: true; implicitHeight: 1 }
|
||||||
width: Math.max(0, section.width - 200 - 100)
|
|
||||||
height: 1
|
|
||||||
}
|
|
||||||
|
|
||||||
SearchableDropdown {
|
SearchableDropdown {
|
||||||
id: addPill
|
id: addPill
|
||||||
label: " Add widget"
|
showLabel: false
|
||||||
|
triggerLabel: " Add widget"
|
||||||
value: ""
|
value: ""
|
||||||
placeholderText: "Search widgets..."
|
placeholderText: "Search widgets..."
|
||||||
emptyText: "No widgets to add"
|
emptyText: "No widgets to add"
|
||||||
width: 220
|
Layout.preferredWidth: 220
|
||||||
|
Layout.alignment: Qt.AlignVCenter
|
||||||
options: {
|
options: {
|
||||||
var list = root.availableToAdd(section.sectionKey)
|
var list = root.availableToAdd(section.sectionKey)
|
||||||
var out = []
|
var out = []
|
||||||
|
|||||||
Reference in New Issue
Block a user