Small UI improvement.

square-messages
Black Hat 2018-07-20 22:36:19 +08:00
parent c330bb4ff5
commit 7837c2d75e
6 changed files with 53 additions and 11 deletions

View File

@ -13,7 +13,7 @@ Page {
RoomListModel {
id: roomListModel
connection: matriqueController.isLogin ? page.connection : undefined
connection: page.connection
onNewMessage: trayIcon.showMessage("New message", "New message for room " + room.displayName)
}

View File

@ -1,10 +1,14 @@
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Controls.Material 2.2
import QtQuick.Layouts 1.3
import "component"
Page {
property alias darkTheme: themeSwitch.checked
property alias miniMode: miniModeSwitch.checked
property var connection
header: TabBar {
id: tabBar
@ -12,13 +16,14 @@ Page {
currentIndex: settingView.currentIndex
TabButton {
text: qsTr("Account")
text: "Account"
}
TabButton {
text: qsTr("Appearance")
text: "Appearance"
}
TabButton {
text: qsTr("About")
text: "About"
}
}
@ -30,6 +35,34 @@ Page {
Item {
id: accountPage
RowLayout {
height: 80
ImageStatus {
Layout.preferredWidth: height
Layout.fillHeight: true
source: connection ? connection.localUser && connection.localUser.avatarUrl ? "image://mxc/" + connection.localUser.avatarUrl : "" : "qrc:/asset/img/avatar.png"
displayText: connection && connection.localUser.displayName ? connection.localUser.displayName : "N"
opaqueBackground: false
}
ColumnLayout {
Layout.fillWidth: true
Layout.fillHeight: true
Label {
font.pointSize: 24
text: connection ? connection.localUser.displayName : ""
}
Label {
font.pointSize: 16
text: "No text."
}
}
}
}
Item {

View File

@ -27,6 +27,7 @@ AvatarContainer {
linkColor: isNotice || sentByMe ? Material.accent : "white"
// textFormat: contentType === "text/html" ? Text.RichText : Text.StyledText
textFormat: Text.StyledText
onLinkActivated: Qt.openUrlExternally(link)
}
}
}

View File

@ -21,5 +21,6 @@ Rectangle {
anchors.margins: 12
wrapMode: Label.Wrap
textFormat: Text.StyledText
onLinkActivated: Qt.openUrlExternally(link)
}
}

View File

@ -182,6 +182,7 @@ Item {
background: Item {
Rectangle {
z: 5
width: inputField.width * inputField.progress
height: parent.height
color: Material.accent
@ -190,10 +191,13 @@ Item {
Rectangle { anchors.fill: parent; color: Material.theme == Material.Light ? "#eaeaea" : "#242424" }
}
Keys.onReturnPressed: {
if (inputField.text) {
postMessage(inputField.text)
inputField.text = ""
Shortcut {
sequence: "Ctrl+Return"
onActivated: {
if (inputField.text) {
inputField.postMessage(inputField.text)
inputField.text = ""
}
}
}

View File

@ -11,6 +11,8 @@ import "component"
import "form"
ApplicationWindow {
readonly property var connection: matriqueController.isLogin ? matriqueController.connection : undefined
id: window
visible: true
width: 960
@ -121,11 +123,12 @@ ApplicationWindow {
Room {
id: roomPage
connection: matriqueController.connection
connection: window.connection
}
Setting {
id: settingPage
connection: window.connection
}
RowLayout {
@ -147,8 +150,8 @@ ApplicationWindow {
anchors.fill: parent
anchors.margins: 15
source: matriqueController.isLogin ? matriqueController.connection.localUser && matriqueController.connection.localUser.avatarUrl ? "image://mxc/" + matriqueController.connection.localUser.avatarUrl : "" : "qrc:/asset/img/avatar.png"
displayText: matriqueController.connection.localUser && matriqueController.connection.localUser.displayText ? matriqueController.connection.localUser.displayText : "N"
source: connection ? connection.localUser && connection.localUser.avatarUrl ? "image://mxc/" + connection.localUser.avatarUrl : "" : "qrc:/asset/img/avatar.png"
displayText: connection && connection.localUser.displayName ? connection.localUser.displayName : "N"
opaqueBackground: false
}