summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2022-04-01 16:50:18 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2022-04-01 16:50:18 +0200
commitaf4e174d99ddb2905add4f8ea51c2845e92096ee (patch)
tree421e7f8d2f34d7559642861ed72dee8017e7f85f
parent96fbfab9731e2b4211b1f785c41a6026682d74ad (diff)
Separate text updates for timeline and other consumers
-rw-r--r--resources/qml/Root.qml2
-rw-r--r--src/timeline/InputBar.cpp3
-rw-r--r--src/timeline/InputBar.h2
3 files changed, 5 insertions, 2 deletions
diff --git a/resources/qml/Root.qml b/resources/qml/Root.qml
index 1171d919..590ccfc4 100644
--- a/resources/qml/Root.qml
+++ b/resources/qml/Root.qml
@@ -24,7 +24,7 @@ Pane {
palette: Nheko.colors
background: null
padding: 0
- rotation: Rooms.currentRoom ? Rooms.currentRoom.input.text.length : 0
+ rotation: Rooms.currentRoom ? Rooms.currentRoom.input.liveText.length : 0
layer.smooth: true
layer.mipmap: true
antialiasing: true
diff --git a/src/timeline/InputBar.cpp b/src/timeline/InputBar.cpp
index 1de7a141..bb2e4acd 100644
--- a/src/timeline/InputBar.cpp
+++ b/src/timeline/InputBar.cpp
@@ -229,6 +229,7 @@ InputBar::setText(const QString &newText)
updateAtRoom(QLatin1String(""));
emit textChanged(newText);
+ emit liveTextChanged(newText);
}
void
InputBar::updateState(int selectionStart_,
@@ -250,7 +251,7 @@ InputBar::updateState(int selectionStart_,
updateAtRoom(text_);
// disabled, as it moves the cursor to the end
- // emit textChanged(text_);
+ emit liveTextChanged(text_);
}
selectionStart = selectionStart_;
diff --git a/src/timeline/InputBar.h b/src/timeline/InputBar.h
index 28a4bcf6..62202bce 100644
--- a/src/timeline/InputBar.h
+++ b/src/timeline/InputBar.h
@@ -164,6 +164,7 @@ class InputBar : public QObject
Q_PROPERTY(bool uploading READ uploading NOTIFY uploadingChanged)
Q_PROPERTY(bool containsAtRoom READ containsAtRoom NOTIFY containsAtRoomChanged)
Q_PROPERTY(QString text READ text NOTIFY textChanged)
+ Q_PROPERTY(QString liveText READ text NOTIFY liveTextChanged)
Q_PROPERTY(QVariantList uploads READ uploads NOTIFY uploadsChanged)
public:
@@ -214,6 +215,7 @@ private slots:
signals:
void insertText(QString text);
void textChanged(QString newText);
+ void liveTextChanged(QString newText);
void uploadingChanged(bool value);
void containsAtRoomChanged();
void uploadsChanged();