mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-06-27 07:48:19 +00:00
add scrolling to standard MyComboBox to prevent Mistral clipping
Signed-off-by: Jared Van Bortel <jared@nomic.ai>
This commit is contained in:
parent
d41a08c627
commit
d73abb493e
@ -60,29 +60,30 @@ ComboBox {
|
|||||||
highlighted: comboBox.highlightedIndex === index
|
highlighted: comboBox.highlightedIndex === index
|
||||||
}
|
}
|
||||||
popup: Popup {
|
popup: Popup {
|
||||||
// FIXME This should be made much nicer to take into account lists that are very long so
|
|
||||||
// that it is scrollable and also sized optimally taking into account the x,y and the content
|
|
||||||
// width and height as well as the window width and height
|
|
||||||
y: comboBox.height - 1
|
y: comboBox.height - 1
|
||||||
width: comboBox.width
|
width: comboBox.width
|
||||||
implicitHeight: contentItem.implicitHeight + 20
|
implicitHeight: Math.min(window.height - y, contentItem.implicitHeight + 20)
|
||||||
padding: 0
|
padding: 0
|
||||||
|
|
||||||
contentItem: Rectangle {
|
contentItem: Rectangle {
|
||||||
implicitWidth: myListView.contentWidth
|
implicitWidth: comboBox.width
|
||||||
implicitHeight: myListView.contentHeight
|
implicitHeight: myListView.contentHeight
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
ListView {
|
radius: 10
|
||||||
id: myListView
|
ScrollView {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: 10
|
anchors.margins: 10
|
||||||
clip: true
|
clip: true
|
||||||
|
ScrollBar.vertical.policy: ScrollBar.AsNeeded
|
||||||
|
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
||||||
|
ListView {
|
||||||
|
id: myListView
|
||||||
implicitHeight: contentHeight
|
implicitHeight: contentHeight
|
||||||
model: comboBox.popup.visible ? comboBox.delegateModel : null
|
model: comboBox.popup.visible ? comboBox.delegateModel : null
|
||||||
currentIndex: comboBox.highlightedIndex
|
currentIndex: comboBox.highlightedIndex
|
||||||
ScrollIndicator.vertical: ScrollIndicator { }
|
ScrollIndicator.vertical: ScrollIndicator { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
color: theme.menuBackgroundColor//theme.controlBorder
|
color: theme.menuBackgroundColor//theme.controlBorder
|
||||||
|
Loading…
Reference in New Issue
Block a user