Commit fa352746 authored by Martin Straka's avatar Martin Straka

Updated qml file dialogue - folder list centering

parent b9c91fe8
......@@ -46,9 +46,12 @@ Dialog {
property int selectedFileIndex: -1
function raise(title) {
function raise(title, filters) {
root.title = title
folderModel.folder = standardLocationUrl(InteractionFilesystem.DESKTOP_LOCATION)
if (filters != "") {
folderModel.nameFilters = [filters]
}
root.open()
}
......@@ -97,7 +100,7 @@ Dialog {
right: parent.right;
}
spacing: 6
spacing: formItemVerticalSpacing
Button {
id: upButton
......@@ -150,14 +153,11 @@ Dialog {
/* Fill remaining space with the list content. */
Layout.fillHeight: true
Layout.fillWidth: true
FolderListModel {
id: folderModel
showDirsFirst: true
nameFilters: ["*.*"]
folder: standardLocationUrl(InteractionFilesystem.DESKTOP_LOCATION)
onFolderChanged: {
selectedFileIndex = -1
pathField.text = stripUrlPrefix(folder)
......@@ -166,31 +166,21 @@ Dialog {
Component {
id: fileDelegate
Rectangle {
color: (index == selectedFileIndex) ? datovkaPalette.highlight : "#00000000"
color: (index == selectedFileIndex) ? datovkaPalette.highlight : datovkaPalette.window
width: fileList.width
height: childrenRect.height
height: imgHeight
RowLayout {
anchors {
left: parent.left;
right: parent.right;
}
anchors.fill: parent
Text {
anchors {
left: parent.left;
}
anchors.left: parent.left
Layout.fillWidth: true
elide: Text.ElideRight
/* Add '>' to directory names. */
text: fileName
}
Text {
anchors {
right: parent.right;
}
anchors.right: parent.right
/* Add '>' to directory names. */
text: fileIsDir ? " >" : ""
}
......@@ -208,12 +198,11 @@ Dialog {
}
}
}
}
} // Component
model: folderModel
delegate: fileDelegate
}
}
} // ListView
} // ColumnLayout
onAccepted: {
if (selectedFileIndex != -1) {
......
......@@ -49,7 +49,9 @@ Item {
id: fileDialogue
onFinished: {
if (path == "") {
certPathLabelId.visible = false
if (certPathLabelId.text == "") {
certPathLabelId.visible = false
}
} else {
certPathLabelId.visible = true
certPathLabelId.text = path
......@@ -218,7 +220,7 @@ Item {
height: inputItemHeight
font.pointSize: defaultTextFont.font.pointSize
onClicked: {
fileDialogue.raise("Select certificate file")
fileDialogue.raise("Select certificate file", "*.pem")
}
}
Text {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment