Working notification.

Also, fixes #6.
This commit is contained in:
Black Hat
2018-08-19 14:32:18 +08:00
parent aa8f50a6c2
commit 4383dfa5a1
9 changed files with 45 additions and 51 deletions

View File

@@ -16,7 +16,7 @@ Page {
connection: page.connection
onRoomAdded: setting.lazyLoad ? {} : room.getPreviousContent(20)
onNewMessage: trayIcon.showMessage("New message", "New message for room " + room.displayName)
onNewMessage: matriqueController.showMessage(roomName, content, icon)
}
RowLayout {

View File

@@ -318,6 +318,9 @@ Item {
bottomPadding: 0
selectByMouse: true
text: currentRoom ? currentRoom.cachedInput : ""
onTextChanged: currentRoom.cachedInput = text
Keys.onReturnPressed: {
if (inputField.text) {
inputField.postMessage(inputField.text)

View File

@@ -30,13 +30,15 @@ Item {
id: searchField
width: parent.width - 18
height: 36
color: "black"
leftPadding: mini ? 4 : 16
color: "white"
leftPadding: mini ? 4 : 32
topPadding: 0
bottomPadding: 0
anchors.centerIn: parent
background: Row {
visible: !parent.text
MaterialIcon {
icon: "\ue8b6"
color: "white"
@@ -55,17 +57,6 @@ Item {
verticalAlignment: Text.AlignVCenter
}
}
Rectangle {
z: -2
width: searchField.activeFocus || searchField.text ? parent.width : 0
height: parent.height
color: "white"
Behavior on width {
PropertyAnimation { easing.type: Easing.InOutCubic; duration: 200 }
}
}
}
}

View File

@@ -4,7 +4,6 @@ import QtQuick.Layouts 1.3
import QtQuick.Controls.Material 2.2
import QtGraphicalEffects 1.0
import Qt.labs.settings 1.0 as Settings
import Qt.labs.platform 1.0 as Platform
import Matrique 0.1
import "component"
@@ -40,21 +39,6 @@ ApplicationWindow {
property alias miniMode: settingPage.miniMode
}
Platform.SystemTrayIcon {
id: trayIcon
visible: true
iconSource: "qrc:/asset/img/icon.png"
onActivated: window.active ? window.hide() : raiseWindow()
function raiseWindow() {
window.show()
window.raise()
window.requestActivate()
}
}
Controller {
id: matriqueController
}
@@ -87,7 +71,7 @@ ApplicationWindow {
parent: null
connection: window.connection
connection: matriqueController.isLogin ? window.connection : undefined
}
Setting {