mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-10-30 17:40:47 +03:00
Optimize scrolling a little bit
This commit is contained in:
parent
cbb4356b19
commit
6f557c19a1
3 changed files with 25 additions and 29 deletions
|
@ -8,9 +8,6 @@ TextEdit {
|
||||||
selectByMouse: true
|
selectByMouse: true
|
||||||
color: colors.text
|
color: colors.text
|
||||||
|
|
||||||
font.hintingPreference: Font.PreferFullHinting
|
|
||||||
renderType: Text.NativeRendering
|
|
||||||
|
|
||||||
onLinkActivated: {
|
onLinkActivated: {
|
||||||
if (/^https:\/\/matrix.to\/#\/(@.*)$/.test(link)) chat.model.openUserProfile(/^https:\/\/matrix.to\/#\/(@.*)$/.exec(link)[1])
|
if (/^https:\/\/matrix.to\/#\/(@.*)$/.test(link)) chat.model.openUserProfile(/^https:\/\/matrix.to\/#\/(@.*)$/.exec(link)[1])
|
||||||
else if (/^https:\/\/matrix.to\/#\/(![^\/]*)$/.test(link)) timelineManager.setHistoryView(/^https:\/\/matrix.to\/#\/(!.*)$/.exec(link)[1])
|
else if (/^https:\/\/matrix.to\/#\/(![^\/]*)$/.test(link)) timelineManager.setHistoryView(/^https:\/\/matrix.to\/#\/(!.*)$/.exec(link)[1])
|
||||||
|
|
|
@ -106,6 +106,6 @@ MouseArea {
|
||||||
//How long the scrollbar will remain visible
|
//How long the scrollbar will remain visible
|
||||||
interval: 500
|
interval: 500
|
||||||
// Hide the scrollbars
|
// Hide the scrollbars
|
||||||
onTriggered: flickable.cancelFlick();
|
onTriggered: { flickable.cancelFlick(); flickable.movementEnded(); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -206,14 +206,13 @@ Page {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Binding {
|
Connections {
|
||||||
target: chat.model
|
target: chat
|
||||||
property: "currentIndex"
|
function onMovementEnded() {
|
||||||
when: y + height + 2 * chat.spacing > chat.contentY + chat.height && y < chat.contentY + chat.height
|
if (y + height + 2 * chat.spacing > chat.contentY + chat.height && y < chat.contentY + chat.height)
|
||||||
value: index
|
chat.model.currentIndex = index;
|
||||||
delayed: true
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
section {
|
section {
|
||||||
|
|
Loading…
Reference in a new issue