Fix notification.

This commit is contained in:
Black Hat 2018-11-17 21:12:56 +08:00
parent a7f62c13b0
commit f0dd0a4c1d
4 changed files with 158 additions and 161 deletions

View File

@ -472,7 +472,7 @@ Rectangle {
color: "#273338"
}
ItemDelegate {
RippleEffect {
anchors.fill: parent
onClicked: errorControl.visible = false

View File

@ -298,9 +298,6 @@ Item {
Layout.alignment: Qt.AlignHCenter
id: roomPanelInput
width: parent.width
height: 48
}
}
}

View File

@ -12,7 +12,7 @@ import Spectral 0.1
import "qrc:/js/md.js" as Markdown
Rectangle {
Control {
property bool isReply
property string replyUserID
property string replyEventID
@ -23,13 +23,16 @@ Rectangle {
property int autoCompleteBeginPosition
property int autoCompleteEndPosition
color: MSettings.darkTheme ? "#303030" : "#fafafa"
padding: 0
radius: height / 2
background: Rectangle {
color: MSettings.darkTheme ? "#303030" : "#fafafa"
radius: 24
layer.enabled: true
layer.effect: ElevationEffect {
elevation: 1
elevation: 2
}
}
Popup {
@ -102,12 +105,12 @@ Rectangle {
}
}
RowLayout {
anchors.fill: parent
contentItem: RowLayout {
spacing: 0
ToolButton {
Layout.alignment: Qt.AlignTop
id: uploadButton
visible: !isReply
@ -135,22 +138,15 @@ Rectangle {
onClicked: clearReply()
}
ScrollView {
Layout.fillWidth: true
Layout.preferredHeight: 48
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
clip: true
TextArea {
property real progress: 0
Layout.fillWidth: true
id: inputField
wrapMode: Text.Wrap
placeholderText: isReply ? "Reply to " + replyUserID : "Send a Message"
leftPadding: 16
topPadding: 0
bottomPadding: 0
selectByMouse: true
@ -298,9 +294,10 @@ Rectangle {
currentRoom.postPlainText(text)
}
}
}
ToolButton {
Layout.alignment: Qt.AlignTop
id: emojiButton
contentItem: MaterialIcon {

View File

@ -55,7 +55,7 @@ ApplicationWindow {
quitOnLastWindowClosed: !MSettings.showTray
onNotificationClicked: {
roomForm.enteredRoom = spectralController.connection.room(roomId)
roomListForm.enteredRoom = spectralController.connection.room(roomId)
roomForm.goToEvent(eventId)
showWindow()
}
@ -131,12 +131,15 @@ ApplicationWindow {
}
}
Component.onCompleted: {
spectralController.onErrorOccured.connect(function(error, detail) {
onVisibleChanged: {
if (visible) spectralController.onErrorOccured.connect(showError)
else spectralController.onErrorOccured.disconnect(showError)
}
function showError(error, detail) {
loginDialog.busy = false
loginButtonTooltip.text = error + ": " + detail
loginButtonTooltip.open()
})
}
function doLogin() {