testbench: save search text between session
This makes using the testbench more convenient, as you don't need to search for the controls you're interested in each time you run it. Also added an extra font icon (clear), which required regenerating the set from fontello. The same license is still applicable since they're from Font Awesome. Pick-to: 6.5 Change-Id: I9b44f7f8bce0bb4032071c19186eb5affbfe42a5 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
This commit is contained in:
parent
f641848af9
commit
29106dc0c0
|
@ -91,7 +91,7 @@ qt_internal_add_resource(testbench "qml"
|
|||
${qml_resource_files}
|
||||
)
|
||||
set(fonts_resource_files
|
||||
"fonts/fontawesome.ttf"
|
||||
"fonts/fontello.ttf"
|
||||
)
|
||||
|
||||
qt_internal_add_resource(testbench "fonts"
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -28,7 +28,7 @@ int main(int argc, char *argv[])
|
|||
else
|
||||
QQuickStyle::setStyle(settings.value("style").isValid() ? settings.value("style").toString() : "Imagine");
|
||||
|
||||
if (QFontDatabase::addApplicationFont(":/fonts/fontawesome.ttf") == -1) {
|
||||
if (QFontDatabase::addApplicationFont(":/fonts/fontello.ttf") == -1) {
|
||||
qWarning() << "Failed to load fontawesome font";
|
||||
}
|
||||
|
||||
|
|
|
@ -85,6 +85,8 @@ Ui.ApplicationWindow {
|
|||
property bool autoFixImagineAssets
|
||||
property alias imagineDirLastModified: assetFixer.assetDirectoryLastModified
|
||||
|
||||
property string lastSearchText
|
||||
|
||||
Component.onCompleted: settingsLoaded = true
|
||||
}
|
||||
|
||||
|
@ -119,7 +121,7 @@ Ui.ApplicationWindow {
|
|||
|
||||
ToolButton {
|
||||
text: "\uf0c9"
|
||||
font.family: "fontawesome"
|
||||
font.family: "fontello"
|
||||
font.pixelSize: Qt.application.font.pixelSize * 1.6
|
||||
onClicked: drawer.open()
|
||||
}
|
||||
|
@ -129,6 +131,22 @@ Ui.ApplicationWindow {
|
|||
TextField {
|
||||
id: searchTextField
|
||||
placeholderText: "Search"
|
||||
text: settings.lastSearchText
|
||||
onTextEdited: settings.lastSearchText = text
|
||||
}
|
||||
|
||||
ToolButton {
|
||||
text: "\ue801"
|
||||
font.family: "fontello"
|
||||
visible: searchTextField.length > 0
|
||||
onClicked: searchTextField.clear()
|
||||
|
||||
Layout.leftMargin: -5
|
||||
}
|
||||
|
||||
Label {
|
||||
text: controlFolderListModel.count + " result(s)"
|
||||
visible: searchTextField.length > 0
|
||||
}
|
||||
|
||||
Item {
|
||||
|
@ -138,7 +156,7 @@ Ui.ApplicationWindow {
|
|||
ToolButton {
|
||||
id: optionsMenuButton
|
||||
text: "\ue800"
|
||||
font.family: "FontAwesome"
|
||||
font.family: "fontello"
|
||||
font.pixelSize: Qt.application.font.pixelSize * 1.6
|
||||
checked: optionsMenu.visible
|
||||
checkable: true
|
||||
|
|
Loading…
Reference in New Issue