mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 19:08:58 +03:00
Fix qml warnings
This commit is contained in:
parent
74c9af0432
commit
d11978ac1b
2 changed files with 23 additions and 15 deletions
|
@ -66,7 +66,7 @@ Rectangle {
|
|||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: colors.window
|
||||
visible: TimelineManager.timeline.input.uploading
|
||||
visible: TimelineManager.timeline && TimelineManager.timeline.input.uploading
|
||||
|
||||
NhekoBusyIndicator {
|
||||
anchors.fill: parent
|
||||
|
@ -127,7 +127,7 @@ Rectangle {
|
|||
// see https://doc.qt.io/qt-5/qml-qtquick-controls2-popup.html#anchors.centerIn-prop
|
||||
Component.onCompleted: {
|
||||
if (placeholderTextColor !== undefined)
|
||||
placeholderTextColor = colors.buttonText
|
||||
placeholderTextColor = colors.buttonText;
|
||||
|
||||
}
|
||||
color: colors.text
|
||||
|
@ -135,9 +135,16 @@ Rectangle {
|
|||
wrapMode: TextEdit.Wrap
|
||||
padding: 0
|
||||
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)
|
||||
onCursorPositionChanged: {
|
||||
if (!TimelineManager.timeline)
|
||||
return ;
|
||||
|
||||
TimelineManager.timeline.input.updateState(selectionStart, selectionEnd, cursorPosition, text);
|
||||
if (cursorPosition <= completerTriggeredAt) {
|
||||
completerTriggeredAt = -1;
|
||||
|
@ -235,13 +242,14 @@ Rectangle {
|
|||
Completer {
|
||||
id: popup
|
||||
|
||||
x: textArea.positionToRectangle(textArea.completerTriggeredAt).x
|
||||
y: textArea.positionToRectangle(textArea.completerTriggeredAt).y - height
|
||||
x: textArea.positionToRectangle(textArea.completerTriggeredAt > 0 ? text.completerTriggeredAt : 0).x
|
||||
y: textArea.positionToRectangle(textArea.completerTriggeredAt > 0 ? text.completerTriggeredAt : 0).y - height
|
||||
}
|
||||
|
||||
Connections {
|
||||
ignoreUnknownSignals: true
|
||||
onInsertText: textArea.insert(textArea.cursorPosition, text)
|
||||
target: TimelineManager.timeline.input
|
||||
target: TimelineManager.timeline ? TimelineManager.timeline.input : null
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
|
@ -254,7 +262,7 @@ Rectangle {
|
|||
|
||||
NhekoDropArea {
|
||||
anchors.fill: parent
|
||||
roomid: TimelineManager.timeline.roomId()
|
||||
roomid: TimelineManager.timeline ? TimelineManager.timeline.roomId() : ""
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ Item {
|
|||
|
||||
MouseArea {
|
||||
id: hoverHandler
|
||||
|
||||
anchors.fill: parent
|
||||
propagateComposedEvents: true
|
||||
preventStealing: false
|
||||
|
@ -27,8 +28,7 @@ Item {
|
|||
if (mouse.button === Qt.RightButton)
|
||||
messageContextMenu.show(model.id, model.type, model.isEncrypted, row);
|
||||
else
|
||||
event.accepted = false
|
||||
|
||||
event.accepted = false;
|
||||
}
|
||||
onPressAndHold: {
|
||||
messageContextMenu.show(model.id, model.type, model.isEncrypted, row, mapToItem(timelineRoot, mouse.x, mouse.y));
|
||||
|
|
Loading…
Reference in a new issue