2018-10-21 02:44:23 +03:00
|
|
|
import QtQuick 2.0
|
|
|
|
import Sailfish.Silica 1.0
|
|
|
|
|
2018-11-18 13:25:28 +03:00
|
|
|
Dialog {
|
2018-10-21 02:44:23 +03:00
|
|
|
id: page
|
|
|
|
|
2018-11-18 13:25:28 +03:00
|
|
|
onAccepted: {
|
2018-11-18 15:11:22 +03:00
|
|
|
account.updateNote(account.model.get(noteIndex).id, { 'category': categoryField.text, 'content': contentArea.text, 'favorite': favoriteButton.selected } )
|
2018-11-18 13:25:28 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
property var account
|
|
|
|
property int noteIndex
|
2018-10-21 02:44:23 +03:00
|
|
|
|
|
|
|
SilicaFlickable {
|
|
|
|
id: flickable
|
|
|
|
anchors.fill: parent
|
|
|
|
contentHeight: column.height
|
|
|
|
|
2018-10-23 23:15:59 +03:00
|
|
|
PullDownMenu {
|
2018-11-18 15:11:22 +03:00
|
|
|
/*MenuItem {
|
2018-10-23 23:15:59 +03:00
|
|
|
text: qsTr("Markdown Cheatsheet")
|
2018-11-18 13:25:28 +03:00
|
|
|
onClicked: pageStack.push(Qt.resolvedUrl("MarkdownPage.qml"))
|
2018-11-18 15:11:22 +03:00
|
|
|
}*/
|
|
|
|
MenuItem {
|
|
|
|
text: qsTr("Reset")
|
|
|
|
onClicked: {
|
|
|
|
categoryField.text = account.model.get(noteIndex).category
|
|
|
|
contentArea.text = account.model.get(noteIndex).content
|
|
|
|
favoriteButton.selected = account.model.get(noteIndex).favorite
|
|
|
|
}
|
2018-10-23 23:15:59 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-10-21 02:44:23 +03:00
|
|
|
Column {
|
|
|
|
id: column
|
|
|
|
width: parent.width// - 2*x
|
|
|
|
|
2018-11-18 13:25:28 +03:00
|
|
|
DialogHeader {
|
|
|
|
title: account.model.get(noteIndex).title
|
2018-10-21 02:44:23 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
TextArea {
|
2018-11-18 13:25:28 +03:00
|
|
|
id: contentArea
|
2018-10-21 02:44:23 +03:00
|
|
|
width: parent.width
|
2018-11-18 13:25:28 +03:00
|
|
|
text: account.model.get(noteIndex).content
|
|
|
|
}
|
|
|
|
|
|
|
|
Row {
|
|
|
|
x: Theme.horizontalPageMargin
|
|
|
|
width: parent.width - x
|
|
|
|
IconButton {
|
|
|
|
id: favoriteButton
|
2018-11-18 15:11:22 +03:00
|
|
|
property bool selected: account.model.get(noteIndex).favorite
|
2018-11-18 13:25:28 +03:00
|
|
|
width: Theme.iconSizeMedium
|
2018-11-18 15:11:22 +03:00
|
|
|
icon.source: (selected ? "image://theme/icon-m-favorite-selected?" : "image://theme/icon-m-favorite?") +
|
2018-11-18 13:25:28 +03:00
|
|
|
(favoriteButton.highlighted ? Theme.secondaryHighlightColor : Theme.secondaryColor)
|
2018-11-18 15:11:22 +03:00
|
|
|
onClicked: selected = !selected
|
2018-11-18 13:25:28 +03:00
|
|
|
}
|
|
|
|
TextField {
|
|
|
|
id: categoryField
|
|
|
|
width: parent.width - favoriteButton.width
|
|
|
|
text: account.model.get(noteIndex).category
|
|
|
|
placeholderText: qsTr("Category")
|
|
|
|
label: placeholderText
|
|
|
|
}
|
|
|
|
|
2018-10-21 02:44:23 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
VerticalScrollDecorator {}
|
|
|
|
}
|
|
|
|
}
|