feat: FluAutoSuggestBox支持设置建议行数和行高以及pressed时显示建议

This commit is contained in:
Polaris-Night
2025-05-07 23:15:32 +08:00
parent 6b9f7a1c99
commit 5de9588b93
5 changed files with 62 additions and 31 deletions

View File

@ -2487,8 +2487,8 @@ Some contents...</source>
<location filename="qml/page/T_TextBox.qml" line="33"/>
<location filename="qml/page/T_TextBox.qml" line="64"/>
<location filename="qml/page/T_TextBox.qml" line="97"/>
<location filename="qml/page/T_TextBox.qml" line="128"/>
<location filename="qml/page/T_TextBox.qml" line="157"/>
<location filename="qml/page/T_TextBox.qml" line="135"/>
<location filename="qml/page/T_TextBox.qml" line="168"/>
<source>Disabled</source>
<translation type="unfinished"></translation>
</message>
@ -2507,6 +2507,11 @@ Some contents...</source>
<source>AutoSuggestBox</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TextBox.qml" line="131"/>
<source>Show suggest when pressed</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>T_Theme</name>

View File

@ -2676,8 +2676,8 @@ Some contents...</source>
<location filename="qml/page/T_TextBox.qml" line="33"/>
<location filename="qml/page/T_TextBox.qml" line="64"/>
<location filename="qml/page/T_TextBox.qml" line="97"/>
<location filename="qml/page/T_TextBox.qml" line="128"/>
<location filename="qml/page/T_TextBox.qml" line="157"/>
<location filename="qml/page/T_TextBox.qml" line="135"/>
<location filename="qml/page/T_TextBox.qml" line="168"/>
<source>Disabled</source>
<translation type="unfinished">禁用</translation>
</message>
@ -2696,6 +2696,11 @@ Some contents...</source>
<source>AutoSuggestBox</source>
<translation type="unfinished">自动建议框</translation>
</message>
<message>
<location filename="qml/page/T_TextBox.qml" line="131"/>
<source>Show suggest when pressed</source>
<translation>按下时显示建议</translation>
</message>
</context>
<context>
<name>T_Theme</name>

View File

@ -114,18 +114,26 @@ FluScrollablePage{
placeholderText: qsTr("AutoSuggestBox")
items: generateRandomNames(100)
disabled: text_box_suggest_switch.checked
itemRows: 12
showSuggestWhenPressed: text_box_show_suggest_switch.checked
anchors{
verticalCenter: parent.verticalCenter
left: parent.left
}
}
FluToggleSwitch{
id:text_box_suggest_switch
RowLayout{
anchors{
verticalCenter: parent.verticalCenter
right: parent.right
}
text: qsTr("Disabled")
FluToggleSwitch{
id:text_box_show_suggest_switch
text: qsTr("Show suggest when pressed")
}
FluToggleSwitch{
id:text_box_suggest_switch
text: qsTr("Disabled")
}
}
}
CodeExpander{
@ -133,6 +141,9 @@ FluScrollablePage{
Layout.topMargin: -6
code:'FluAutoSuggestBox{
placeholderText: qsTr("AutoSuggestBox")
itemRows: 12
itemHeight: 38
showSuggestWhenPressed: false
}'
}