diff --git a/resources/qml/MatrixTextField.qml b/resources/qml/MatrixTextField.qml index db2c907b..3bcc9675 100644 --- a/resources/qml/MatrixTextField.qml +++ b/resources/qml/MatrixTextField.qml @@ -2,9 +2,9 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.13 -import QtQuick.Controls 2.13 -import QtQuick.Layouts 1.13 +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Layouts 1.12 TextField { id: input diff --git a/resources/qml/MessageView.qml b/resources/qml/MessageView.qml index d418c35e..d8230151 100644 --- a/resources/qml/MessageView.qml +++ b/resources/qml/MessageView.qml @@ -16,6 +16,8 @@ ScrollView { palette: colors padding: 8 + ScrollBar.horizontal.visible: false + ListView { id: chat diff --git a/resources/qml/QuickSwitcher.qml b/resources/qml/QuickSwitcher.qml index 8730f101..9f4691b6 100644 --- a/resources/qml/QuickSwitcher.qml +++ b/resources/qml/QuickSwitcher.qml @@ -12,13 +12,6 @@ Popup { property int textHeight: Math.round(Qt.application.font.pixelSize * 2.4) property int textMargin: Math.round(textHeight / 8) - function delay(delayTime, cb) { - timer.interval = delayTime; - timer.repeat = false; - timer.triggered.connect(cb); - timer.start(); - } - background: null width: Math.round(parent.width / 2) x: Math.round(parent.width / 2 - width / 2) @@ -29,9 +22,7 @@ Popup { palette: colors onOpened: { completerPopup.open(); - delay(200, function() { - roomTextInput.forceActiveFocus(); - }); + roomTextInput.forceActiveFocus(); } onClosed: { completerPopup.close(); @@ -93,10 +84,6 @@ Popup { target: completerPopup } - Timer { - id: timer - } - Overlay.modal: Rectangle { color: "#aa1E1E1E" } diff --git a/resources/qml/delegates/PlayableMediaMessage.qml b/resources/qml/delegates/PlayableMediaMessage.qml index 52277895..321f7d61 100644 --- a/resources/qml/delegates/PlayableMediaMessage.qml +++ b/resources/qml/delegates/PlayableMediaMessage.qml @@ -2,6 +2,7 @@ // // SPDX-License-Identifier: GPL-3.0-or-later +import "../" import QtMultimedia 5.6 import QtQuick 2.12 import QtQuick.Controls 2.1 @@ -107,20 +108,40 @@ Rectangle { width: parent.width spacing: 15 - Rectangle { + ImageButton { id: button - color: colors.window - radius: 22 - height: 44 - width: 44 + Layout.alignment: Qt.verticalCenter + //color: colors.window + //radius: 22 + height: 32 + width: 32 + z: 3 + image: ":/icons/icons/ui/arrow-pointing-down.png" + onClicked: { + switch (button.state) { + case "": + TimelineManager.timeline.cacheMedia(model.data.id); + break; + case "stopped": + media.play(); + console.log("play"); + button.state = "playing"; + break; + case "playing": + media.pause(); + console.log("pause"); + button.state = "stopped"; + break; + } + } states: [ State { name: "stopped" PropertyChanges { - target: img - source: "image://colorimage/:/icons/icons/ui/play-sign.png?" + colors.text + target: button + image: ":/icons/icons/ui/play-sign.png" } }, @@ -128,42 +149,13 @@ Rectangle { name: "playing" PropertyChanges { - target: img - source: "image://colorimage/:/icons/icons/ui/pause-symbol.png?" + colors.text + target: button + image: ":/icons/icons/ui/pause-symbol.png" } } ] - Image { - id: img - - anchors.centerIn: parent - z: 3 - source: "image://colorimage/:/icons/icons/ui/arrow-pointing-down.png?" + colors.text - fillMode: Image.Pad - } - - TapHandler { - onSingleTapped: { - switch (button.state) { - case "": - TimelineManager.timeline.cacheMedia(model.data.id); - break; - case "stopped": - media.play(); - console.log("play"); - button.state = "playing"; - break; - case "playing": - media.pause(); - console.log("pause"); - button.state = "stopped"; - break; - } - } - } - CursorShape { anchors.fill: parent cursorShape: Qt.PointingHandCursor diff --git a/src/timeline/InputBar.cpp b/src/timeline/InputBar.cpp index 8a5e4346..b45827f6 100644 --- a/src/timeline/InputBar.cpp +++ b/src/timeline/InputBar.cpp @@ -482,6 +482,8 @@ InputBar::command(QString command, QString args) eventId, args.trimmed()); } else if (command == "join") { ChatPage::instance()->joinRoom(args); + } else if (command == "part" || command == "leave") { + MainWindow::instance()->openLeaveRoomDialog(room->roomId()); } else if (command == "invite") { ChatPage::instance()->inviteUser(args.section(' ', 0, 0), args.section(' ', 1, -1)); } else if (command == "kick") {