better support for opening chat in floating window
This commit is contained in:
@@ -87,10 +87,6 @@ Item {
|
||||
|
||||
signal requestClose
|
||||
|
||||
function scrollToBottom(): void {
|
||||
Qt.callLater(() => listLoader.item?.positionViewAtBeginning());
|
||||
}
|
||||
|
||||
function send(text: string): void {
|
||||
if (text.trim() === "")
|
||||
return;
|
||||
@@ -129,11 +125,15 @@ Item {
|
||||
isRound: true
|
||||
type: IconButton.Tonal
|
||||
|
||||
enabled: !ChatState.isWindow
|
||||
visible: enabled
|
||||
|
||||
onClicked: root.requestClose()
|
||||
}
|
||||
|
||||
CustomText {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillWidth: ChatState.isWindow ? false : true
|
||||
Layout.alignment: ChatState.isWindow ? Qt.AlignCenter : Qt.AlignLeft | Qt.AlignVCenter
|
||||
elide: Text.ElideRight
|
||||
font.pointSize: Tokens.font.size.larger
|
||||
text: qsTr(root.chatData.title)
|
||||
@@ -151,21 +151,20 @@ Item {
|
||||
anchors.topMargin: Tokens.spacing.medium
|
||||
active: root.chatData && root.chatData.loaded
|
||||
|
||||
sourceComponent: ListView {
|
||||
sourceComponent: VerticalFadeListView {
|
||||
id: list
|
||||
|
||||
property bool userScrolledUp: false
|
||||
property real lastCHeight: 0.0
|
||||
|
||||
function scrollToBottom(): void {
|
||||
scrollAnim.to = 0;
|
||||
scrollAnim.start();
|
||||
}
|
||||
|
||||
cacheBuffer: height * 20
|
||||
cacheBuffer: Math.max(height * 20, 0)
|
||||
clip: true
|
||||
// fadeAmount: 0.05
|
||||
// fadeThreshold: Tokens.padding.medium
|
||||
fadeAmount: 0.05
|
||||
fadeThreshold: Tokens.padding.medium
|
||||
model: root.chatData.messagesModel
|
||||
spacing: 0
|
||||
rotation: 180
|
||||
@@ -238,6 +237,7 @@ Item {
|
||||
property: "contentY"
|
||||
target: list
|
||||
type: Anim.DefaultEffects
|
||||
to: list.originY
|
||||
}
|
||||
|
||||
WheelInverter {
|
||||
@@ -255,7 +255,7 @@ Item {
|
||||
|
||||
anchors.fill: parent
|
||||
spacing: Tokens.spacing.small
|
||||
visible: !root.chatData
|
||||
visible: root.chatData.messageCount < 1
|
||||
}
|
||||
|
||||
Item {
|
||||
|
||||
Reference in New Issue
Block a user