|
|
@ -66,7 +66,7 @@ Rectangle { |
|
|
|
Rectangle { |
|
|
|
Rectangle { |
|
|
|
anchors.fill: parent |
|
|
|
anchors.fill: parent |
|
|
|
color: colors.window |
|
|
|
color: colors.window |
|
|
|
visible: TimelineManager.timeline.input.uploading |
|
|
|
visible: TimelineManager.timeline && TimelineManager.timeline.input.uploading |
|
|
|
|
|
|
|
|
|
|
|
NhekoBusyIndicator { |
|
|
|
NhekoBusyIndicator { |
|
|
|
anchors.fill: parent |
|
|
|
anchors.fill: parent |
|
|
@ -123,21 +123,28 @@ Rectangle { |
|
|
|
selectByMouse: true |
|
|
|
selectByMouse: true |
|
|
|
placeholderText: qsTr("Write a message...") |
|
|
|
placeholderText: qsTr("Write a message...") |
|
|
|
//placeholderTextColor: colors.buttonText |
|
|
|
//placeholderTextColor: colors.buttonText |
|
|
|
// only set the anchors on Qt 5.12 or higher |
|
|
|
// only set the anchors on Qt 5.12 or higher |
|
|
|
// see https://doc.qt.io/qt-5/qml-qtquick-controls2-popup.html#anchors.centerIn-prop |
|
|
|
// see https://doc.qt.io/qt-5/qml-qtquick-controls2-popup.html#anchors.centerIn-prop |
|
|
|
Component.onCompleted: { |
|
|
|
Component.onCompleted: { |
|
|
|
if (placeholderTextColor !== undefined) |
|
|
|
if (placeholderTextColor !== undefined) |
|
|
|
placeholderTextColor = colors.buttonText |
|
|
|
placeholderTextColor = colors.buttonText; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
color: colors.text |
|
|
|
color: colors.text |
|
|
|
width: textInput.width |
|
|
|
width: textInput.width |
|
|
|
wrapMode: TextEdit.Wrap |
|
|
|
wrapMode: TextEdit.Wrap |
|
|
|
padding: 0 |
|
|
|
padding: 0 |
|
|
|
focus: true |
|
|
|
focus: true |
|
|
|
onTextChanged: TimelineManager.timeline.input.updateState(selectionStart, selectionEnd, cursorPosition, text) |
|
|
|
onTextChanged: { |
|
|
|
|
|
|
|
if (TimelineManager.timeline) { |
|
|
|
|
|
|
|
TimelineManager.timeline.input.updateState(selectionStart, selectionEnd, cursorPosition, text); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
onCursorRectangleChanged: textInput.ensureVisible(cursorRectangle) |
|
|
|
onCursorRectangleChanged: textInput.ensureVisible(cursorRectangle) |
|
|
|
onCursorPositionChanged: { |
|
|
|
onCursorPositionChanged: { |
|
|
|
|
|
|
|
if (!TimelineManager.timeline) |
|
|
|
|
|
|
|
return ; |
|
|
|
|
|
|
|
|
|
|
|
TimelineManager.timeline.input.updateState(selectionStart, selectionEnd, cursorPosition, text); |
|
|
|
TimelineManager.timeline.input.updateState(selectionStart, selectionEnd, cursorPosition, text); |
|
|
|
if (cursorPosition <= completerTriggeredAt) { |
|
|
|
if (cursorPosition <= completerTriggeredAt) { |
|
|
|
completerTriggeredAt = -1; |
|
|
|
completerTriggeredAt = -1; |
|
|
@ -235,13 +242,14 @@ Rectangle { |
|
|
|
Completer { |
|
|
|
Completer { |
|
|
|
id: popup |
|
|
|
id: popup |
|
|
|
|
|
|
|
|
|
|
|
x: textArea.positionToRectangle(textArea.completerTriggeredAt).x |
|
|
|
x: textArea.positionToRectangle(textArea.completerTriggeredAt > 0 ? text.completerTriggeredAt : 0).x |
|
|
|
y: textArea.positionToRectangle(textArea.completerTriggeredAt).y - height |
|
|
|
y: textArea.positionToRectangle(textArea.completerTriggeredAt > 0 ? text.completerTriggeredAt : 0).y - height |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Connections { |
|
|
|
Connections { |
|
|
|
|
|
|
|
ignoreUnknownSignals: true |
|
|
|
onInsertText: textArea.insert(textArea.cursorPosition, text) |
|
|
|
onInsertText: textArea.insert(textArea.cursorPosition, text) |
|
|
|
target: TimelineManager.timeline.input |
|
|
|
target: TimelineManager.timeline ? TimelineManager.timeline.input : null |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
MouseArea { |
|
|
|
MouseArea { |
|
|
@ -254,7 +262,7 @@ Rectangle { |
|
|
|
|
|
|
|
|
|
|
|
NhekoDropArea { |
|
|
|
NhekoDropArea { |
|
|
|
anchors.fill: parent |
|
|
|
anchors.fill: parent |
|
|
|
roomid: TimelineManager.timeline.roomId() |
|
|
|
roomid: TimelineManager.timeline ? TimelineManager.timeline.roomId() : "" |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|