-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add public short text note display
- 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
Showing
20 changed files
with
1,042 additions
and
231 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = "" | ||
} | ||
} |
Oops, something went wrong.