Add an eof indicator

This commit is contained in:
Renaud Casenave-Péré 2023-01-05 23:26:30 +01:00
parent bb9a2da276
commit 132146049f
2 changed files with 20 additions and 3 deletions

View file

@ -20,7 +20,8 @@
+rawtext-role+
+headline-depth-role+
+depth-role+
+title-role+)
+title-role+
+last-item-role+)
(defvar *current-pathname* nil)
@ -165,13 +166,16 @@
(#.+depth-role+
(qvariant-from-value (node-depth item) "int"))
(#.+title-role+
(qvariant-from-value (title-of item) "QString"))))))))
(qvariant-from-value (title-of item) "QString"))
(#.+last-item-role+
(qvariant-from-value (= row (1- *nodes-count*)) "bool"))))))))
(qoverride model "roleNames()"
(lambda ()
(list (cons +nodetype-role+ "nodeType")
(cons +rawtext-role+ "rawtext")
(cons +depth-role+ "depth")
(cons +title-role+ "title"))))
(cons +title-role+ "title")
(cons +last-item-role+ "isLastItem"))))
(when *org-model*
(qdelete *org-model*))
(setf *org-model* model)

View file

@ -31,6 +31,19 @@ Item {
}
}
GlassItem {
id: eof
visible: isLastItem
anchors.top: orgItem.bottom
height: Theme.paddingLarge
width: parent.width
falloffRadius: 0.15
radius: 0.15
color: palette.highlightColor
cache: true
}
onFocusedChanged: {
if (focused)
document.focusedItem = orgItem