diff --git a/TODO.md b/TODO.md index 290702bb..10e1b7a3 100644 --- a/TODO.md +++ b/TODO.md @@ -36,7 +36,6 @@ - Room header descriptions: styled text - Message selection - - Make scroll wheel usable - Copy to X11 selection - Images don't load correctly in TextEdit diff --git a/src/qml/Base/HListView.qml b/src/qml/Base/HListView.qml index 1a778dd0..a062fd65 100644 --- a/src/qml/Base/HListView.qml +++ b/src/qml/Base/HListView.qml @@ -24,9 +24,9 @@ ListView { color: theme.controls.listView.highlight } - ScrollBar.vertical: ScrollBar { - visible: listView.interactive || ! listView.enableFlicking - } + // ScrollBar.vertical: ScrollBar { + // visible: listView.interactive || ! listView.enableFlicking + // } add: Transition { ParallelAnimation { diff --git a/src/qml/Chat/Timeline/EventContent.qml b/src/qml/Chat/Timeline/EventContent.qml index d09e5d31..120ff81d 100644 --- a/src/qml/Chat/Timeline/EventContent.qml +++ b/src/qml/Chat/Timeline/EventContent.qml @@ -7,13 +7,27 @@ Row { id: eventContent spacing: theme.spacing / 2 - readonly property string hoveredLink: - nameLabel.hoveredLink || contentLabel.hoveredLink readonly property string eventText: Utils.processedEventText(model) readonly property string eventTime: Utils.formatTime(model.date) readonly property int eventTimeSpaces: 2 + readonly property string hoveredLink: + nameLabel.hoveredLink || contentLabel.hoveredLink + + readonly property int cursorShape: + hoveredLink ? Qt.PointingHandCursor : + nameHover.hovered || contentHover.hovered ? Qt.IBeamCursor : + Qt.ArrowCursor + + + // Needed because of eventList's MouseArea which steals the + // HSelectableLabel's MouseArea hover events + onCursorShapeChanged: eventList.cursorShape = cursorShape + + + HoverHandler { id: hover } + Item { width: hideAvatar ? 0 : 48 height: hideAvatar ? 0 : collapseAvatar ? 1 : smallAvatar ? 28 : 48 @@ -74,6 +88,8 @@ Row { function selectAllTextPlus() { contentLabel.selectAllTextPlus() } + + HoverHandler { id: nameHover } } HSelectableLabel { @@ -124,6 +140,7 @@ Row { contentLabel.updateContainerSelectedTexts() } + HoverHandler { id: contentHover } } } } diff --git a/src/qml/Chat/Timeline/EventList.qml b/src/qml/Chat/Timeline/EventList.qml index 9819bb8c..f824c8e0 100644 --- a/src/qml/Chat/Timeline/EventList.qml +++ b/src/qml/Chat/Timeline/EventList.qml @@ -92,6 +92,8 @@ Rectangle { property bool ownEventsOnRight: width < theme.chat.eventList.ownEventsOnRightUnderWidth + property alias cursorShape: mouseArea.cursorShape + function canCombine(item, itemAfter) { if (! item || ! itemAfter) return false @@ -154,6 +156,19 @@ Rectangle { } delegate: EventDelegate {} + + MouseArea { + id: mouseArea + anchors.fill: parent + acceptedButtons: Qt.NoButton + + onWheel: Utils.smartVerticalFlick( + eventList, + 200 * Qt.styleHints.wheelScrollLines * + (wheel.angleDelta.y < 0 ? 1 : -1), + 3 + ) + } } }