89 lines
2.1 KiB
QML
89 lines
2.1 KiB
QML
import QtQuick 2.0
|
|
import Sailfish.Silica 1.0
|
|
import Sailfish.Pickers 1.0
|
|
|
|
Page {
|
|
id: recentFiles
|
|
allowedOrientations: Orientation.All
|
|
|
|
SilicaListView {
|
|
id: listView
|
|
anchors.fill:parent
|
|
|
|
header: PageHeader {
|
|
title: qsTr("Recent Files")
|
|
}
|
|
|
|
model: ListModel {
|
|
ListElement { filename: "org.org"; datetime: "8 oct 2020"}
|
|
}
|
|
|
|
delegate: ListItem {
|
|
id: recentFileItem
|
|
anchors {
|
|
left: parent.left
|
|
right: parent.right
|
|
}
|
|
contentHeight: Theme.itemSizeSmall
|
|
|
|
Label {
|
|
id: filename
|
|
text: model.filename
|
|
anchors {
|
|
top: parent.top
|
|
left: parent.left
|
|
}
|
|
anchors.leftMargin: Theme.horizontalPageMargin
|
|
font.pixelSize: Theme.fontSizeLarge
|
|
}
|
|
|
|
Label {
|
|
id: datetime
|
|
text: model.datetime
|
|
anchors {
|
|
bottom: parent.bottom
|
|
right: parent.right
|
|
rightMargin: Theme.horizontalPageMargin
|
|
}
|
|
font.pixelSize: Theme.fontSizeTiny
|
|
}
|
|
|
|
menu: ContextMenu {
|
|
MenuItem {
|
|
text: qsTr("Remove from list")
|
|
}
|
|
|
|
MenuItem {
|
|
text: qsTr("Delete file")
|
|
}
|
|
}
|
|
}
|
|
|
|
ViewPlaceholder {
|
|
id: placeholder
|
|
enabled: listView.count == 0
|
|
text: qsTr("Pull down to open a file")
|
|
}
|
|
|
|
PullDownMenu {
|
|
MenuItem {
|
|
text: qsTr("Open file...")
|
|
onClicked: pageStack.push(contentPickerPage)
|
|
}
|
|
}
|
|
|
|
PushUpMenu {
|
|
MenuItem {
|
|
text: qsTr("Scroll to top")
|
|
onClicked: scrollToTop()
|
|
}
|
|
}
|
|
|
|
Component {
|
|
id: contentPickerPage
|
|
ContentPickerPage {
|
|
title: qsTr("Open file")
|
|
}
|
|
}
|
|
}
|
|
}
|