summary refs log tree commit diff
path: root/resources
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2019-10-25 11:46:25 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2019-11-23 20:06:15 +0100
commitc8f97216faa74b9d3f1f92af7acc509dbe6b5647 (patch)
treeaa9e68c03bc79800cb108bbb19654a75d7634d80 /resources
parentUse a basic implementation of a DelegateChooser for compat with older Qt (diff)
downloadnheko-c8f97216faa74b9d3f1f92af7acc509dbe6b5647.tar.xz
Small fixes to delegate chooser implementation
Diffstat (limited to 'resources')
-rw-r--r--resources/qml/RowDelegateChooser.qml3
-rw-r--r--resources/qml/TimelineView.qml10
2 files changed, 10 insertions, 3 deletions
diff --git a/resources/qml/RowDelegateChooser.qml b/resources/qml/RowDelegateChooser.qml
index b7b6bdf4..bacd970a 100644
--- a/resources/qml/RowDelegateChooser.qml
+++ b/resources/qml/RowDelegateChooser.qml
@@ -5,7 +5,7 @@ import com.github.nheko 1.0
 import "./delegates"
 
 DelegateChooser {
-	role: "type"
+	//role: "type" //< not supported in our custom implementation, have to use roleValue
 	width: chat.width
 	roleValue: model.type
 
@@ -46,7 +46,6 @@ DelegateChooser {
 		TimelineRow { view: chat; Redacted { id: kid } }
 	}
 	DelegateChoice {
-		//roleValue: MtxEvent.Redacted
 		TimelineRow { view: chat; Placeholder { id: kid } }
 	}
 }
diff --git a/resources/qml/TimelineView.qml b/resources/qml/TimelineView.qml
index e09b9ed3..4e379567 100644
--- a/resources/qml/TimelineView.qml
+++ b/resources/qml/TimelineView.qml
@@ -90,7 +90,15 @@ Rectangle {
 		onMovementEnded: updatePosition()
 
 		spacing: 4
-		delegate: RowDelegateChooser {}
+		delegate: RowDelegateChooser {
+			function isFullyVisible() {
+				return height > 1 && (y - chat.contentY - 1) + height < chat.height
+			}
+			function getIndex() {
+				return index;
+			}
+
+		}
 
 		section {
 			property: "section"