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 // SPDX-License-Identifier: GPL-3.0-or-later
import QtQuick 2.13 import QtQuick 2.12
import QtQuick.Controls 2.13 import QtQuick.Controls 2.12
import QtQuick.Layouts 1.13 import QtQuick.Layouts 1.12
TextField { TextField {
id: input id: input

View file

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

View file

@ -12,13 +12,6 @@ Popup {
property int textHeight: Math.round(Qt.application.font.pixelSize * 2.4) property int textHeight: Math.round(Qt.application.font.pixelSize * 2.4)
property int textMargin: Math.round(textHeight / 8) 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 background: null
width: Math.round(parent.width / 2) width: Math.round(parent.width / 2)
x: Math.round(parent.width / 2 - width / 2) x: Math.round(parent.width / 2 - width / 2)
@ -29,9 +22,7 @@ Popup {
palette: colors palette: colors
onOpened: { onOpened: {
completerPopup.open(); completerPopup.open();
delay(200, function() { roomTextInput.forceActiveFocus();
roomTextInput.forceActiveFocus();
});
} }
onClosed: { onClosed: {
completerPopup.close(); completerPopup.close();
@ -93,10 +84,6 @@ Popup {
target: completerPopup target: completerPopup
} }
Timer {
id: timer
}
Overlay.modal: Rectangle { Overlay.modal: Rectangle {
color: "#aa1E1E1E" color: "#aa1E1E1E"
} }

View file

@ -2,6 +2,7 @@
// //
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
import "../"
import QtMultimedia 5.6 import QtMultimedia 5.6
import QtQuick 2.12 import QtQuick 2.12
import QtQuick.Controls 2.1 import QtQuick.Controls 2.1
@ -107,20 +108,40 @@ Rectangle {
width: parent.width width: parent.width
spacing: 15 spacing: 15
Rectangle { ImageButton {
id: button id: button
color: colors.window Layout.alignment: Qt.verticalCenter
radius: 22 //color: colors.window
height: 44 //radius: 22
width: 44 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: [ states: [
State { State {
name: "stopped" name: "stopped"
PropertyChanges { PropertyChanges {
target: img target: button
source: "image://colorimage/:/icons/icons/ui/play-sign.png?" + colors.text image: ":/icons/icons/ui/play-sign.png"
} }
}, },
@ -128,42 +149,13 @@ Rectangle {
name: "playing" name: "playing"
PropertyChanges { PropertyChanges {
target: img target: button
source: "image://colorimage/:/icons/icons/ui/pause-symbol.png?" + colors.text 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 { CursorShape {
anchors.fill: parent anchors.fill: parent
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor

View file

@ -482,6 +482,8 @@ InputBar::command(QString command, QString args)
eventId, args.trimmed()); eventId, args.trimmed());
} else if (command == "join") { } else if (command == "join") {
ChatPage::instance()->joinRoom(args); ChatPage::instance()->joinRoom(args);
} else if (command == "part" || command == "leave") {
MainWindow::instance()->openLeaveRoomDialog(room->roomId());
} else if (command == "invite") { } else if (command == "invite") {
ChatPage::instance()->inviteUser(args.section(' ', 0, 0), args.section(' ', 1, -1)); ChatPage::instance()->inviteUser(args.section(' ', 0, 0), args.section(' ', 1, -1));
} else if (command == "kick") { } else if (command == "kick") {