diff --git a/resources/qml/TimelineView.qml b/resources/qml/TimelineView.qml index f0f73ec9..e97b560a 100644 --- a/resources/qml/TimelineView.qml +++ b/resources/qml/TimelineView.qml @@ -1,17 +1,23 @@ import QtQuick 2.6 import QtQuick.Controls 2.5 import QtQuick.Layouts 1.5 +import QtGraphicalEffects 1.0 import com.github.nheko 1.0 Rectangle { anchors.fill: parent + SystemPalette { id: colors; colorGroup: SystemPalette.Active } + SystemPalette { id: inactiveColors; colorGroup: SystemPalette.Disabled } + color: colors.window + Text { visible: !timelineManager.timeline anchors.centerIn: parent text: qsTr("No room open") font.pointSize: 24 + color: colors.windowText } ListView { @@ -67,16 +73,22 @@ Rectangle { Layout.alignment: Qt.AlignRight | Qt.AlignTop id: replyButton flat: true - height: replyButtonImg.contentHeight - width: replyButtonImg.contentWidth + height: 32 + width: 32 ToolTip.visible: hovered ToolTip.text: qsTr("Reply") + Image { id: replyButtonImg // Workaround, can't get icon.source working for now... anchors.fill: parent source: "qrc:/icons/icons/ui/mail-reply.png" } + ColorOverlay { + anchors.fill: replyButtonImg + source: replyButtonImg + color: colors.buttonText + } } Button { Layout.alignment: Qt.AlignRight | Qt.AlignTop @@ -92,6 +104,11 @@ Rectangle { anchors.fill: parent source: "qrc:/icons/icons/ui/vertical-ellipsis.png" } + ColorOverlay { + anchors.fill: optionsButtonImg + source: optionsButtonImg + color: colors.buttonText + } onClicked: contextMenu.open() @@ -117,6 +134,7 @@ Rectangle { Text { Layout.alignment: Qt.AlignRight | Qt.AlignTop text: model.timestamp.toLocaleTimeString("HH:mm") + color: inactiveColors.text } } @@ -134,13 +152,14 @@ Rectangle { anchors.horizontalCenter: parent.horizontalCenter visible: section.includes(" ") text: chat.model.formatDateSeparator(new Date(Number(section.split(" ")[1]))) + color: colors.windowText height: contentHeight * 1.2 width: contentWidth * 1.2 horizontalAlignment: Text.AlignHCenter background: Rectangle { radius: parent.height / 2 - color: "black" + color: colors.dark } } Row { @@ -155,7 +174,7 @@ Rectangle { Text { id: userName text: chat.model.displayName(section.split(" ")[0]) - color: chat.model.userColor(section.split(" ")[0], "#ffffff") + color: chat.model.userColor(section.split(" ")[0], colors.window) } } } diff --git a/resources/qml/delegates/NoticeMessage.qml b/resources/qml/delegates/NoticeMessage.qml new file mode 100644 index 00000000..5f04d235 --- /dev/null +++ b/resources/qml/delegates/NoticeMessage.qml @@ -0,0 +1,12 @@ +import QtQuick 2.5 + +TextEdit { + text: eventData.formattedBody + textFormat: TextEdit.RichText + readOnly: true + wrapMode: Text.Wrap + width: parent.width + selectByMouse: true + font.italic: true + color: inactiveColors.text +} diff --git a/resources/qml/delegates/TextMessage.qml b/resources/qml/delegates/TextMessage.qml index 5f4b33fa..f7dba618 100644 --- a/resources/qml/delegates/TextMessage.qml +++ b/resources/qml/delegates/TextMessage.qml @@ -7,4 +7,5 @@ TextEdit { wrapMode: Text.Wrap width: parent.width selectByMouse: true + color: colors.text } diff --git a/resources/res.qrc b/resources/res.qrc index b2f27814..b18835fb 100644 --- a/resources/res.qrc +++ b/resources/res.qrc @@ -117,5 +117,6 @@ qml/TimelineView.qml qml/delegates/TextMessage.qml + qml/delegates/NoticeMessage.qml diff --git a/src/AvatarProvider.cpp b/src/AvatarProvider.cpp index ec745c04..c83ffe0f 100644 --- a/src/AvatarProvider.cpp +++ b/src/AvatarProvider.cpp @@ -43,7 +43,6 @@ resolve(const QString &avatarUrl, int size, QObject *receiver, AvatarCallback ca QPixmap pixmap; if (avatar_cache.find(cacheKey, &pixmap)) { - nhlog::net()->info("cached pixmap {}", avatarUrl.toStdString()); callback(pixmap); return; } @@ -52,7 +51,6 @@ resolve(const QString &avatarUrl, int size, QObject *receiver, AvatarCallback ca if (!data.isNull()) { pixmap.loadFromData(data); avatar_cache.insert(cacheKey, pixmap); - nhlog::net()->info("loaded pixmap from disk cache {}", avatarUrl.toStdString()); callback(pixmap); return; } @@ -86,8 +84,6 @@ resolve(const QString &avatarUrl, int size, QObject *receiver, AvatarCallback ca cache::client()->saveImage(opts.mxc_url, res); - nhlog::net()->info("downloaded pixmap {}", opts.mxc_url); - emit proxy->avatarDownloaded(QByteArray(res.data(), res.size())); }); }