Merge branch 'master' of ssh://github.com/Nheko-Reborn/nheko

This commit is contained in:
Joseph Donofry 2021-03-27 19:43:16 -04:00
commit 38ddfabee6
No known key found for this signature in database
GPG Key ID: E8A1D78EF044B0CB
5 changed files with 38 additions and 55 deletions

View File

@ -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

View File

@ -16,6 +16,8 @@ ScrollView {
palette: colors
padding: 8
ScrollBar.horizontal.visible: false
ListView {
id: chat

View File

@ -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"
}

View File

@ -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

View File

@ -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") {