Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show line indicator instead of rectangle while dragging in tables #5252

Merged
merged 6 commits into from
Mar 17, 2024

Conversation

Nerixyz
Copy link
Contributor

@Nerixyz Nerixyz commented Mar 16, 2024

The user experience of dragging rows around in tables isn't the best, as you don't really have a great indicator of where a row will be dropped at. I found that you can proxy PE_IndicatorItemViewItemDrop, the drop indicator and draw your own stuff. To get the direction, a row is dragged in, the model indices are compared. If no target is found, a red border will appear around the viewport.

Before After
Move chatterino_2024-03-16_19-00-52 chatterino_2024-03-16_18-56-39
Invalid Move chatterino_2024-03-16_19-02-01 Unchanged

Copy link
Member

@pajlada pajlada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some small nits - haven't tested this yet but it looks good

src/widgets/helper/TableStyle.hpp Outdated Show resolved Hide resolved
src/widgets/helper/TableStyle.hpp Outdated Show resolved Hide resolved
@pajlada pajlada enabled auto-merge (squash) March 17, 2024 11:15
@pajlada pajlada merged commit 0322d37 into Chatterino:master Mar 17, 2024
17 checks passed
@Nerixyz Nerixyz deleted the fix/table-view-indicator branch March 17, 2024 11:21
Felanbird added a commit that referenced this pull request Mar 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants