summary refs log tree commit diff
path: root/resources/qml
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2020-05-04 13:14:54 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2020-05-04 13:14:54 +0200
commit54013e4a00b49721b79f141bca101523a1e82282 (patch)
tree34adeb66f50ede30913fafebbdc6d5f6b9d8fc43 /resources/qml
parentAdd placeholder for reactions (diff)
downloadnheko-54013e4a00b49721b79f141bca101523a1e82282.tar.xz
Basic, broken reaction display
Diffstat (limited to 'resources/qml')
-rw-r--r--resources/qml/Reactions.qml20
-rw-r--r--resources/qml/TimelineRow.qml1
-rw-r--r--resources/qml/TimelineView.qml1
3 files changed, 10 insertions, 12 deletions
diff --git a/resources/qml/Reactions.qml b/resources/qml/Reactions.qml
index 86f0071b..c15f0b3d 100644
--- a/resources/qml/Reactions.qml
+++ b/resources/qml/Reactions.qml
@@ -5,18 +5,14 @@ Flow {
 	anchors.left: parent.left
 	anchors.right: parent.right
 	spacing: 4
+
+	property alias reactions: repeater.model
+
 	Repeater {
-		model: ListModel {
-			id: nameModel
-			ListElement { key: "😊"; count: 5; reactedBySelf: true; users: "Nico, RedSky, AAA, BBB, CCC" }
-			ListElement { key: "🤠"; count: 6; reactedBySelf: false; users: "Nico, AAA, BBB, CCC" }
-			ListElement { key: "💘"; count: 1; reactedBySelf: true; users: "Nico" }
-			ListElement { key: "🙈"; count: 7; reactedBySelf: false; users: "Nico, RedSky, AAA, BBB, CCC, DDD" }
-			ListElement { key: "👻"; count: 6; reactedBySelf: false; users: "Nico, RedSky, BBB, CCC" }
-		}
+		id: repeater
+
 		Button {
 			id: reaction
-			//border.width: 1
 			text: model.key
 			hoverEnabled: true
 			implicitWidth: contentItem.childrenRect.width + contentItem.padding*2
@@ -33,7 +29,7 @@ Flow {
 				Text {
 					id: reactionText
 					text: reaction.text
-					font: reaction.font
+					font.family: settings.emoji_font_family
 					opacity: enabled ? 1.0 : 0.3
 					color: reaction.hovered ? colors.highlight : colors.buttonText
 					horizontalAlignment: Text.AlignHCenter
@@ -48,7 +44,7 @@ Flow {
 				}
 
 				Text {
-					text: model.count
+					text: model.counter
 					font: reaction.font
 					opacity: enabled ? 1.0 : 0.3
 					color: reaction.hovered ? colors.highlight : colors.buttonText
@@ -63,7 +59,7 @@ Flow {
 				implicitWidth: reaction.implicitWidth
 				implicitHeight: reaction.implicitHeight
 				opacity: enabled ? 1 : 0.3
-				border.color: (reaction.hovered || model.reactedBySelf )? colors.highlight : colors.buttonText
+				border.color: (reaction.hovered || model.selfReacted )? colors.highlight : colors.buttonText
 				color: colors.dark
 				border.width: 1
 				radius: reaction.height / 2.0
diff --git a/resources/qml/TimelineRow.qml b/resources/qml/TimelineRow.qml
index f3262fbd..22222ef3 100644
--- a/resources/qml/TimelineRow.qml
+++ b/resources/qml/TimelineRow.qml
@@ -54,6 +54,7 @@ MouseArea {
 			}
 
 			Reactions {
+				reactions: model.reactions
 			}
 		}
 
diff --git a/resources/qml/TimelineView.qml b/resources/qml/TimelineView.qml
index 997f901e..28d282a1 100644
--- a/resources/qml/TimelineView.qml
+++ b/resources/qml/TimelineView.qml
@@ -25,6 +25,7 @@ Page {
 		id: settings
 		category: "user"
 		property bool avatar_circles: true
+		property string emoji_font_family: "default"
 	}
 
 	Settings {