Skip to content

Commit

Permalink
- Add public short text note display
Browse files Browse the repository at this point in the history
- Fix follow-list rendering
- Add profile images to messages
- Fix message rendering binding loop
- Show own profile first in follow list
- Move DM relay setup notification
- Display temporary relay connections
  • Loading branch information
prolic committed Nov 30, 2024
1 parent e9a05b7 commit 9db642f
Show file tree
Hide file tree
Showing 20 changed files with 1,042 additions and 231 deletions.
1 change: 1 addition & 0 deletions resources/icons/comment.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/icons/encrypted.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/icons/public.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/icons/repeat.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
163 changes: 0 additions & 163 deletions resources/qml/content/Chat.ui.qml

This file was deleted.

Empty file.
Empty file.
82 changes: 82 additions & 0 deletions resources/qml/content/Components/MessageInput.ui.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Controls.Material 2.15
import QtQuick.Layouts 1.15
import Components 1.0
import Futr 1.0

Pane {
id: root

property string placeholderText: qsTr("Type a message...")
property string buttonText: qsTr("Send")
property alias textArea: messageInput

signal messageSent(string text)

Layout.fillWidth: true
Layout.leftMargin: Constants.spacing_m
Layout.rightMargin: Constants.spacing_m
Layout.bottomMargin: Constants.spacing_m
padding: Constants.spacing_m

background: Rectangle {
color: Material.dialogColor
radius: 5
border.color: Material.dividerColor
border.width: 1
}

RowLayout {
width: parent.width
spacing: Constants.spacing_m

ProfilePicture {
imageSource: Util.getProfilePicture(mypicture, mynpub)
Layout.preferredWidth: 36
Layout.preferredHeight: 36
Layout.alignment: Qt.AlignVCenter
}

TextArea {
id: messageInput
Layout.fillWidth: true
Layout.alignment: Qt.AlignVCenter
placeholderText: root.placeholderText
wrapMode: TextArea.Wrap
font: Constants.fontMedium
focus: true

Keys.onReturnPressed: function(event) {
if (event.modifiers & Qt.ControlModifier) {
event.accepted = true
sendMessage()
} else {
event.accepted = false
}
}
}

Button {
text: root.buttonText
highlighted: true
enabled: messageInput.text.trim().length > 0
implicitWidth: 80
implicitHeight: 36
Layout.alignment: Qt.AlignVCenter

onClicked: sendMessage()
}
}

function sendMessage() {
if (messageInput.text.trim() !== "") {
root.messageSent(messageInput.text)
messageInput.text = ""
}
}

function clear() {
messageInput.text = ""
}
}
Loading

0 comments on commit 9db642f

Please sign in to comment.