From 3d64df41dac45693d1e2626909f0e55d4b7a6f47 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Mon, 26 Oct 2020 14:57:54 +0100 Subject: Split up TimelineView into separate components --- resources/qml/MessageInput.qml | 90 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 resources/qml/MessageInput.qml (limited to 'resources/qml/MessageInput.qml') diff --git a/resources/qml/MessageInput.qml b/resources/qml/MessageInput.qml new file mode 100644 index 00000000..71da9cae --- /dev/null +++ b/resources/qml/MessageInput.qml @@ -0,0 +1,90 @@ +import QtQuick 2.9 +import QtQuick.Controls 2.3 +import QtQuick.Layouts 1.2 +import QtQuick.Window 2.2 + +Rectangle { + color: colors.window + Layout.fillWidth: true + Layout.preferredHeight: textInput.height + Layout.minimumHeight: 40 + + RowLayout { + id: inputBar + + anchors.fill: parent + spacing: 16 + + ImageButton { + Layout.alignment: Qt.AlignBottom + hoverEnabled: true + width: 22 + height: 22 + image: ":/icons/icons/ui/place-call.png" + Layout.topMargin: 8 + Layout.bottomMargin: 8 + Layout.leftMargin: 16 + } + + ImageButton { + Layout.alignment: Qt.AlignBottom + hoverEnabled: true + width: 22 + height: 22 + image: ":/icons/icons/ui/paper-clip-outline.png" + Layout.topMargin: 8 + Layout.bottomMargin: 8 + } + + ScrollView { + id: textInput + + Layout.alignment: Qt.AlignBottom + Layout.maximumHeight: Window.height / 4 + Layout.fillWidth: true + + TextArea { + placeholderText: qsTr("Write a message...") + placeholderTextColor: colors.buttonText + color: colors.text + wrapMode: TextEdit.Wrap + + MouseArea { + // workaround for wrong cursor shape on some platforms + anchors.fill: parent + acceptedButtons: Qt.NoButton + cursorShape: Qt.IBeamCursor + } + + background: Rectangle { + color: colors.window + } + + } + + } + + ImageButton { + Layout.alignment: Qt.AlignRight | Qt.AlignBottom + hoverEnabled: true + width: 22 + height: 22 + image: ":/icons/icons/ui/smile.png" + Layout.topMargin: 8 + Layout.bottomMargin: 8 + } + + ImageButton { + Layout.alignment: Qt.AlignRight | Qt.AlignBottom + hoverEnabled: true + width: 22 + height: 22 + image: ":/icons/icons/ui/cursor.png" + Layout.topMargin: 8 + Layout.bottomMargin: 8 + Layout.rightMargin: 16 + } + + } + +} -- cgit 1.5.1