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 spacing: 4
AutoLabel {
visible: userMarker.length > 5
text: userMarker.length - 5 + "+"
coloredBackground: highlighted
Material.foreground: "grey"
font.pointSize: 8
}
Repeater { Repeater {
model: userMarker.length > 5 ? userMarker.slice(0, 5) : userMarker 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 { AutoLabel {
id: timeLabel id: timeLabel

View File

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

View File

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

View File

@ -142,6 +142,8 @@ void SpectralRoom::sendReply(QString userId, QString eventId,
} }
QDateTime SpectralRoom::lastActiveTime() { QDateTime SpectralRoom::lastActiveTime() {
if (timelineSize() == 0) return QDateTime(); if (timelineSize() == 0) return QDateTime();
return messageEvents().rbegin()->get()->timestamp(); 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(); QDateTime lastActiveTime();
Q_INVOKABLE float orderForTag(QString name);
private: private:
QString m_cachedInput; QString m_cachedInput;
QSet<const QMatrixClient::RoomEvent*> highlights; QSet<const QMatrixClient::RoomEvent*> highlights;