Improve TypingMembersBar

This commit is contained in:
miruka 2019-07-06 17:29:32 -04:00
parent 556749aa35
commit 388967c737
10 changed files with 39 additions and 17 deletions

View File

@ -1,3 +1,6 @@
- daybreak color
- rename component id that are named "root"
- html links color
- invite/leave/forget backend funcs - invite/leave/forget backend funcs
- license headers - license headers
- replace "property var" by "property <object>" where applicable and - replace "property var" by "property <object>" where applicable and

1
src/icons/typing.svg Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M9.963 8.261c-.566-.585-.536-1.503.047-2.07l5.948-5.768c.291-.281.664-.423 1.035-.423.376 0 .75.146 1.035.44l-8.065 7.821zm-9.778 14.696c-.123.118-.185.277-.185.436 0 .333.271.607.607.607.152 0 .305-.057.423-.171l.999-.972-.845-.872-.999.972zm8.44-11.234l-3.419 3.314c-1.837 1.781-2.774 3.507-3.64 5.916l1.509 1.559c2.434-.79 4.187-1.673 6.024-3.455l3.418-3.315-3.892-4.019zm9.97-10.212l-8.806 8.54 4.436 4.579 8.806-8.538c.645-.626.969-1.458.969-2.291 0-2.784-3.373-4.261-5.405-2.29z"/></svg>

After

Width:  |  Height:  |  Size: 585 B

View File

@ -26,7 +26,5 @@ ScrollView {
id: textAreaBackground id: textAreaBackground
color: HStyle.controls.textArea.background color: HStyle.controls.textArea.background
} }
//Keys.forwardTo: [scrollView]
} }
} }

View File

@ -55,7 +55,10 @@ HColumnLayout {
Layout.fillHeight: true Layout.fillHeight: true
} }
TypingMembersBar {} TypingMembersBar {
Layout.fillWidth: true
//Layout.preferredHeight: text ? implicitHeight : 0
}
InviteBanner { InviteBanner {
visible: category === "Invites" visible: category === "Invites"

View File

@ -27,6 +27,7 @@ HRectangle {
HScrollableTextArea { HScrollableTextArea {
Layout.fillHeight: true Layout.fillHeight: true
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: Math.max(0, root.Layout.minimumHeight - 34)
id: textArea id: textArea
placeholderText: qsTr("Type a message...") placeholderText: qsTr("Type a message...")

View File

@ -75,12 +75,6 @@ Column {
width: roomEventDelegate.width width: roomEventDelegate.width
} }
Item { // TODO: put this in Daybreak.qml?
visible: dayBreak
width: parent.width
height: topPadding
}
EventContent { EventContent {
anchors.right: isOwn ? parent.right : undefined anchors.right: isOwn ? parent.right : undefined
} }

View File

@ -3,6 +3,8 @@ import SortFilterProxyModel 0.2
import "../../Base" import "../../Base"
HRectangle { HRectangle {
property alias listView: roomEventListView
property int space: 8 property int space: 8
color: HStyle.chat.roomEventList.background color: HStyle.chat.roomEventList.background

View File

@ -3,17 +3,30 @@ import QtQuick.Layouts 1.3
import "../Base" import "../Base"
HRectangle { HRectangle {
property alias label: typingLabel
implicitWidth: childrenRect.width
implicitHeight: typingLabel.text ? childrenRect.height : 0
color: HStyle.chat.typingMembers.background color: HStyle.chat.typingMembers.background
Layout.fillWidth: true Row {
Layout.preferredHeight: usersLabel.text ? usersLabel.implicitHeight : 0 spacing: 8
leftPadding: spacing
rightPadding: spacing
topPadding: 2
bottomPadding: 2
HIcon {
svgName: "typing" // TODO: animate
height: typingLabel.height
}
HLabel { HLabel {
id: usersLabel id: typingLabel
anchors.fill: parent
text: chatPage.roomInfo.typingText text: chatPage.roomInfo.typingText
textFormat: Text.StyledText
elide: Text.ElideMiddle elide: Text.ElideMiddle
maximumLineCount: 1 maximumLineCount: 1
} }
}
} }

View File

@ -1,9 +1,15 @@
//Qt.include("../utils.js")
function typingTextFor(members, our_user_id) { function typingTextFor(members, our_user_id) {
var names = [] var names = []
for (var i = 0; i < members.length; i++) { for (var i = 0; i < members.length; i++) {
if (members[i] != our_user_id) { if (members[i] != our_user_id) {
names.push(users.getUser(members[i]).displayName) names.push(users.getUser(members[i]).displayName)
//names.push(coloredNameHtml(
//users.getUser(members[i]).displayName, members[i]
//))
} }
} }

View File

@ -12,6 +12,7 @@ HRowLayout {
HButton { HButton {
iconName: "settings" iconName: "settings"
backgroundColor: HStyle.sidePane.settingsButton.background backgroundColor: HStyle.sidePane.settingsButton.background
Layout.preferredHeight: parent.height
} }
HTextField { HTextField {