summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2023-06-06 00:29:46 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2023-06-08 22:32:14 +0200
commit04cbbd2837979b7208cc1a8d183b6dc4580d937b (patch)
treed0b631b5855d72fbd82e58221dbe94bca1391e93
parentFix palette in popups (diff)
downloadnheko-04cbbd2837979b7208cc1a8d183b6dc4580d937b.tar.xz
Replace some binding loops with others
-rw-r--r--resources/qml/MessageView.qml1
-rw-r--r--resources/qml/TimelineRow.qml1
-rw-r--r--resources/qml/delegates/FileMessage.qml7
-rw-r--r--resources/qml/delegates/MessageDelegate.qml2
-rw-r--r--resources/qml/delegates/TextMessage.qml2
5 files changed, 7 insertions, 6 deletions
diff --git a/resources/qml/MessageView.qml b/resources/qml/MessageView.qml
index e80770bb..002f64b9 100644
--- a/resources/qml/MessageView.qml
+++ b/resources/qml/MessageView.qml
@@ -164,6 +164,7 @@ Item {
                 userId: wrapper.userId
                 userName: wrapper.userName
                 y: section.visible && section.active ? section.y + section.height : 0
+                width: wrapper.width
 
                 background: Rectangle {
                     id: scrollHighlight
diff --git a/resources/qml/TimelineRow.qml b/resources/qml/TimelineRow.qml
index a064bd15..9c8ebdc6 100644
--- a/resources/qml/TimelineRow.qml
+++ b/resources/qml/TimelineRow.qml
@@ -50,7 +50,6 @@ AbstractButton {
 
     height: row.height + (reactionRow.height > 0 ? reactionRow.height - 2 : 0) + unreadRow.height
     hoverEnabled: true
-    width: parent.width
 
     states: State {
         name: "dragging"
diff --git a/resources/qml/delegates/FileMessage.qml b/resources/qml/delegates/FileMessage.qml
index e63ca8e3..48546592 100644
--- a/resources/qml/delegates/FileMessage.qml
+++ b/resources/qml/delegates/FileMessage.qml
@@ -11,14 +11,13 @@ Item {
     required property string filename
     required property string filesize
 
-    height: row.height + (Settings.bubbles? 16: 24)
-    width: parent.width
-    implicitWidth: row.implicitWidth+metadataWidth
+    height: rowa.height + (Settings.bubbles? 16: 24)
+    implicitWidth: rowa.implicitWidth + metadataWidth
     property int metadataWidth
     property bool fitsMetadata: true
 
     RowLayout {
-        id: row
+        id: rowa
 
         anchors.centerIn: parent
         width: parent.width - (Settings.bubbles? 16 : 24)
diff --git a/resources/qml/delegates/MessageDelegate.qml b/resources/qml/delegates/MessageDelegate.qml
index 3aea823f..3683ee78 100644
--- a/resources/qml/delegates/MessageDelegate.qml
+++ b/resources/qml/delegates/MessageDelegate.qml
@@ -39,6 +39,8 @@ Item {
     property bool fitsMetadata: (chooser.child && chooser.child.fitsMetadata) ? chooser.child.fitsMetadata : false
     property int metadataWidth
 
+    implicitWidth: chooser.child?.implicitWidth
+
     height: chooser.child ? chooser.child.height : Nheko.paddingLarge
 
     DelegateChooser {
diff --git a/resources/qml/delegates/TextMessage.qml b/resources/qml/delegates/TextMessage.qml
index 39e8b1a8..c6a8cace 100644
--- a/resources/qml/delegates/TextMessage.qml
+++ b/resources/qml/delegates/TextMessage.qml
@@ -14,7 +14,7 @@ MatrixText {
     required property string formatted
     property string copyText: selectedText ? getText(selectionStart, selectionEnd) : body
     property int metadataWidth
-    property bool fitsMetadata: positionAt(width,height-4) == positionAt(width-metadataWidth-10, height-4)
+    property bool fitsMetadata: false //positionAt(width,height-4) == positionAt(width-metadataWidth-10, height-4)
 
     // table border-collapse doesn't seem to work
     text: "