Hide file filter if only 1 file type

This commit is contained in:
David Rowe 2016-05-10 15:09:13 +12:00
parent 663a2ddc64
commit b8c0ec86af
3 changed files with 6 additions and 4 deletions

View file

@ -296,8 +296,8 @@ ModalWindow {
label: "Path:"
anchors {
left: parent.left
right: root.selectDirectory ? parent.right : selectionType.left
rightMargin: root.selectDirectory ? 0 : hifi.dimensions.contentSpacing.x
right: selectionType.visible ? selectionType.left: parent.right
rightMargin: selectionType.visible ? hifi.dimensions.contentSpacing.x : 0
bottom: buttonRow.top
bottomMargin: hifi.dimensions.contentSpacing.y
}
@ -314,7 +314,7 @@ ModalWindow {
left: buttonRow.left
right: parent.right
}
visible: !selectDirectory
visible: !selectDirectory && filtersCount > 1
KeyNavigation.left: fileTableView
KeyNavigation.right: openButton
}

View file

@ -16,6 +16,7 @@ ComboBox {
id: root
property string filtersString: "All Files (*.*)";
property var currentFilter: [ "*.*" ];
property int filtersCount: filtersString.split(';;').length
// Per http://doc.qt.io/qt-5/qfiledialog.html#getOpenFileName the string can contain
// multiple filters separated by semicolons

View file

@ -216,7 +216,8 @@ ApplicationWindow {
property var builder: Component {
FileDialog {
title: "Open File"
filter: "*.js"
filter: "All Files (*.*)"
//filter: "HTML files (*.html);;Other(*.png)"
}
}