Added details to the view.

This commit is contained in:
Scharel Clemens 2018-11-26 17:21:33 +01:00
parent 29335f9c51
commit ff1e3715b4

View file

@ -55,11 +55,12 @@ Dialog {
SilicaFlickable { SilicaFlickable {
anchors.fill: parent anchors.fill: parent
contentHeight: column.height contentHeight: mainColumn.height
Column { Column {
id: column id: mainColumn
width: parent.width width: parent.width
RemorsePopup { RemorsePopup {
id: remorse id: remorse
onTriggered: pageStack.pop() onTriggered: pageStack.pop()
@ -95,21 +96,51 @@ Dialog {
cancelText: qsTr("Notes") cancelText: qsTr("Notes")
} }
LinkedLabel { Column {
id: contentLabel width: parent.width
x: Theme.horizontalPageMargin spacing: Theme.paddingLarge
width: parent.width - 2*x
textFormat: Text.StyledText
function parse() { LinkedLabel {
var lines = plainText.split('\n') id: contentLabel
lines.splice(0,1); x: Theme.horizontalPageMargin
var tmpText = lines.join('\n'); width: parent.width - 2*x
for (var i=0; i < markdown.length; i++) { textFormat: Text.StyledText
tmpText = tmpText.replace(markdown[i].regex, markdown[i].replace)
function parse() {
var lines = plainText.split('\n')
lines.splice(0,1);
var tmpText = lines.join('\n');
for (var i=0; i < markdown.length; i++) {
tmpText = tmpText.replace(markdown[i].regex, markdown[i].replace)
}
text = tmpText
//console.log(text)
}
}
Separator {
id: separator
width: parent.width
color: Theme.primaryColor
horizontalAlignment: Qt.AlignHCenter
}
Column {
width: parent.width
DetailItem {
label: qsTr("Modified")
value: new Date(account.model.get(noteIndex).modified * 1000).toLocaleString(Qt.locale(), Locale.ShortFormat)
}
DetailItem {
label: qsTr("Favorite")
value: account.model.get(noteIndex).favorite ? qsTr("yes") : qsTr("no")
}
DetailItem {
label: qsTr("Category")
value: account.model.get(noteIndex).category
visible: value.length > 0
} }
text = tmpText
//console.log(text)
} }
} }
} }