Init desktop notifications.
This commit is contained in:
@@ -15,7 +15,7 @@ Page {
|
||||
|
||||
connection: matriqueController.isLogin ? page.connection : undefined
|
||||
|
||||
onNewMessage: console.log("New message in room " + room.displayName)
|
||||
onNewMessage: trayIcon.showMessage("New message", "New message for room " + room.displayName)
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
|
||||
@@ -98,6 +98,7 @@ Item {
|
||||
delegate: MessageDelegate {}
|
||||
|
||||
onAtYBeginningChanged: atYBeginning && currentRoom ? currentRoom.getPreviousContent(50) : {}
|
||||
onAtYEndChanged: atYEnd && currentRoom ? currentRoom.markAllMessagesAsRead() : {}
|
||||
|
||||
ScrollBar.vertical: ScrollBar {}
|
||||
|
||||
|
||||
21
qml/main.qml
21
qml/main.qml
@@ -28,18 +28,18 @@ ApplicationWindow {
|
||||
property alias token: matriqueController.token
|
||||
}
|
||||
|
||||
// Platform.SystemTrayIcon {
|
||||
// id: trayIcon
|
||||
Platform.SystemTrayIcon {
|
||||
id: trayIcon
|
||||
|
||||
// visible: true
|
||||
// iconSource: "qrc:/asset/img/icon.png"
|
||||
visible: true
|
||||
iconSource: "qrc:/asset/img/icon.png"
|
||||
|
||||
// onActivated: {
|
||||
// window.show()
|
||||
// window.raise()
|
||||
// window.requestActivate()
|
||||
// }
|
||||
// }
|
||||
onActivated: {
|
||||
window.show()
|
||||
window.raise()
|
||||
window.requestActivate()
|
||||
}
|
||||
}
|
||||
|
||||
Controller {
|
||||
id: matriqueController
|
||||
@@ -163,7 +163,6 @@ ApplicationWindow {
|
||||
Component.onCompleted: {
|
||||
imageProvider.connection = matriqueController.connection
|
||||
|
||||
console.log(matriqueController.homeserver, matriqueController.userID, matriqueController.token)
|
||||
if (matriqueController.userID && matriqueController.token) {
|
||||
console.log("Perform auto-login.");
|
||||
matriqueController.login();
|
||||
|
||||
Reference in New Issue
Block a user