Tweak textarea.

This commit is contained in:
Black Hat 2018-09-20 07:01:55 +08:00
parent 0361432c3d
commit 459920657c
5 changed files with 18 additions and 11 deletions

View File

@ -109,6 +109,14 @@ RowLayout {
spacing: 4
AutoLabel {
visible: userMarker.length > 5
text: userMarker.length - 5 + "+"
coloredBackground: highlighted
Material.foreground: "grey"
font.pointSize: 8
}
Repeater {
model: userMarker.length > 5 ? userMarker.slice(0, 5) : userMarker
@ -121,14 +129,6 @@ RowLayout {
}
}
AutoLabel {
visible: userMarker.length > 5
text: userMarker.length - 5 + "+"
coloredBackground: highlighted
Material.foreground: "grey"
font.pointSize: 8
}
AutoLabel {
id: timeLabel

View File

@ -336,6 +336,8 @@ Item {
Layout.fillWidth: true
Layout.preferredHeight: 48
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
clip: true
TextArea {
@ -343,6 +345,7 @@ Item {
id: inputField
wrapMode: Text.Wrap
placeholderText: "Send a Message"
leftPadding: 16
topPadding: 0

View File

@ -1,6 +1,7 @@
QT += quick widgets multimedia
CONFIG += c++14
CONFIG += object_parallel_to_source
CONFIG += link_pkgconfig
# Enable this to use QtQuick Compiler.
#CONFIG += qtquickcompiler
@ -9,7 +10,6 @@ TARGET = spectral
packagesExist(QMatrixClient) {
message("Found libQMatrixClient via pkg-config.")
CONFIG += link_pkgconfig
PKGCONFIG += QMatrixClient
} else {
include(include/libqmatrixclient/libqmatrixclient.pri)

View File

@ -142,6 +142,8 @@ void SpectralRoom::sendReply(QString userId, QString eventId,
}
QDateTime SpectralRoom::lastActiveTime() {
if (timelineSize() == 0) return QDateTime();
return messageEvents().rbegin()->get()->timestamp();
if (timelineSize() == 0) return QDateTime();
return messageEvents().rbegin()->get()->timestamp();
}
float SpectralRoom::orderForTag(QString name) { return tag(name).order; }

View File

@ -37,6 +37,8 @@ class SpectralRoom : public Room {
QDateTime lastActiveTime();
Q_INVOKABLE float orderForTag(QString name);
private:
QString m_cachedInput;
QSet<const QMatrixClient::RoomEvent*> highlights;